Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tools and fix CI #110

Merged
merged 5 commits into from
Oct 2, 2024
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
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.21.13
1.22.7
14 changes: 4 additions & 10 deletions .golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,7 @@ linters:
- unused # checks Go code for unused constants, variables, functions and types
- govet # Vet examines Go source code and reports suspicious constructs, such as Printf calls whose arguments do not align with the format string
- ineffassign # detects when assignments to existing variables are not used
- structcheck # finds unused struct fields
- typecheck # Like the front-end of a Go compiler, parses and type-checks Go code
- varcheck # Finds unused global variables and constants
- asciicheck # simple linter to check that your code does not contain non-ASCII identifiers
- bodyclose # checks whether HTTP response body is closed successfully
- durationcheck # check for two durations multiplied together
Expand Down Expand Up @@ -87,11 +85,7 @@ linters-settings:

gosimple:
# Select the Go version to target. The default is '1.13'.
go: "1.21.13"

nakedret:
# make an issue if func has more lines of code than this setting and it has naked returns; default is 30
max-func-lines: 0
Comment on lines -92 to -94

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nakedret is a linting check in both the elastic-agent and beats repos. To keep coding standards consistent across repos, perhaps it should be kept here as well and added to the enabled checks?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear, it is still enabled here. What this section does is set it to error for any function with a naked return. Removing it keeps it enabled, but at default configuration, which only applies to functions longer than 30 lines.

And yeah, imo we should do this everywhere. We recently did in elastic agent (elastic/elastic-agent#5442).

go: ""

nolintlint:
# Enable to ensure that nolint directives are all used. Default is true.
Expand Down Expand Up @@ -121,15 +115,15 @@ linters-settings:

staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.21.13"
go: ""

stylecheck:
# Select the Go version to target. The default is '1.13'.
go: "1.21.13"
go: ""

unused:
# Select the Go version to target. The default is '1.13'.
go: "1.21.13"
go: ""

gosec:
excludes:
Expand Down
Loading
Loading