Instagram / Fixit

Advanced Python linting framework with auto-fixes and hierarchical configuration that makes it easy to write custom in-repo lint rules.
https://fixit.rtfd.io/en/latest/
Other
666 stars 62 forks source link

Support Glob Patterns in `[[tool.fixit.overrides]]` #408

Open max-muoto opened 9 months ago

max-muoto commented 9 months ago

It would be convenient to utilize glob patterns when specifying path for [[tool.fixit.overrides]]. For example, I might want to disable a rule for all of my tests:

[[tool.fixit.overrides]]
path = "**/tests/**/*.py"
disable = ["fixit.rules:MyRule"]
max-muoto commented 9 months ago

Happy to take a stab at this myself as well.

amyreese commented 9 months ago

I do think this would be useful and welcome. If you're interested, I think this could be as simple as adding a call to fnmatch() near https://github.com/Instagram/Fixit/blob/main/src/fixit/config.py#L407 as well as some extra tests to cover the functionality.