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
669 stars 63 forks source link

Fix validate config #481

Closed surge119 closed 2 months ago

surge119 commented 2 months ago

Summary

The initial implementation would fail for overrides, since the path provided into parse_rule is the override path, instead of the path to the config file, which is expected.

Test Plan

Included

surge119 commented 2 months ago

Also, is there ever a case where root here wouldn't always be path.parent? Can we avoid the extra argument to validate_config and validate_rules, and just set root = path.parent at the top of the function?

Only because of testing. Since the tests use a temporary directory, using parent for them would cause them to fail. But I suppose the tests can create new rules to reference