Skip to content

golangci-lint is slow for projects with many files. #4217

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

Closed
sbadame opened this issue Nov 21, 2023 · 2 comments
Closed

golangci-lint is slow for projects with many files. #4217

sbadame opened this issue Nov 21, 2023 · 2 comments
Labels
question Further information is requested

Comments

@sbadame
Copy link

sbadame commented Nov 21, 2023

Your feature request related to a problem? Please describe.

I'm working on a project that includes vendored dependencies. This alone appears to be taking ~5 minutes.

I was hoping that configuration like skip-dirs or "issues: new" would help reduce the search space, but instead it looks like it only affects which findings are reported. I was also hoping for a way to say: "only lint these files or directories", but that also doesn't appear to be a feature.

Thank you!

Describe the solution you'd like.

Is there a way to either:

  1. Get more profiling information from golanglint-ci? Using -v doesn't give me any output beyond the initial loading of configuration.
  2. Configure golanglint-ci to only run on a sub directory?
  3. Configure golanglint-ci to ignore any files that were not changed between git revisions?

Describe alternatives you've considered.

It seems that regardless of my configuration for golangci-lint it will always at the very least try to "stat" every file in my directory (by checking with strace).

Additional context.

No response

@sbadame sbadame added the enhancement New feature or improvement label Nov 21, 2023
Copy link

boring-cyborg bot commented Nov 21, 2023

Hey, thank you for opening your first Issue ! 🙂 If you would like to contribute we have a guide for contributors.

@ldez ldez changed the title golanglint-ci is slow for projects with many files. golangci-lint is slow for projects with many files. Nov 21, 2023
@ldez ldez added question Further information is requested and removed enhancement New feature or improvement labels Nov 21, 2023
@ldez
Copy link
Member

ldez commented Nov 21, 2023

  1. https://golangci-lint.run/contributing/debug/
  2. golangci-lint acts as a Go compiler, so partial analyze are globally not possible
  3. the option new-from-rev https://golangci-lint.run/usage/configuration/#issues-configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants