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

Add golanglint-ci for static checking #13

Merged
merged 7 commits into from
Oct 1, 2024

Conversation

ranyodh
Copy link
Collaborator

@ranyodh ranyodh commented Sep 30, 2024

The PR adds CI (and local make targets) for static checks using golangling-ci.

Removed check-generate-code CI job as it is not really required and takes a long time to run.

@ranyodh ranyodh requested review from nwneisen and a team October 1, 2024 14:10
@nwneisen
Copy link

nwneisen commented Oct 1, 2024

@ranyodh Can you also change the linter in all the other repos to this one?

@nwneisen
Copy link

nwneisen commented Oct 1, 2024

There is also an issue opened by someone who wanted doc headers enforced in CI. We should look for a linter to do that

@ranyodh
Copy link
Collaborator Author

ranyodh commented Oct 1, 2024

@ranyodh Can you also change the linter in all the other repos to this one?

Created this ticket for it: https://mirantis.jira.com/browse/BOP-1272

@ranyodh
Copy link
Collaborator Author

ranyodh commented Oct 1, 2024

There is also an issue opened by someone who wanted doc headers enforced in CI. We should look for a linter to do that

There is a linter in golangci-lint revive (which is a drop in replacement or golint) that has a rule to check for it. I find it peculiar that they decide to exclude that rule by default (even after you enable the linter and configure it for doc checking).

Anyways, after enabling the linter and including the check, I get:

internal/tls/tls.go:61:18: Error return value of `file.Close` is not checked (errcheck)
        defer file.Close()
                        ^
internal/middlewares/middlewares.go:10:1: exported: exported function GetMiddlewares should have comment or be unexported (revive)
func GetMiddlewares() []runtime.Middleware {
^
exit status 1
make: *** [lint] Error 1

It also prints error with Close() function which could be annoying. Will look into a bit more later.

@ranyodh ranyodh merged commit 0ed85e4 into MirantisContainers:main Oct 1, 2024
5 checks passed
@ranyodh ranyodh deleted the lint branch October 1, 2024 15:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants