Skip to content

golangci-lint should ignore node_modules #18803

@silverwind

Description

@silverwind
Member

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).

Activity

lunny

lunny commented on Feb 18, 2022

@lunny
Member

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

silverwind

silverwind commented on Feb 18, 2022

@silverwind
MemberAuthor

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

stale commented on Apr 19, 2022

@stale

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.

lunny

lunny commented on Apr 19, 2022

@lunny
Member

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

reopened this on Apr 19, 2022
zeripath

zeripath commented on Apr 19, 2022

@zeripath
Contributor

Fixed by #18708

silverwind

silverwind commented on Apr 20, 2022

@silverwind
MemberAuthor

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.

3 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @lunny@silverwind@zeripath@taagomag

        Issue actions

          golangci-lint should ignore node_modules · Issue #18803 · go-gitea/gitea