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

feat: add skip-regex option to cruft update #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

sacha-c
Copy link

@sacha-c sacha-c commented May 22, 2023

Description

Adds a new skip-regex configuration option which works similar to skip (files) in that it will ignore entire lines of diffs that match the supplied regex.

Comments

I thought of making skip-regex a list of regexes (like skip), but instead kept it as a single regex entry.
I was thinking that this option would probably not be used often so a single entry should be sufficient, and any list functionality can also be done using regex itself.
However if you think a list would be better suited I am happy to make that change

Closes #250

@sacha-c sacha-c force-pushed the issue/250 branch 3 times, most recently from ab86f30 to 35a27d0 Compare June 12, 2023 07:17
@codecov
Copy link

codecov bot commented Jun 12, 2023

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (1a5614f) 99.71% compared to head (f7104e4) 99.72%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #251   +/-   ##
=======================================
  Coverage   99.71%   99.72%           
=======================================
  Files          21       21           
  Lines        1050     1081   +31     
=======================================
+ Hits         1047     1078   +31     
  Misses          3        3           
Impacted Files Coverage Δ
cruft/_commands/update.py 98.50% <100.00%> (+0.01%) ⬆️
cruft/_commands/utils/diff.py 100.00% <100.00%> (ø)
cruft/exceptions.py 100.00% <100.00%> (ø)
tests/test_utils.py 100.00% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@RobertDeRose
Copy link

I would like this feature, but I think a list would be a better option. A few less complicated regexes might be much better than just one complicated one when you need a list.

I would also be nice if the regex could work for files, though, I think the name needs to be different.

I would also say the option name for this feature should be something like skip-diff-regex to make it clear this will skip files based on content, not the files.

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.

Feature Request: Add new configuration parameter --skip-regex
3 participants