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

[Feat]: Rename golangcilint.yaml to .golangci.yaml #2538

Open
AndersBennedsgaard opened this issue Jul 12, 2024 · 0 comments
Open

[Feat]: Rename golangcilint.yaml to .golangci.yaml #2538

AndersBennedsgaard opened this issue Jul 12, 2024 · 0 comments
Labels
feature New feature or request rm-external Roadmap item submitted by non-maintainers

Comments

@AndersBennedsgaard
Copy link
Contributor

AndersBennedsgaard commented Jul 12, 2024

Is your feature request related to a problem? Please describe.

When editing files, it is annoying having to configure golangci-lint to look for specific configuration files. By renaming the golangcilint.yaml to .golangci.yaml (or another similarly sounding file name), the configuration is automatically picked up when running it, which makes it nicer for developers who have set golangci-lint up to run in their editors

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

Describe the solution you'd like

Rename golangcilint.yaml to .golangci.yaml, and move custom golangci-lint flags/configuration from

args: --config ./golangcilint.yaml --enable-all --build-tags debug,needprivileges,sync,scrub,search,userprefs,metrics,containers_image_openpgp,lint,mgmt,imagetrust ./cmd/... ./pkg/...

and

zot/Makefile

Lines 320 to 326 in e5eacaa

check: ./golangcilint.yaml $(GOLINTER)
mkdir -p pkg/extensions/build; touch pkg/extensions/build/.empty
$(GOLINTER) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags containers_image_openpgp ./...
$(GOLINTER) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags $(BUILD_LABELS),containers_image_openpgp ./...
$(GOLINTER) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags debug ./pkg/debug/swagger/ ./pkg/debug/gqlplayground
$(GOLINTER) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags dev ./pkg/test/inject/
$(GOLINTER) --config ./golangcilint.yaml run --enable-all --out-format=colored-line-number --build-tags stress ./pkg/cli/server/

to the configuration file. This will make it more streamlined for the developer to work locally, since he can expect the same results from running locally and in CI.

It might make sense to introduce the --fast flag in some way though, to speed up linting, but I am not sure if it would be needed

Describe alternatives you've considered

No response

Additional context

No response

@AndersBennedsgaard AndersBennedsgaard added the feature New feature or request label Jul 12, 2024
@rchincha rchincha added the rm-external Roadmap item submitted by non-maintainers label Jul 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request rm-external Roadmap item submitted by non-maintainers
Projects
None yet
Development

No branches or pull requests

2 participants