Skip to content

Excluding paths does not work properly #13

Description

@marc1n

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions