Skip to content

Commit 29febe6

Browse files
committed
Fix lineno being unset
If lineno is unset that means that the file is empty thus the eof should be 0, so lineno will be -1. Signed-off-by: joseph-sentry <joseph.sawaya@sentry.io>
1 parent e1fbc08 commit 29febe6

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

codecov_cli/services/upload/upload_collector.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ def _get_file_fixes(
112112

113113
try:
114114
with open(filename, "r") as f:
115+
lineno = -1
115116
for lineno, line_content in enumerate(f):
116117
if any(
117118
pattern.match(line_content)
@@ -123,7 +124,6 @@ def _get_file_fixes(
123124
for pattern in fix_patterns_to_apply.without_reason
124125
):
125126
fixed_lines_without_reason.add(lineno + 1)
126-
127127
if fix_patterns_to_apply.eof:
128128
eof = lineno + 1
129129
except UnicodeDecodeError as err:

0 commit comments

Comments
 (0)