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

extract: fix false warning about pattern never matching, fixes #4110 #7694

Merged
merged 1 commit into from
Jul 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/borg/patterns.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,11 @@ def add_includepaths(self, include_paths):
self.include_patterns = include_patterns

def get_unmatched_include_patterns(self):
"Note that this only returns patterns added via *add_includepaths*."
return [p for p in self.include_patterns if p.match_count == 0]
"""Note that this only returns patterns added via *add_includepaths* and it
won't return PathFullPattern patterns as we do not match_count for them.
"""
return [p for p in self.include_patterns
if p.match_count == 0 and not isinstance(p, PathFullPattern)]

def add_inclexcl(self, patterns):
"""Add list of patterns (of type CmdTuple) to internal list.
Expand Down