Skip to content

Commit 7e8f629

Browse files
committed
Merge PR #142 into 18.0
Signed-off-by pedrobaeza
2 parents 7e4fe5b + a399e0d commit 7e8f629

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

‎github_connector/models/github_analysis_rule.py‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@ class GithubAnalysisRule(models.Model):
2424
)
2525

2626
def _set_spec(self, lines):
27-
return pathspec.PathSpec.from_lines("gitwildmatch", lines)
27+
return pathspec.PathSpec.from_lines("gitignore", lines)
2828

2929
def _get_matches(self, path):
3030
"""
3131
Get all matches from rule paths (multiple per line allow in rule)
3232
in a local path
3333
"""
34-
return self._set_spec(self.paths.splitlines()).match_tree(path)
34+
patterns = self.paths.splitlines()
35+
patterns = [p.strip() for p in patterns if p.strip()] # Clean empty lines
36+
return self._set_spec(patterns).match_tree_files(path)

‎github_connector_odoo/models/github_analysis_rule.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def _get_matches(self, path):
2020
if self.has_odoo_addons:
2121
spec = self._set_spec(["*"])
2222
file_paths = []
23-
for path_item in spec.match_tree(path):
23+
for path_item in spec.match_tree_files(path):
2424
file_paths.append(f"{path}/{path_item}")
2525
spec = self._set_spec(self.paths.splitlines())
2626
return spec.match_files(file_paths)

0 commit comments

Comments
 (0)