Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/cross-language-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,9 @@ jobs:
go mod download
- name: Lint the Go project
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1
with:
version: 'v1.64.2'
version: 'v2.8.0'
skip-cache: true
working-directory: 'tests/cross-language/go'

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/go-appencryption-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ jobs:
go install gotest.tools/gotestsum@latest

- name: Run linters
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1
with:
version: 'v1.64.2'
version: 'v2.8.0'
skip-cache: true
working-directory: 'go/appencryption'

Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/go-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,9 @@ jobs:
./scripts/build.sh

- name: Run linters
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1
with:
version: 'v1.64.2'
version: 'v2.8.0'
skip-cache: true
working-directory: 'samples/go/referenceapp'

Expand Down Expand Up @@ -123,8 +123,8 @@ jobs:
./scripts/test.sh

- name: Run linters
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1
with:
version: 'v1.64.2'
version: 'v2.8.0'
skip-cache: true
working-directory: 'server/go'
5 changes: 3 additions & 2 deletions .github/workflows/go-securememory-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ jobs:
go install gotest.tools/gotestsum@latest

- name: Run linters
uses: golangci/golangci-lint-action@051d91933864810ecd5e2ea2cfd98f6a5bca5347 # v6.3.2
uses: golangci/golangci-lint-action@9fae48acfc02a90574d7c304a1758ef9895495fa # v7.0.1
with:
version: 'v1.64.2'
version: 'v2.8.0'
skip-cache: true
working-directory: 'go/securememory'

- name: Run unit tests
Expand Down
5 changes: 4 additions & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ Asherah is an application-layer encryption SDK providing envelope encryption wit

## Lint Commands
- C#: `dotnet format` for formatting, built-in analyzers
- Go: `./scripts/lint.sh` (installs and runs golangci-lint v1.59.0)
- Go: Binary installation via `curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v2.8.0`
- Alternatively: `brew install golangci-lint` (installs latest v2)
- Version should match CI configuration (currently v2.8.0)
- Run with: `golangci-lint run` in module directory
- Java: Checkstyle via Maven (configured in pom.xml)

## Environment Setup
Expand Down
7 changes: 0 additions & 7 deletions build/go/lint.sh

This file was deleted.

254 changes: 126 additions & 128 deletions go/appencryption/.golangci.yml
Original file line number Diff line number Diff line change
@@ -1,144 +1,142 @@
# options for analysis running
version: "2"
run:
# default concurrency is a available CPU number
concurrency: 4

# timeout for analysis, e.g. 30s, 5m, default is 1m
deadline: 5m

# exit code when at least one issue was found, default is 1
go: "1.19"
modules-download-mode: readonly
issues-exit-code: 1

# ugly code is ugly - test code is no exception
tests: true

# by default isn't set. If set we pass it to "go list -mod={option}". From "go help modules":
# If invoked with -mod=readonly, the go command is disallowed from the implicit
# automatic updating of go.mod described above. Instead, it fails when any changes
# to go.mod are needed. This setting is most useful to check that go.mod does
# not need updates, such as in a continuous integration and testing system.
# If invoked with -mod=vendor, the go command assumes that the vendor
# directory holds the correct copies of dependencies and ignores
# the dependency descriptions in go.mod.
modules-download-mode: readonly

# go version to use. Default is the version of the go command.
go: "1.19"

output:
formats:
- format: colored-line-number
text:
path: stdout

# Sort results by the order defined in `sort-order`.
# Default: false
sort-results: true

# Order to use when sorting results.
# Require `sort-results` to `true`.
# Possible values: `file`, `linter`, and `severity`.
#
# If the severity values are inside the following list, they are ordered in this order:
# 1. error
# 2. warning
# 3. high
# 4. medium
# 5. low
# Either they are sorted alphabetically.
#
# Default: ["file"]
sort-order:
# - linter
# - severity
- file # filepath, line, and column.

# show stats
show-stats: true

- file
linters:
enable-all: false
enabled:
- errcheck
- gosimple
- govet
- ineffassign
- staticcheck
- unused
fast: false

enable:
- asasalint
- asciicheck
- bidichk
- bodyclose
- cyclop
- depguard
- dupword
- durationcheck
- errchkjson
- errorlint
- exhaustive
- fatcontext
- funlen
- gocheckcompilerdirectives
- gochecksumtype
- gocognit
- gocyclo
- godot
- gomoddirectives
- gomodguard
- gosec
- gosmopolitan
- loggercheck
- maintidx
- makezero
- misspell
- musttag
- nestif
- nilerr
- nilnesserr
- noctx
- perfsprint
- prealloc
- protogetter
- reassign
- recvcheck
- rowserrcheck
- spancheck
- sqlclosecheck
- unparam
- zerologlint
disable:
- contextcheck
- err113
- godox
- testifylint
- wrapcheck

presets:
- bugs
- comment
- complexity
- error
- format
- import
# - metalinter
- module
- performance
- sql
# - style
# - test
- unused

linters-settings:
cyclop:
# The maximal code complexity to report.
# Default: 10
max-complexity: 20

depguard:
settings:
cyclop:
max-complexity: 20
depguard:
rules:
errors:
list-mode: lax
files:
- $all
deny:
- pkg: github.com/pkg/errors
desc: pkg/errors is deprecated, use errors package from stdlib
main:
list-mode: lax
files:
- '!$test'
- '!**/plugins/**'
deny:
- pkg: github.com/aws/aws-sdk-go
desc: aws-sdk-go dependants must be in plugins/aws-v1
funlen:
lines: 70
gosec:
excludes:
- G115
exclusions:
generated: lax
presets:
- comments
- common-false-positives
- legacy
- std-error-handling
rules:
main:
list-mode: lax
files:
- "!$test"
- "!**/plugins/**"
deny:
- pkg: github.com/aws/aws-sdk-go
desc: "aws-sdk-go dependants must be in plugins/aws-v1"
errors:
list-mode: lax
files:
- "$all"
deny:
- pkg: github.com/pkg/errors
desc: "pkg/errors is deprecated, use errors package from stdlib"

gci:
sections:
- standard
- default
- prefix(github.com/godaddy/asherah/go/appencryption)
custom-order: true

gosec:
excludes:
- G115

funlen:
lines: 70

issues:
exclude-rules:
- path: _test\.go
linters:
- errcheck
- godot
- gosec
- perfsprint
- path: plugins/aws-v1/
linters:
- staticcheck
text: "SA1019.*aws-sdk-go.*deprecated"
- path: pkg/(kms|persistence)/
linters:
- staticcheck
text: "SA1019.*is deprecated.*AWS SDK v1 reached end-of-life"
- linters:
- errcheck
- godot
- gosec
- perfsprint
path: _test\.go
- linters:
- prealloc
path: (_test\.go|memory\.go)
text: Consider preallocating
- linters:
- gosmopolitan
path: _test\.go
- linters:
- staticcheck
text: ST1012.*error var.*should have name of the form ErrFoo
- linters:
- staticcheck
path: plugins/aws-v1/
text: SA1019.*aws-sdk-go.*deprecated
- linters:
- staticcheck
path: pkg/(kms|persistence)/
text: SA1019.*is deprecated.*AWS SDK v1 reached end-of-life
paths:
- third_party$
- builtin$
- examples$
formatters:
enable:
- gci
- gofmt
- gofumpt
- goimports
settings:
gci:
sections:
- standard
- default
- prefix(github.com/godaddy/asherah/go/appencryption)
custom-order: true
exclusions:
generated: lax
paths:
- third_party$
- builtin$
- examples$
1 change: 0 additions & 1 deletion go/appencryption/scripts/lint.sh

This file was deleted.

2 changes: 1 addition & 1 deletion go/appencryption/session_cache_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ type testLogger struct {
}

func (t *testLogger) Debugf(f string, v ...interface{}) {
t.Builder.WriteString(fmt.Sprintf(f, v...))
fmt.Fprintf(t, f, v...)
}

func TestSessionCacheCloseWithDebugLogging(t *testing.T) {
Expand Down
Loading