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
668 stars 61 forks source link

Add options to ignore directories #426

Open eugenenelou opened 7 months ago

eugenenelou commented 7 months ago

Currently all directories are walked through, except the ones ignored by .gitignore

it would be nice to be able to ignore the walkthrough of some directories, maybe because they are big and do not contain python code.

or in my case if they crash the walkthrough. I'm using pdm and the .venv/ at the root of my project contains symlink to python versions outside of the project and it raises an error:

ValueError: '/home/eugene/.pyenv/versions/3.10.5/bin/python3.10' is not in the subpath of '/home/eugene/my_projects' OR one path is relative and the other is absolute. 

for now I'm resorting to:

fixit fix -a $(ls -A -I.venv)
amyreese commented 7 months ago

We can get this more or less “for free” through trailrunner. Just need to add a config option to fixit and pass that value along to trailrunner when walking paths. Shouldn’t be much work if someone is interested in a PR.