Skip to content

golangci-lint should ignore node_modules #18803

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
silverwind opened this issue Feb 18, 2022 · 8 comments
Closed

golangci-lint should ignore node_modules #18803

silverwind opened this issue Feb 18, 2022 · 8 comments

Comments

@silverwind
Copy link
Member

silverwind commented Feb 18, 2022

CI failure seen on https://drone.gitea.io/go-gitea/gitea/51286/1/6

It seems golangi-lint tries to access files in node_modules which is completely unnecessary and likely a reason for its long runtime. It might be possible to pass a list of files to it via golangci/golangci-lint#301 (comment), thought I'm not sure whether that usage actually works (golangci/golangci-lint#2568).

I recently added the skip-dirs option at

gitea/.golangci.yml

Lines 27 to 30 in 1ab88da

skip-dirs:
- node_modules
- public
- web_src
but it does not seem to help because not all of their "linters" seem to honour the option (golangci/golangci-lint#913).

@lunny
Copy link
Member

lunny commented Feb 18, 2022

So maybe we could run backend lint before frontend lint in CI to avoid that?

@silverwind
Copy link
Member Author

silverwind commented Feb 18, 2022

That sounds like a workaround that will only work on CI. It needs to work locally too. Also, generally we want to run frontend/backend targets in parallel so folder absence can not be guaranteed.

@stale
Copy link

stale bot commented Apr 19, 2022

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Apr 19, 2022
@lunny
Copy link
Member

lunny commented Apr 19, 2022

I think this has been resolved. If it's not, please feel free to reopen it.

@lunny lunny closed this as completed Apr 19, 2022
@lunny lunny reopened this Apr 19, 2022
@stale stale bot removed the issue/stale label Apr 19, 2022
@zeripath
Copy link
Contributor

Fixed by #18708

@silverwind
Copy link
Member Author

Not really fixed with that, skip-dirs only has effect on some linters, and those rare CI failures should still be able to happen currently.

@taagomag
Copy link

taagomag commented Feb 7, 2023

So is there any solution to skip node_modules? It seems that this issue is turning in circles since 2 years 😂

@silverwind
Copy link
Member Author

No, it needs to happen in golang first: golang/go#42965.

@go-gitea go-gitea locked and limited conversation to collaborators May 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants