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

Exclude directories via pattern #348

Open
Kresshy opened this issue Sep 19, 2023 · 4 comments
Open

Exclude directories via pattern #348

Kresshy opened this issue Sep 19, 2023 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@Kresshy
Copy link

Kresshy commented Sep 19, 2023

Is it possible to exclude directories from the linter via a pattern? Something like a glob: **/build which would match every build directory from the root to other sub directories.

lint:
  rules:
    all_default: true

  directories:
    exclude:
      - **/build
@yoheimuta
Copy link
Owner

yoheimuta commented Oct 1, 2023

@Kresshy Sorry for the late response. At the moment, this feature is not supported.
I acknowledge that this feature could be worthwhile.

@yoheimuta yoheimuta added enhancement New feature or request question Further information is requested labels Oct 1, 2023
@brentru
Copy link

brentru commented Dec 12, 2023

+1 for this feature, would be very useful to exclude linting on proto files imported from external repositories that we don't have/want control over.

@stevenschaerer
Copy link

@yoheimuta Thanks for this nice utility. I am interested in contributing this feature.

Do you prefer pattern matching via glob as suggested in this issue, or regex? In my opinion globs are nicer to work with, but the standard library implementation in filepath doesn't support the ** pattern which many users will expect to be supported. There are third-party libraries such as https://github.com/bmatcuk/doublestar that could be used instead.

For backwards-compatibility reasons I think we'd have to introduce a new field (exclude_pattern ?) for both directories and files.

@yoheimuta
Copy link
Owner

@stevenschaerer Thanks for the suggestion!
I can see the appeal of globs for some users, so adding support for them seems like a great idea.

I also like the idea of introducing a new field.

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

No branches or pull requests

4 participants