SiaFoundation / core

Core packages for the Sia project
MIT License
51 stars 8 forks source link

Add golangci-lint #134

Closed chris124567 closed 10 months ago

chris124567 commented 10 months ago

I have been adding this to our repos so we can do things like check struct tags automatically. I know core is still changing so if this is unwanted right now please feel free to close this PR.

Edit: Need to do some Ledger review fixes today. Will fix remaining warnings tomorrow.

lukechampine commented 10 months ago

Let's disable modifies-value-receiver and indent-error-flow. if-return is stupid too (it makes refactoring more annoying) but I guess it's situational, and it only comes up in smux which I don't care about.

n8maninger commented 10 months ago

IIRC, we fixed the CI fail on Windows by adding the following step:

- name: Configure git # required for golangci-lint on Windows
  run: git config --global core.autocrlf false