Skip to content

Run golangci-lint in the gate#17

Merged
umago merged 2 commits into
openstack-lightspeed:mainfrom
umago:linters
Nov 5, 2025
Merged

Run golangci-lint in the gate#17
umago merged 2 commits into
openstack-lightspeed:mainfrom
umago:linters

Conversation

@umago
Copy link
Copy Markdown
Contributor

@umago umago commented Oct 31, 2025

The golangci-lint is a meta-linter built for CI use-case.

This patch also:

  • Migrates the .golangci.yml configuration to version 2
  • Updates the Makefile to be able to install the version 2.X of golangci-lint
  • Fix the current errors in the code

@lpiwowar
Copy link
Copy Markdown
Contributor

lpiwowar commented Nov 3, 2025

@umago: One thing crossed my mind. Are these changes going to be compatible with the linters configs that are used in the openstack-k8s-operators namespace? I've noticed that there is for example this linter (looks like some sort of custom linter) set up in the openstack operator repositories:

I'm not even sure whether we want that. But I guess if we later move to that namespace we should adhere to their linter rules (?). But I guess not a big deal now. It just crossed my mind.

@umago
Copy link
Copy Markdown
Contributor Author

umago commented Nov 3, 2025

@lpiwowar I can try to run this linter and see if it works but, as you said, just looking at the project it doesn't seem well maintained. Last commit was on Feb 20, 2024.

If we need to merge again into their namespace, I think we can adapt when we do it ? Since we don't even know if we are going to do it anytime soon, I would rather use something more mainstream and well maintained. What you think ?

@lpiwowar
Copy link
Copy Markdown
Contributor

lpiwowar commented Nov 3, 2025

It is all good. It just crossed my mind. For now this is definitelly more than enough 👍 . It is strange because I think the unmaintained tool still runs as part of their CI (in the pre-commit job).

@umago umago force-pushed the linters branch 2 times, most recently from f082db4 to 2b88b0a Compare November 3, 2025 14:47
Copy link
Copy Markdown
Contributor

@lpiwowar lpiwowar left a comment

Choose a reason for hiding this comment

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

LGTM 👍

It looked good to me at the beginning but I let Claude to take a look and it suggested the two things I'm mentioning in the comments. I think the comment about the actions/checkout version is a good one.

Comment thread .github/workflows/pre-commit.yaml Outdated
Comment thread .pre-commit-config.yaml
Comment thread .github/workflows/pre-commit.yaml Outdated
umago added 2 commits November 3, 2025 15:03
Adds golangci-lint to the gate and pre-commit hooks.

The golangci-lint is a meta-linter built for CI use-case.

This patch also:
* Migrates the .golangci.yml configuration to version 2
* Updates the Makefile to be able to install the version 2.X of
  golangci-lint
* Fix the current errors in the code

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
Update the README file on running pre-commit hooks prior to submitting a
PR to the project.

Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
@umago
Copy link
Copy Markdown
Contributor Author

umago commented Nov 5, 2025

Thanks for the review and ideas!

@umago umago merged commit 91e94d1 into openstack-lightspeed:main Nov 5, 2025
1 check passed
@umago umago deleted the linters branch November 5, 2025 10:11
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