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: improve 'no go files to analyze' message #4536

Merged
merged 1 commit into from Mar 19, 2024

Conversation

ldez
Copy link
Member

@ldez ldez commented Mar 19, 2024

90% of the contexts that lead to no go files to analyze error are related to missing go mod tidy.

A sample of issues on the topic:

Before:

$ golangci-lint run ./...                           
ERRO Running error: context loading failed: no go files to analyze 

After:

$ ./golangci-lint run ./...                                                     
ERRO Running error: context loading failed: no go files to analyze: running `go mod tidy` may solve the problem 

Fixes #3335
Fixes #825

@ldez ldez added the enhancement New feature or improvement label Mar 19, 2024
@ldez ldez added this to the next milestone Mar 19, 2024
@ldez ldez merged commit cba35e1 into golangci:master Mar 19, 2024
13 checks passed
@ldez ldez deleted the feat/no-go-files branch March 19, 2024 13:25
@nyetwurk
Copy link

nyetwurk commented Mar 19, 2024

This isn't terribly useful, it would be good to have more information about what is going on in that dedupilication step.

See #825 (comment)

@ldez
Copy link
Member Author

ldez commented Mar 19, 2024

As I said in the description: it's useful in 90% of the cases, then it's not perfect.

If you want more information about the deduplication step, you just have to run the following command:

GL_DEBUG=loader golangci-lint run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

no go files to analyze context loading failed: no go files to analyze
4 participants