Skip to content

Commit

Permalink
Use pathlib to detect absolute patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
EnricoMi committed Oct 12, 2023
1 parent e89c66e commit 23943d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion python/publish_test_results.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import re
import sys
from glob import glob
from pathlib import Path
from typing import List, Optional, Union, Mapping, Tuple, Any, Iterable, Callable

import github
Expand Down Expand Up @@ -65,7 +66,7 @@ def get_files(multiline_files_globs: str) -> Tuple[List[str], bool]:
for files_glob in multiline_files_globs
if files_glob.startswith('!')
for file in glob(files_glob[1:], recursive=True)}
has_absolute = any({pattern.startswith('/') or pattern.startswith('\\')
has_absolute = any({Path(pattern).is_absolute()
for files_glob in multiline_files_globs
for pattern in [files_glob[1:] if files_glob.startswith('!') else files_glob]})
return list(included - excluded), has_absolute
Expand Down

0 comments on commit 23943d3

Please sign in to comment.