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
672 stars 65 forks source link

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

Open max-muoto opened 1 year ago

max-muoto commented 1 year 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 1 year ago

Happy to take a stab at this myself as well.

amyreese commented 1 year 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.