Skip to content

Suppress a particular rule in a particular folder #371

Open
@tylerlaprade

Description

@tylerlaprade

Checklist

  • This is a new feature, not a refactoring suggestion
  • I have checked for this feature in the Sourcery documentation
  • I have checked there are no open requests referencing the same feature

Description

I would like to suppress a given rule only in a certain folder or subset of files. For example, I'd like to suppress refactoring:class-extract-method in my tests/ folder because it's important that each test clearly specify what behavior is under test without requiring the reader to understand context from elsewhere in the file. However, I want to continue running that check in the rest of code.

Similar functionality can be found in Ruff's per-file-ignores and ESLint's overrides.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions