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

fix: Enhace black efficiently to skip directories listed in .gitignore #4415

Merged
merged 5 commits into from
Aug 2, 2024

Conversation

Mr-Sunglasses
Copy link
Contributor

@Mr-Sunglasses Mr-Sunglasses commented Jul 25, 2024

Description

fix: #4405 Enhace black efficiently to skip directories listed in .gitignore

Checklist - did you ...

  • Add an entry in CHANGES.md if necessary?
  • Add / update tests if necessary?
  • Add new / update outdated documentation?

Copy link

github-actions bot commented Jul 25, 2024

diff-shades reports zero changes comparing this PR (98264b7) to main (4b4ae43).


What is this? | Workflow run | diff-shades documentation

@Mr-Sunglasses
Copy link
Contributor Author

@JelleZijlstra I've added the test for this and now black is almost 2x faster when it have to ignore directories from .gitignore

A benchmark I've tested, with node_modules as ignored.

Screenshot 2024-07-27 at 4 13 07 AM

@Mr-Sunglasses
Copy link
Contributor Author

Should we add a changelog entry as it's a simple but significant change?

Copy link
Collaborator

@JelleZijlstra JelleZijlstra left a comment

Choose a reason for hiding this comment

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

Thank you! I pushed a news entry.

@JelleZijlstra JelleZijlstra merged commit 14b6e61 into psf:main Aug 2, 2024
38 checks passed
@hauntsaninja
Copy link
Collaborator

Note this probably hurts perf in the normal case due to adding a bunch of new stats
This is more correct, but could be nice to rework things to use os.scandir and away from pathlib.Path

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.

black could more efficiently skip directories listed in .gitignore
3 participants