Skip to content
Open
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
9 changes: 7 additions & 2 deletions codecov_cli/services/upload/upload_collector.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,13 +109,14 @@ def _produce_file_fixes(
def _get_file_fixes(
self, filename: str, fix_patterns_to_apply: fix_patterns_to_apply
) -> UploadCollectionResultFileFixer:
path = pathlib.Path(filename)
absolute_path = self.network_finder.network_root_folder / filename
path = pathlib.Path(absolute_path)
fixed_lines_without_reason = set()
fixed_lines_with_reason = set()
eof = None

try:
with open(filename, "r", encoding="utf-8") as f:
with open(absolute_path, "r", encoding="utf-8") as f:
# If lineno is unset that means that the
# file is empty thus the eof should be 0
# so lineno will be set to -1 here
Expand Down Expand Up @@ -143,6 +144,10 @@ def _get_file_fixes(
reason=err.reason,
),
)
except FileNotFoundError:
logger.warning(
f"File not found: {absolute_path}, file fixes were not applied to this file."
)
except IsADirectoryError:
logger.info(f"Skipping {filename}, found a directory not a file")

Expand Down
Loading