Skip to content

Commit

Permalink
lint: Verified that all files adhere to .editorconfig.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyzyx committed Nov 15, 2023
1 parent 247c257 commit f334dc4
Show file tree
Hide file tree
Showing 11 changed files with 110 additions and 58 deletions.
21 changes: 21 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Exclude": [
"\\.cache$",
"\\.dcignore$",
"\\.example$",
"\\.go$",
"\\.golangci.yml$",
"\\.goreleaser.yml$",
"\\.gotmpl$",
"\\.svg$",
"\\.terraform\\.lock\\.hcl$",
"\\.txt$",
"composer\\.lock$",
"go\\.mod$",
"go\\.sum$",
"package-lock\\.json$"
],
"IgnoreDefaults": true,
"SpacesAfterTabs": false,
"Verbose": false
}
40 changes: 29 additions & 11 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uses editorconfig to maintain consistent coding styles
# http://EditorConfig.org
# https://editorconfig.org

root = true

Expand All @@ -10,24 +10,42 @@ indent_size = 4
indent_style = space
insert_final_newline = true
max_line_length = 120
tab_width = 4
trim_trailing_whitespace = true

[*.toml]
indent_size = 4
[Makefile*]
indent_style = tab
max_line_length = 20000

[*.{css,html,js,json,less,sass,scss,yaml,yml}]
# Web
[*.{css,html,js,less,sass,scss}]
indent_size = 2

[*.{tf,tfvars}]
# Configuration formats
[*.{hcl,json,toml,yaml,yml}]
indent_size = 2
indent_style = space

[*.go]
indent_style = tab

[*.{md,md.tmpl}]
indent_size = 2
max_line_length = 20000

[*.py]
indent_size = 4

[*.md]
max_line_length = 0
trim_trailing_whitespace = false
[*.sh]
indent_size = 4
max_line_length = 120

[Makefile*]
indent_style = tab
# Terraform files
[*.{tf,tftpl,tfvars}]
indent_size = 2
indent_style = space

[.yamllint]
indent_size = 2

[bats/*.sh]
max_line_length = 20000
4 changes: 2 additions & 2 deletions .github/workflows/govulncheck.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ jobs:
- name: Install Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ">= 1.21"
go-version: '>= 1.21'
cache: true

- id: govulncheck
uses: golang/govulncheck-action@7da72f730e37eeaad891fcff0a532d27ed737cd4 # v1.0.1
with:
go-version-input: ">= 1.21"
go-version-input: '>= 1.21'
check-latest: true
21 changes: 11 additions & 10 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@ jobs:
- name: Install Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ">= 1.21"
go-version: '>= 1.21'
cache: true

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

- name: Run unit tests
Expand All @@ -80,12 +81,12 @@ jobs:
fail-fast: false
matrix:
terraform_version:
- "1.1"
- "1.2"
- "1.3"
- "1.4"
- "1.5"
- "1.6"
- '1.1'
- '1.2'
- '1.3'
- '1.4'
- '1.5'
- '1.6'

steps:
- name: Harden Runner
Expand All @@ -108,7 +109,7 @@ jobs:
- name: Install Go
uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4.1.0
with:
go-version: ">= 1.21"
go-version: '>= 1.21'
cache: true

- name: Install Terraform
Expand Down
4 changes: 2 additions & 2 deletions .gommit.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[config]
exclude-merge-commits = true
check-summary-length = true
summary-length = 80
check-summary-length = true
summary-length = 80

[matchers]
all = "(?:build|ci|deps|docs|feat|fix|lint|perf|refactor|style|test)(?:\\([^\\)]*\\))?: (?:.+)"
Expand Down
7 changes: 7 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ repos:

- repo: local
hooks:
- id: editorconfig-checker
name: editorconfig-checker
description: Double-check editorconfig compliance
entry: bash -c 'editorconfig-checker'
language: system
stages: [commit, push]

- id: trufflehog
name: TruffleHog
description: Detect secrets in your data.
Expand Down
6 changes: 3 additions & 3 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# File @generated by scripts/generate-authors.sh. DO NOT EDIT.
# This file lists all contributors to the repository.
# See scripts/generate-authors.sh to make modifications.
# File @generated by scripts/generate-authors.sh. DO NOT EDIT.
# This file lists all contributors to the repository.
# See scripts/generate-authors.sh to make modifications.

dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Ryan Parman <[email protected]>
Expand Down
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ It will show you something like this:
goos: darwin
goarch: arm64
pkg: github.com/northwood-labs/terraform-provider-corefunc/corefunc
│ Current │ Previous │
│ sec/op │ sec/op vs base │
│ Current │ Previous │
│ sec/op │ sec/op vs base │
TruncateLabel/balanced0-10 2.100n ± 1% 103.600n ± 3% +4833.33% (p=0.002 n=6)
TruncateLabel/balanced3-10 2.104n ± 0% 103.750n ± 2% +4831.08% (p=0.002 n=6)
TruncateLabel/balanced5-10 2.103n ± 1% 104.000n ± 1% +4845.32% (p=0.002 n=6)
Expand Down
46 changes: 23 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,27 +68,27 @@ terraform-provider-corefunc version
```

```plain
BASIC
Version: dev
Go version: go1.21.1
Git commit: 80ac4b1062bfeb81734e505f7fd977050bc4a3e9
Dirty repo: true
PGO: default.pgo
Build date: 2023-09-24T23:50:26Z
OS/Arch: darwin/arm64
System: macOS on Apple Silicon
CPU Cores: 10
DEPENDENCIES
github.com/chanced/caps v1.0.1
github.com/fatih/color v1.15.0
github.com/golang/protobuf v1.5.3
github.com/gookit/color v1.5.4
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-plugin v1.5.1
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-framework v1.4.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.19.0
[...snip...]
BASIC
Version: dev
Go version: go1.21.1
Git commit: 80ac4b1062bfeb81734e505f7fd977050bc4a3e9
Dirty repo: true
PGO: default.pgo
Build date: 2023-09-24T23:50:26Z
OS/Arch: darwin/arm64
System: macOS on Apple Silicon
CPU Cores: 10
DEPENDENCIES
github.com/chanced/caps v1.0.1
github.com/fatih/color v1.15.0
github.com/golang/protobuf v1.5.3
github.com/gookit/color v1.5.4
github.com/hashicorp/go-hclog v1.5.0
github.com/hashicorp/go-plugin v1.5.1
github.com/hashicorp/go-uuid v1.0.3
github.com/hashicorp/terraform-plugin-framework v1.4.0
github.com/hashicorp/terraform-plugin-framework-validators v0.12.0
github.com/hashicorp/terraform-plugin-go v0.19.0
[...snip...]
```
14 changes: 10 additions & 4 deletions scripts/generate-authors.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,18 @@ set -e
# see also ".mailmap" for how email addresses and names are deduplicated
OUT="${1:-.}"
{
cat <<- 'EOH'
# editorconfig-checker-disable
cat <<- 'EOF'
# File @generated by scripts/generate-authors.sh. DO NOT EDIT.
# This file lists all contributors to the repository.
# See scripts/generate-authors.sh to make modifications.
EOH
EOF
# editorconfig-checker-enable

echo

# shellcheck disable=2312
git log --format='%aN <%aE>' | LC_ALL=C.UTF-8 sort -uf
} > "$OUT/AUTHORS"
cat "$OUT/AUTHORS"

} > "${OUT}/AUTHORS"
cat "${OUT}/AUTHORS"
1 change: 0 additions & 1 deletion testing

This file was deleted.

0 comments on commit f334dc4

Please sign in to comment.