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

Add flag to disable nested ignores #257

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jeremydelacruz
Copy link
Contributor

Please check if the PR fulfills these requirements

  • The commit message follows our guidelines
  • Tests for the changes have been added (for bug fixes / features)
  • Docs have been added / updated (for bug fixes / features) see docs/README.md

What kind of change does this PR introduce? (Bug fix, feature, docs update, ...)
Feature

What is the current behavior?
Nested ignores are currently enabled by default, which has the potential to cause performance issues in very large repositories (even when they have no nested ignores). See issue #239 for more on this.

What is the new behavior (if this is a feature change)?
As this is related to an already released feature, the safest bet is to add the following flag to opt-out: --disable-nested-ignores. This should match the original behavior of only checking for top-level ignore-files (i.e. nested ignore-files should no longer be considered when using this flag).

Does this PR introduce a breaking change? (What changes might users need to make due to this PR?)
No

Other information:
Another PR should follow this one, attempting to address the performance issues with nested ignores turned on.

Let me know your thoughts on this!

@jeremydelacruz
Copy link
Contributor Author

Running the ignore benchmark with nested ignores enabled vs. disabled (with an increased scale for emphasis) gave me the following comparison:
image

@codecov
Copy link

codecov bot commented Jan 4, 2023

Codecov Report

Merging #257 (495c36a) into main (b92e612) will decrease coverage by 0.31%.
The diff coverage is 78.57%.

@@            Coverage Diff             @@
##             main     #257      +/-   ##
==========================================
- Coverage   93.76%   93.45%   -0.32%     
==========================================
  Files          23       23              
  Lines         818      840      +22     
==========================================
+ Hits          767      785      +18     
- Misses         30       33       +3     
- Partials       21       22       +1     
Impacted Files Coverage Δ
pkg/ignore/ignore.go 84.37% <76.92%> (-1.68%) ⬇️
cmd/root.go 82.27% <100.00%> (+0.22%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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.

1 participant