We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents e1fbc08 + ae8d4b0 commit da34344Copy full SHA for da34344
1 file changed
codecov_cli/services/upload/upload_collector.py
@@ -112,6 +112,12 @@ def _get_file_fixes(
112
113
try:
114
with open(filename, "r") as f:
115
+ # If lineno is unset that means that the
116
+ # file is empty thus the eof should be 0
117
+ # so lineno will be set to -1 here
118
+ lineno = -1
119
+ # overwrite lineno in this for loop
120
+ # if f is empty, lineno stays at -1
121
for lineno, line_content in enumerate(f):
122
if any(
123
pattern.match(line_content)
@@ -123,7 +129,6 @@ def _get_file_fixes(
129
for pattern in fix_patterns_to_apply.without_reason
124
130
):
125
131
fixed_lines_without_reason.add(lineno + 1)
126
-
127
132
if fix_patterns_to_apply.eof:
128
133
eof = lineno + 1
134
except UnicodeDecodeError as err:
0 commit comments