sourcery-ai / sourcery

Instant AI code reviews
https://sourcery.ai
MIT License
1.5k stars 65 forks source link

Suppress a particular rule in a particular folder #371

Open tylerlaprade opened 11 months ago

tylerlaprade commented 11 months ago

Checklist

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.

Hellebore commented 11 months ago

That's a nice use case