Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exclude directories from analysis #226

Closed
colindean opened this issue Mar 14, 2023 · 6 comments
Closed

Exclude directories from analysis #226

colindean opened this issue Mar 14, 2023 · 6 comments
Assignees
Labels
P2 major: an upcoming release type: feature request

Comments

@colindean
Copy link

Is your feature request related to a problem? Please describe.

When I tried to run fawltydeps for the first time, it caught some stuff in my project's dist and build directories. E.g., dist contains a requirements.txt generated from my Poetry config.

Describe the solution you'd like

These directories could be ignored entirely, likely by default but also by configuration.

Describe alternatives you've considered

I could run make clean to delete these directories before running fawltydeps, but that'd cost extra time later on my workstation. It'd also necessitate running fawltydeps in CI before anything is generated.

@jherland
Copy link
Member

Thanks for reporting!

I'm wondering if it would be "safe" to always ignore dist/ and build/ or if there cases where that would backfire. Maybe safer to take our ignore list from some other source, like .gitignore. Would that work in your case?

For now I added this issue to our roadmap (#195).

@colindean
Copy link
Author

I think it would be safe to use the .gitignore in this case. Thanks for considering this!

@jherland
Copy link
Member

Note to selves: When we get around to implementing a better mechanism for ignoring files, please take #326 (comment) into consideration; in particular: consider if there are cases where the search for code/deps/pyenv sources differ in what paths should be ignored.

For example: it might make sense for code and deps to ignore hidden (dot) dirs, while the pyenv search should descend into these dirs?

@md384
Copy link

md384 commented Jul 28, 2023

I second this issues and would like to configuration argument that would accept globs (or just simple paths) to ignore to allow a little more flexibility.

@dorranh
Copy link

dorranh commented Aug 23, 2023

+1 for this feature. I've encountered the same issue when running FawltyDeps in a project which had a quick, ad-hoc virtual environment created in the project directory for experimentation purposes.

@jherland
Copy link
Member

With the v0.15.0 release, we now support --exclude to ignore files and directories. For now, --exclude defaults to the .* pattern, meaning that "hidden" files/directories are excluded by default.

We don't (yet) exclude build/ and dist/ by default, so you'd have to specify --exclude build/ dist/ on the command-line (or exclude = ["build/", "dist/"] in the FawltyDeps section of your pyproject.toml)

I'm currently working on a --exclude-from option which will allow FawltyDeps to read exclude patterns from a file (like --exclude-from .gitignore), but with the basic --exclude option there I think we can close this issue. Feel free to reopen if I've overlooked something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 major: an upcoming release type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants