Boeing / config-file-validator

Cross Platform tool to validate configuration files
https://boeing.github.io/config-file-validator/
Apache License 2.0
324 stars 55 forks source link

chore: enable golangci-lint on repository #138

Closed ccoVeille closed 5 months ago

ccoVeille commented 5 months ago

I followed https://github.com/golangci/golangci-lint-action

Fixes #137

ccoVeille commented 5 months ago

The tests will fail until #132 will be merged.

This way, it will give you an idea of the errors it might report.

ccoVeille commented 5 months ago

pushed back after a rebase, all tests should pass, let see

ccoVeille commented 5 months ago

I suggest to merge it before any other PR, so the tests would be run on new PR, ensuring I hope maintaining code quality.

Do not hesitate to ping me for help on any PR where you or contributor will face golangci-lint issues.

But golangci-lint guidelines and documentation is great.

https://golangci-lint.run/

Please note that you only have to install golangci-lint 1.57.2 or newer locally and run the following command to replicate locally the GitHub action I installed

golangci-lint run ./...
ccoVeille commented 5 months ago

Is everything alright with this PR?

I mean tell me if you need something from me.

kehoecj commented 5 months ago

Big thanks @ccoVeille for adding golangci-lint functionality to the pipeline!

ccoVeille commented 5 months ago

You won't thank me when it will report errors on every PR 😅

Anyway, golangci-lint was a great discovery for me. It helped me to find many bugs in my code. They keep adding linters.

I recommend you to read golangci-lint website and especially the false positive section.

kehoecj commented 5 months ago

@ccoVeille Any idea why the linter on windows is failing? https://github.com/Boeing/config-file-validator/actions/runs/8709768011/job/23890548496

nickajacks1 commented 5 months ago

@kehoecj I couldn't reproduce the problem on my windows PC but this error is sometimes fixed by doing go mod tidy

ccoVeille commented 5 months ago

@ccoVeille Any idea why the linter on windows is failing? https://github.com/Boeing/config-file-validator/actions/runs/8709768011/job/23890548496

The message is about timeout parameter

It can be increased in .golangci.yaml

https://golangci-lint.run/usage/configuration/#run-configuration

The default value (1min) might be too short for windows docker instance, try 5m