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

Excluding paths does not work properly #13

Open
marc1n opened this issue Apr 3, 2023 · 0 comments
Open

Excluding paths does not work properly #13

marc1n opened this issue Apr 3, 2023 · 0 comments

Comments

@marc1n
Copy link

marc1n commented Apr 3, 2023

Intellij IDEA Plugin version: 1.1.0, Sourcery version: 1.1.0

I noticed that the 'require-return-annotation' rule is applied to files test_*.py but should not be.

I noticed that when I put this rule in the sourcery.yaml file and add the include field with *.py then it works! (the rule is not applied to test_*.py files). Without include the rule is incorrecly applied to test_*.py files.

This works:

rules:
- id: require-return-annotation
  pattern: |
    def ${name}(...) -> !!!:
        ...
  condition: not name.starts_with("_")
  paths:
    include:
      - '*.py'
    exclude:
      - 'test_*.py'
      - '*_test.py'

This does not work:

rules:
- id: require-return-annotation
  pattern: |
    def ${name}(...) -> !!!:
        ...
  condition: not name.starts_with("_")
  paths:
    exclude:
      - 'test_*.py'
      - '*_test.py'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant