diff --git a/.changelog/71.txt b/.changelog/71.txt new file mode 100644 index 0000000..523e355 --- /dev/null +++ b/.changelog/71.txt @@ -0,0 +1,7 @@ +```release-note:note +`linters` - Remove deprecated linters. +``` + +```release-note:breaking-change +`golang` - Upgrade to Golang 1.21. +``` \ No newline at end of file diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 86d1c43..a2a8c4b 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -41,7 +41,7 @@ jobs: fail-fast: false matrix: go: - - '1.20' + - '1.21' steps: - uses: actions/setup-go@v5 with: diff --git a/.golangci.yml b/.golangci.yml index b35a6bc..2026d8c 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,21 +1,18 @@ # Visit https://golangci-lint.run/ for usage documentation # and information on other useful linters issues: - max-per-linter: 0 max-same-issues: 0 linters: enable: - asciicheck # Simple linter to check that your code does not contain non-ASCII identifiers [fast: true, auto-fix: false] - bidichk # Checks for dangerous unicode character sequences [fast: true, auto-fix: false] - - deadcode # Finds unused code [fast: false, auto-fix: false] - decorder # check declaration order and count of types, constants, variables and functions [fast: true, auto-fix: false] - dogsled # Checks assignments with too many blank identifiers (e.g. x, _, _, _, := f()) [fast: true, auto-fix: false] - durationcheck # check for two durations multiplied together [fast: false, auto-fix: false] - errcheck # Errcheck is a program for checking for unchecked errors in go programs. These unchecked errors can be critical bugs in some cases [fast: false, auto-fix: false] - errchkjson # Checks types passed to the json encoding functions. Reports unsupported types and optionally reports occasions, where the check for the returned error can be omitted. [fast: false, auto-fix: false] - errname # Checks that sentinel errors are prefixed with the `Err` and error types are suffixed with the `Error`. [fast: false, auto-fix: false] - - execinquery # execinquery is a linter about query string checker in Query function which reads your Go src files and warning it finds [fast: false, auto-fix: false] - exportloopref # checks for pointers to enclosing loop variables [fast: false, auto-fix: false] - forbidigo # Forbids identifiers [fast: true, auto-fix: false] - gci # Gci controls golang package import order and makes it always deterministic. [fast: true, auto-fix: false] @@ -33,7 +30,6 @@ linters: - gosimple #(megacheck): Linter for Go source code that specializes in simplifying a code [fast: false, auto-fix: false] - govet #(vet, vetshadow): Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string [fast: false, auto-fix: false] - grouper # An analyzer to analyze expression groups. [fast: true, auto-fix: false] - - ifshort # Checks that your code uses short syntax for if-statements whenever possible [fast: true, auto-fix: false] - importas # Enforces consistent import aliases [fast: false, auto-fix: false] - ineffassign # Detects when assignments to existing variables are not used [fast: true, auto-fix: false] - makezero # Finds slice declarations with non-zero initial length [fast: false, auto-fix: false] @@ -48,14 +44,12 @@ linters: - revive # Fast, configurable, extensible, flexible, and beautiful linter for Go. Drop-in replacement of golint. [fast: false, auto-fix: false] - rowserrcheck # checks whether Err of rows is checked successfully [fast: false, auto-fix: false] - sqlclosecheck # Checks that sql.Rows and sql.Stmt are closed. [fast: false, auto-fix: false] - - structcheck # Finds unused struct fields [fast: false, auto-fix: false] - stylecheck # Stylecheck is a replacement for golint [fast: false, auto-fix: false] - tagliatelle # Checks the struct tags. [fast: true, auto-fix: false] - tenv # tenv is analyzer that detects using os.Setenv instead of t.Setenv since Go1.17 [fast: false, auto-fix: false] - tparallel # tparallel detects inappropriate usage of t.Parallel() method in your Go test codes [fast: false, auto-fix: false] - typecheck # Like the front-end of a Go compiler, parses and type-checks Go code [fast: false, auto-fix: false] - unconvert # Remove unnecessary type conversions [fast: false, auto-fix: false] - - varcheck # Finds unused global variables and constants [fast: false, auto-fix: false] - wastedassign # wastedassign finds wasted assignment statements. [fast: false, auto-fix: false] - whitespace # Tool for detection of leading and trailing whitespace [fast: true, auto-fix: true] @@ -73,7 +67,6 @@ linters: - gocognit # Computes and checks the cognitive complexity of functions [fast: true, auto-fix: false] - godot # Check if comments end in a period [fast: true, auto-fix: true] - godox # Tool for detection of FIXME, TODO and other comment keywords [fast: true, auto-fix: false] - - goerr113 # Golang linter to check the errors handling expressions [fast: false, auto-fix: false] - gomnd # An analyzer to detect magic numbers. [fast: true, auto-fix: false] - lll # Reports long lines [fast: true, auto-fix: false] - maintidx # maintidx measures the maintainability index of each function. [fast: true, auto-fix: false] diff --git a/attrtypes_test.go b/attrtypes_test.go index f67f248..00ab54a 100644 --- a/attrtypes_test.go +++ b/attrtypes_test.go @@ -36,7 +36,6 @@ func TestAttributeTypes(t *testing.T) { } got, err = supertypes.AttributeTypes[struct2](ctx) - if err != nil { t.Fatalf("unexpected error") } diff --git a/go.mod b/go.mod index 35d44bf..4b8f5b4 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,8 @@ module github.com/FrangipaneTeam/terraform-plugin-framework-supertypes -go 1.20 +go 1.21 + +toolchain go1.23.0 require ( github.com/fatih/color v1.16.0