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

chore(linter): using binary staticcheck #4542

Closed
wants to merge 3 commits into from
Closed

Conversation

notanatol
Copy link
Contributor

Checklist

Description

recently I noticed that staticcheck messages in my IDE do not get picked by the golangci-lint here's why:

swarm:bee/ (fix-add-static-check) $ golangci-lint -v linters | grep staticcheck                                                                                                                                                                                                  [18:45:58]
INFO [config_reader] Config search paths: [./ /home/swarm/swarm/bee /home/swarm/swarm /home/swarm /home /]
INFO [config_reader] Used config file .golangci.yml
staticcheck (megacheck): It's a set of rules from staticcheck. It's not the same thing as the staticcheck binary. The author of staticcheck doesn't support or approve the use of staticcheck as a library inside golangci-lint. [fast: false, auto-fix: false]

The author of staticcheck insists the linter to be used as a separate binary.

This PR adds the check before the golangci-lint step and updates the //nolint: directives using the original syntax.

@notanatol notanatol requested a review from mrekucci January 12, 2024 17:03
@notanatol notanatol added the ready for review The PR is ready to be reviewed label Jan 12, 2024
@notanatol notanatol self-assigned this Jan 12, 2024
@notanatol notanatol changed the title fix: using binary staticcheck chore(linter): using binary staticcheck Jan 13, 2024
@notanatol notanatol requested a review from janos January 13, 2024 11:40
@@ -83,6 +83,7 @@ func encryptKey(k *ecdsa.PrivateKey, password string, edg keystore.EDG) ([]byte,
}
addr = a
case elliptic.P256():
//lint:ignore SA1019 to be addressed soon
Copy link
Member

Choose a reason for hiding this comment

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

Actually, I believe that the most correct is to set the ethereum address to the empty string if the curve is not btcec.S256(), as that makes sense only for that curve. The switch was added on #3797 and elliptic.Marshal does not provide a valid ethereum address.

@notanatol notanatol force-pushed the fix-add-static-check branch from 0423098 to 1dac78d Compare January 15, 2024 15:41
@notanatol notanatol closed this Jan 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pull-request ready for review The PR is ready to be reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants