Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix line length linter #1154

Merged
Merged
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
7 changes: 5 additions & 2 deletions tests/lint/line_length.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def main():

for arg in sys.argv[1:]:
with open(arg, "r") as source_file:
for i, line in enumerate(source_file):
for i, line in enumerate(source_file, start=1):
line = line.rstrip()
# Lines that end with a string are exempted
if endswithstring(line):
Expand All @@ -63,7 +63,10 @@ def main():
line = line.replace("\t", " ")
# Lines longer than MAX are reported as an error
if len(line) > MAX:
print(f"{arg}: {i}: line too long ({len(line)} characters)")
print(
f"{arg}: {i}: line too long ({len(line)} characters)",
file=sys.stderr,
)
exit_status = 1

sys.exit(exit_status)
Expand Down