-
Notifications
You must be signed in to change notification settings - Fork 19
chore: update golangci-lint
#1053
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
Conversation
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.
Questions:
Is there any way to share the linter configuration between these two projects?
(if no) Can you provide a pointer to where this is being done in avalanchego so I can compare?
(if yes) let's do that instead!
@rkuris I don't believe there's a way to share linter configs between the two projects. Linter rules in AvalancheGo: https://github.com/ava-labs/avalanchego/blob/master/.golangci.yml |
I'm worried about them getting out of sync again. Possible solutions: 1 - Generate the golangci.yml file by fetching it from avalanchego's main and tweaking it before running the ci rule These are in order of preference. |
Went with the second option. The expected diff between the Firewood and AvalancheGo |
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.
Approved with nits
run: | ||
timeout: 10m |
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.
Why remove the timeout?
While looking into Taskfiles for `ffi`, I noticed that we're still using `golangci-lint v1` while AvalancheGo is already using `golangci-lint v2`. This PR upgrades the version of `golangci-lint` used in `ffi` to `v2`. To maintain synchrony between the Firewood and AvalancheGo linter rules, an additional CI job (`expected-golangci-yaml-diff`) ensures that the difference between the two `.golangci.yaml` files is equal to the contents of `golangci_yaml_expected_changes.txt`. ## What - Copied over current AvalancheGo `golangci.yml` file and removing AvalancheGo-specific rules. - Bumped version of `golangci-lint` action used in CI. - Added `expected-golangci-yaml-diff` CI job - Linted files ## How This Was Tested Ran `golangci-lint` locally + CI.
While looking into Taskfiles for `ffi`, I noticed that we're still using `golangci-lint v1` while AvalancheGo is already using `golangci-lint v2`. This PR upgrades the version of `golangci-lint` used in `ffi` to `v2`. To maintain synchrony between the Firewood and AvalancheGo linter rules, an additional CI job (`expected-golangci-yaml-diff`) ensures that the difference between the two `.golangci.yaml` files is equal to the contents of `golangci_yaml_expected_changes.txt`. ## What - Copied over current AvalancheGo `golangci.yml` file and removing AvalancheGo-specific rules. - Bumped version of `golangci-lint` action used in CI. - Added `expected-golangci-yaml-diff` CI job - Linted files ## How This Was Tested Ran `golangci-lint` locally + CI.
While looking into Taskfiles for
ffi
, I noticed that we're still usinggolangci-lint v1
while AvalancheGo is already usinggolangci-lint v2
. This PR upgrades the version ofgolangci-lint
used inffi
tov2
.To maintain synchrony between the Firewood and AvalancheGo linter rules, an additional CI job (
expected-golangci-yaml-diff
) ensures that the difference between the two.golangci.yaml
files is equal to the contents ofgolangci_yaml_expected_changes.txt
.What
golangci.yml
file and removing AvalancheGo-specific rules.golangci-lint
action used in CI.expected-golangci-yaml-diff
CI jobHow This Was Tested
Ran
golangci-lint
locally + CI.