Fixit icon indicating copy to clipboard operation
Fixit copied to clipboard

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

Open max-muoto opened this issue 2 years ago • 2 comments

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 avatar Nov 15 '23 18:11 max-muoto

Happy to take a stab at this myself as well.

max-muoto avatar Nov 15 '23 18:11 max-muoto

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.

amyreese avatar Nov 15 '23 23:11 amyreese