Skip to content

Commit f334dc4

Browse files
committed
lint: Verified that all files adhere to .editorconfig.
1 parent 247c257 commit f334dc4

11 files changed

+110
-58
lines changed

.ecrc

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"Exclude": [
3+
"\\.cache$",
4+
"\\.dcignore$",
5+
"\\.example$",
6+
"\\.go$",
7+
"\\.golangci.yml$",
8+
"\\.goreleaser.yml$",
9+
"\\.gotmpl$",
10+
"\\.svg$",
11+
"\\.terraform\\.lock\\.hcl$",
12+
"\\.txt$",
13+
"composer\\.lock$",
14+
"go\\.mod$",
15+
"go\\.sum$",
16+
"package-lock\\.json$"
17+
],
18+
"IgnoreDefaults": true,
19+
"SpacesAfterTabs": false,
20+
"Verbose": false
21+
}

.editorconfig

+29-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Uses editorconfig to maintain consistent coding styles
2-
# http://EditorConfig.org
2+
# https://editorconfig.org
33

44
root = true
55

@@ -10,24 +10,42 @@ indent_size = 4
1010
indent_style = space
1111
insert_final_newline = true
1212
max_line_length = 120
13+
tab_width = 4
1314
trim_trailing_whitespace = true
1415

15-
[*.toml]
16-
indent_size = 4
16+
[Makefile*]
17+
indent_style = tab
18+
max_line_length = 20000
1719

18-
[*.{css,html,js,json,less,sass,scss,yaml,yml}]
20+
# Web
21+
[*.{css,html,js,less,sass,scss}]
1922
indent_size = 2
2023

21-
[*.{tf,tfvars}]
24+
# Configuration formats
25+
[*.{hcl,json,toml,yaml,yml}]
2226
indent_size = 2
23-
indent_style = space
27+
28+
[*.go]
29+
indent_style = tab
30+
31+
[*.{md,md.tmpl}]
32+
indent_size = 2
33+
max_line_length = 20000
2434

2535
[*.py]
2636
indent_size = 4
2737

28-
[*.md]
29-
max_line_length = 0
30-
trim_trailing_whitespace = false
38+
[*.sh]
39+
indent_size = 4
40+
max_line_length = 120
3141

32-
[Makefile*]
33-
indent_style = tab
42+
# Terraform files
43+
[*.{tf,tftpl,tfvars}]
44+
indent_size = 2
45+
indent_style = space
46+
47+
[.yamllint]
48+
indent_size = 2
49+
50+
[bats/*.sh]
51+
max_line_length = 20000

.github/workflows/govulncheck.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -28,11 +28,11 @@ jobs:
2828
- name: Install Go
2929
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3030
with:
31-
go-version: ">= 1.21"
31+
go-version: '>= 1.21'
3232
cache: true
3333

3434
- id: govulncheck
3535
uses: golang/govulncheck-action@7da72f730e37eeaad891fcff0a532d27ed737cd4 # v1.0.1
3636
with:
37-
go-version-input: ">= 1.21"
37+
go-version-input: '>= 1.21'
3838
check-latest: true

.github/workflows/test.yml

+11-10
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,13 @@ jobs:
3737
- name: Install Go
3838
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
3939
with:
40-
go-version: ">= 1.21"
40+
go-version: '>= 1.21'
4141
cache: true
4242

4343
- name: Run mutation tests
4444
run: |
45-
cd ./corefunc && go test -tags=mutation -count=1 -parallel=$(nproc) -timeout 30s -ooze.v=true | grep -v "^[[:lower:]]" | grep -v "^)"
45+
cd ./corefunc && go test -tags=mutation -count=1 -parallel=$(nproc) -timeout 30s -ooze.v=true \
46+
| grep -v "^[[:lower:]]" | grep -v "^)"
4647
4748
unit:
4849
runs-on: ubuntu-latest
@@ -65,7 +66,7 @@ jobs:
6566
- name: Install Go
6667
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
6768
with:
68-
go-version: ">= 1.21"
69+
go-version: '>= 1.21'
6970
cache: true
7071

7172
- name: Run unit tests
@@ -80,12 +81,12 @@ jobs:
8081
fail-fast: false
8182
matrix:
8283
terraform_version:
83-
- "1.1"
84-
- "1.2"
85-
- "1.3"
86-
- "1.4"
87-
- "1.5"
88-
- "1.6"
84+
- '1.1'
85+
- '1.2'
86+
- '1.3'
87+
- '1.4'
88+
- '1.5'
89+
- '1.6'
8990

9091
steps:
9192
- name: Harden Runner
@@ -108,7 +109,7 @@ jobs:
108109
- name: Install Go
109110
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
110111
with:
111-
go-version: ">= 1.21"
112+
go-version: '>= 1.21'
112113
cache: true
113114

114115
- name: Install Terraform

.gommit.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[config]
22
exclude-merge-commits = true
3-
check-summary-length = true
4-
summary-length = 80
3+
check-summary-length = true
4+
summary-length = 80
55

66
[matchers]
77
all = "(?:build|ci|deps|docs|feat|fix|lint|perf|refactor|style|test)(?:\\([^\\)]*\\))?: (?:.+)"

.pre-commit-config.yaml

+7
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,13 @@ repos:
9090

9191
- repo: local
9292
hooks:
93+
- id: editorconfig-checker
94+
name: editorconfig-checker
95+
description: Double-check editorconfig compliance
96+
entry: bash -c 'editorconfig-checker'
97+
language: system
98+
stages: [commit, push]
99+
93100
- id: trufflehog
94101
name: TruffleHog
95102
description: Detect secrets in your data.

AUTHORS

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# File @generated by scripts/generate-authors.sh. DO NOT EDIT.
2-
# This file lists all contributors to the repository.
3-
# See scripts/generate-authors.sh to make modifications.
1+
# File @generated by scripts/generate-authors.sh. DO NOT EDIT.
2+
# This file lists all contributors to the repository.
3+
# See scripts/generate-authors.sh to make modifications.
44

55
dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
66
Ryan Parman <ryan@ryanparman.com>

CONTRIBUTING.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,8 @@ It will show you something like this:
318318
goos: darwin
319319
goarch: arm64
320320
pkg: github.com/northwood-labs/terraform-provider-corefunc/corefunc
321-
│ Current │ Previous │
322-
│ sec/op │ sec/op vs base │
321+
│ Current │ Previous │
322+
│ sec/op │ sec/op vs base │
323323
TruncateLabel/balanced0-10 2.100n ± 1% 103.600n ± 3% +4833.33% (p=0.002 n=6)
324324
TruncateLabel/balanced3-10 2.104n ± 0% 103.750n ± 2% +4831.08% (p=0.002 n=6)
325325
TruncateLabel/balanced5-10 2.103n ± 1% 104.000n ± 1% +4845.32% (p=0.002 n=6)

README.md

+23-23
Original file line numberDiff line numberDiff line change
@@ -68,27 +68,27 @@ terraform-provider-corefunc version
6868
```
6969

7070
```plain
71-
BASIC
72-
Version: dev
73-
Go version: go1.21.1
74-
Git commit: 80ac4b1062bfeb81734e505f7fd977050bc4a3e9
75-
Dirty repo: true
76-
PGO: default.pgo
77-
Build date: 2023-09-24T23:50:26Z
78-
OS/Arch: darwin/arm64
79-
System: macOS on Apple Silicon
80-
CPU Cores: 10
81-
82-
DEPENDENCIES
83-
github.com/chanced/caps v1.0.1
84-
github.com/fatih/color v1.15.0
85-
github.com/golang/protobuf v1.5.3
86-
github.com/gookit/color v1.5.4
87-
github.com/hashicorp/go-hclog v1.5.0
88-
github.com/hashicorp/go-plugin v1.5.1
89-
github.com/hashicorp/go-uuid v1.0.3
90-
github.com/hashicorp/terraform-plugin-framework v1.4.0
91-
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
92-
github.com/hashicorp/terraform-plugin-go v0.19.0
93-
[...snip...]
71+
BASIC
72+
Version: dev
73+
Go version: go1.21.1
74+
Git commit: 80ac4b1062bfeb81734e505f7fd977050bc4a3e9
75+
Dirty repo: true
76+
PGO: default.pgo
77+
Build date: 2023-09-24T23:50:26Z
78+
OS/Arch: darwin/arm64
79+
System: macOS on Apple Silicon
80+
CPU Cores: 10
81+
82+
DEPENDENCIES
83+
github.com/chanced/caps v1.0.1
84+
github.com/fatih/color v1.15.0
85+
github.com/golang/protobuf v1.5.3
86+
github.com/gookit/color v1.5.4
87+
github.com/hashicorp/go-hclog v1.5.0
88+
github.com/hashicorp/go-plugin v1.5.1
89+
github.com/hashicorp/go-uuid v1.0.3
90+
github.com/hashicorp/terraform-plugin-framework v1.4.0
91+
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
92+
github.com/hashicorp/terraform-plugin-go v0.19.0
93+
[...snip...]
9494
```

scripts/generate-authors.sh

+10-4
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,18 @@ set -e
44
# see also ".mailmap" for how email addresses and names are deduplicated
55
OUT="${1:-.}"
66
{
7-
cat <<- 'EOH'
7+
# editorconfig-checker-disable
8+
cat <<- 'EOF'
89
# File @generated by scripts/generate-authors.sh. DO NOT EDIT.
910
# This file lists all contributors to the repository.
1011
# See scripts/generate-authors.sh to make modifications.
11-
EOH
12+
EOF
13+
# editorconfig-checker-enable
14+
1215
echo
16+
17+
# shellcheck disable=2312
1318
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
14-
} > "$OUT/AUTHORS"
15-
cat "$OUT/AUTHORS"
19+
20+
} > "${OUT}/AUTHORS"
21+
cat "${OUT}/AUTHORS"

testing

-1
This file was deleted.

0 commit comments

Comments
 (0)