generated from amazon-archives/__template_Custom
-
Notifications
You must be signed in to change notification settings - Fork 237
Bump linter for go1.25 compatibility. apply linting fixes #1849
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
Open
dricross
wants to merge
14
commits into
main
Choose a base branch
from
dricross/lintbump
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
b248795
Bump linter for go1.25 compatibility. apply linting fixes
dricross 2cd6b59
Add go.mod and Makefile to lint file filters
dricross a42b3cb
Apply more lint fixes
dricross 756136e
Ignore util for meaningless name
dricross b6288a0
bump go version in github workflows
dricross ffa142f
Fix golangci-lint unused constants issue
the-mann b5c78c1
Use nolint comments instead of build constraints for unused constants
the-mann 922eb50
Fix TestConvertOtelExponentialHistogram floating-point precision issue
the-mann 2ee25f8
Clean rebase: Update go.mod to Go 1.25.5 from main baseline
the-mann 665589f
Fix remaining linting issues after rebase
the-mann 8547d8c
Fix package naming issues in all util package files
the-mann c648085
Add proper golangci-lint exclusions and fix remaining issues
the-mann 74f4436
Revert to using inline nolint comments instead of exclusions
the-mann abfd2d8
Maintain consistent E! error logging pattern
the-mann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,6 +3,8 @@ lint: | |
| - '**/*.sh' | ||
| - '.golangci.yml' | ||
| - 'packaging/**' | ||
| - 'go.mod' | ||
| - 'Makefile' | ||
|
|
||
| build: | ||
| - 'Makefile' | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,68 +1,58 @@ | ||
| version: "2" | ||
| run: | ||
| # The default concurrency value is the number of available CPU. | ||
| concurrency: 4 | ||
|
|
||
| # Timeout for analysis, e.g. 30s, 5m, default is 1m | ||
| timeout: 20m | ||
|
|
||
| # Exit code when at least one issue was found, default is 1 | ||
| modules-download-mode: readonly | ||
| issues-exit-code: 1 | ||
|
|
||
| # Include test files or not, default is true | ||
| tests: true | ||
|
|
||
| # 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. | ||
| modules-download-mode: readonly | ||
|
|
||
| output: | ||
| # colored-line-number|line-number|json|tab|checkstyle|code-climate, default is "colored-line-number" | ||
| formats: colored-line-number | ||
|
|
||
| # print lines of code with issue, default is true | ||
| print-issued-lines: true | ||
|
|
||
| # print linter name in the end of issue text, default is true | ||
| print-linter-name: true | ||
|
|
||
| # All available settings of specific linters | ||
| linters-settings: | ||
| gofmt: | ||
| # Simplify code: gofmt with `-s` option, true by default | ||
| simplify: true | ||
| goimports: | ||
| # Put imports beginning with prefix after 3rd-party packages. | ||
| # It's a comma-separated list of prefixes. | ||
| local-prefixes: github.com/aws/amazon-cloudwatch-agent | ||
| misspell: | ||
| # Correct spellings using locale preferences for US or UK. | ||
| # Default is to use a neutral variety of English. | ||
| # Setting locale to US will correct the British spelling of 'colour' to 'color'. | ||
| ignore-words: | ||
| - performancetest | ||
|
|
||
| formats: | ||
| text: | ||
| path: stdout | ||
| print-linter-name: true | ||
| print-issued-lines: true | ||
| linters: | ||
| disable: | ||
| - errcheck | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| - gosec | ||
| - gosimple | ||
| - ineffassign | ||
| - misspell | ||
| - revive | ||
| - unused | ||
| - nonamedreturns | ||
| - revive | ||
| disable: | ||
| - errcheck | ||
| settings: | ||
| misspell: | ||
| ignore-rules: | ||
| - performancetest | ||
| exclusions: | ||
| generated: lax | ||
| presets: | ||
| - comments | ||
| - common-false-positives | ||
| - legacy | ||
| - std-error-handling | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
| rules: | ||
| # Package name based on field in JSON | ||
| - path: 'translator/translate/logs/logs_collected/windows_events' | ||
| text: "var-naming: don't use an underscore in package name" | ||
| linters: | ||
| - revive | ||
|
|
||
| - linters: | ||
| - revive | ||
| path: 'translator/translate/util/*' | ||
| text: 'var-naming: avoid meaningless package names' | ||
| issues: | ||
| new-from-rev: 9af4477 | ||
| new-from-rev: 9af4477 | ||
| formatters: | ||
| enable: | ||
| - gofmt | ||
| - goimports | ||
| settings: | ||
| gofmt: | ||
| simplify: true | ||
| goimports: | ||
| local-prefixes: | ||
| - github.com/aws/amazon-cloudwatch-agent | ||
| exclusions: | ||
| generated: lax | ||
| paths: | ||
| - third_party$ | ||
| - builtin$ | ||
| - examples$ | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,7 @@ install-addlicense: | |
| install-golangci-lint: | ||
| #Install from source for golangci-lint is not recommended based on https://golangci-lint.run/usage/install/#install-from-source so using binary | ||
| #installation | ||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v1.64.2 | ||
| curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/HEAD/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) v2.4.0 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
|
|
||
| fmt: install-goimports addlicense | ||
| go fmt ./... | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't realize this exception was in the original config and wasn't moved in the migration until after I fixed it.