sourcery icon indicating copy to clipboard operation
sourcery copied to clipboard

Suppress a particular rule in a particular folder

Open tylerlaprade opened this issue 2 years ago • 1 comments

Checklist

  • [x] This is a new feature, not a refactoring suggestion
  • [x] I have checked for this feature in the Sourcery documentation
  • [x] 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.

tylerlaprade avatar Jul 22 '23 23:07 tylerlaprade

That's a nice use case

Hellebore avatar Jul 25 '23 15:07 Hellebore