Skip to content
This repository was archived by the owner on Jul 16, 2025. It is now read-only.

Commit 7b6ad1a

Browse files
committed
use as_posix in more places
1 parent d710977 commit 7b6ad1a

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

codecov_cli/services/upload/file_finder.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -197,8 +197,10 @@ def __init__(
197197
report_type: ReportType = ReportType.COVERAGE,
198198
):
199199
self.search_root = search_root or Path(os.getcwd())
200-
self.folders_to_ignore = list(folders_to_ignore) if folders_to_ignore else []
201-
self.explicitly_listed_files = explicitly_listed_files or None
200+
self.folders_to_ignore = (
201+
[f.as_posix() for f in folders_to_ignore] if folders_to_ignore else []
202+
)
203+
self.explicitly_listed_files = explicitly_listed_files or []
202204
self.disable_search = disable_search
203205
self.report_type: ReportType = report_type
204206

@@ -223,8 +225,7 @@ def find_files(self) -> List[UploadCollectionResultFile]:
223225
assert regex_patterns_to_include # this is never `None`
224226
files_paths = search_files(
225227
self.search_root,
226-
default_folders_to_ignore
227-
+ [str(folder) for folder in self.folders_to_ignore],
228+
default_folders_to_ignore + self.folders_to_ignore,
228229
filename_include_regex=regex_patterns_to_include,
229230
filename_exclude_regex=regex_patterns_to_exclude,
230231
)
@@ -252,7 +253,7 @@ def get_user_specified_files(self, regex_patterns_to_exclude: Pattern):
252253
for file in self.explicitly_listed_files:
253254
user_filenames_to_include.append(file.name)
254255
if regex_patterns_to_exclude.match(file.name):
255-
files_excluded_but_user_includes.append(str(file))
256+
files_excluded_but_user_includes.append(file.as_posix())
256257
if files_excluded_but_user_includes:
257258
logger.warning(
258259
"Some files being explicitly added are found in the list of excluded files for upload. We are still going to search for the explicitly added files.",
@@ -262,7 +263,7 @@ def get_user_specified_files(self, regex_patterns_to_exclude: Pattern):
262263
)
263264
regex_patterns_to_include = globs_to_regex(user_filenames_to_include)
264265
multipart_include_regex = globs_to_regex(
265-
[str(path.resolve()) for path in self.explicitly_listed_files]
266+
[path.resolve().as_posix() for path in self.explicitly_listed_files]
266267
)
267268
user_files_paths = list(
268269
search_files(

0 commit comments

Comments
 (0)