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

Automatically ignore files specified in .gitignore #1234

Merged
merged 2 commits into from
Dec 14, 2022
Merged

Conversation

charliermarsh
Copy link
Member

This is somewhat inefficient as I have to do two filesystem passes right now -- need to find a way to fix that...

Resolves #174.
Resolves #777.

.into_iter()
.filter_entry(|entry| {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I want to use WalkBuilder, which should be pretty much a drop-in replacement for WalkDir (and let's me use the same filter_entry), but it's requiring that the lifetime of any variable in the closure if 'static? So I can't iteratively build up the shared resolver like I am now.

Copy link
Member Author

@charliermarsh charliermarsh Dec 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current code could be slow if you had a very large directory that wasn't marked as .gitignore but was excluded by Ruff. E.g., if you had a monorepo with a bunch of directories that contained JS files, we'd spend time traversing all of those.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Missing skip_gitignore for isort configuration Consider auto-excluding files matched by gitignore files
1 participant