patterns: clean up TODOs, move is_include_cmd to IECommand property, fixes #9442#9542
Open
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
Open
patterns: clean up TODOs, move is_include_cmd to IECommand property, fixes #9442#9542mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
mr-raj12 wants to merge 1 commit intoborgbackup:masterfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #9542 +/- ##
==========================================
+ Coverage 83.39% 83.41% +0.01%
==========================================
Files 87 87
Lines 15469 15479 +10
Branches 2321 2324 +3
==========================================
+ Hits 12901 12912 +11
+ Misses 1818 1817 -1
Partials 750 750 ☔ View full report in Codecov by Sentry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Address the TODO items in
src/borg/patterns.pyas discussed in #9442:recurse_dir_default: Replaced the misleading TODO with a comment explaining why it must stayTrueas include patterns inside excluded directories (+inside-) depend on it.is_include_cmd: Moved from a dict onPatternMatcherto anis_includeproperty onIECommandand now the matcher callscmd.is_includeinstead of doing a dict lookup.RootPathvalidation: Added a warning when the root path doesn't start with/, so backups don't fail due to a typo.command_recurses_dir: Replacedcmd not in [IECommand.ExcludeNoRecurse]with explicitif/raisebranches usingiscomparisons. Now raisesValueErrorfor unexpected commands likeRootPathorPatternStyle.Tests updated to use real
IECommandvalues and cover the new code paths.Checklist
master