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

Circumvent negative max_width in Travis log parser #731

Merged
merged 1 commit into from May 23, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions extras/parse_travis_log.py
Expand Up @@ -830,6 +830,14 @@ def printable_summary(list_of_changed_files,
table = AsciiTable(summary_table)
table.inner_row_border = True
max_width = table.column_max_width(1)

# Bypass Travis issue: ValueError: invalid width -29 (must be > 0)
# (in the wrap() below max_width must be > 0)
# The calculation of column_max_width is based on the returned terminal
# width which sometimes seems to be zero resulting in a negative value.
if max_width < 0:
max_width = 70

table.table_data[1][1] = '\n'.join(wrap(', '.join(list_of_changed_files),
max_width))

Expand Down