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

PpParser: fix whitespace bug in the parse_gnuplot2D method #534

Merged
merged 1 commit into from
Jun 26, 2020

Conversation

sphuber
Copy link
Contributor

@sphuber sphuber commented Jun 26, 2020

Fixes #531

The code was assuming that a line either contained valid data or was
completely empty, in which case it is skipped. However, sometimes the
code can produce empty lines with whitespace, such as spaces, which
would crash the code. Stripping the line before further processing
solves the problem.

Since this bug relies on whitespace in the test data file, it was not
being caught, because the pre-commit would strip trailing whitespace.
That is why we reintroduce the whitespace manually and add any files
with a file suffix that ends in out in the tests folder to the
exclude list so it is not automatically removed on commit.

The code was assuming that a line either contained valid data or was
completely empty, in which case it is skipped. However, sometimes the
code can produce empty lines with whitespace, such as spaces, which
would crash the code. Stripping the line before further processing
solves the problem.

Since this bug relies on whitespace in the test data file, it was not
being caught, because the pre-commit would strip trailing whitespace.
That is why we reintroduce the whitespace manually and add any files
with a file suffix that ends in `out` in the `tests` folder to the
exclude list so it is not automatically removed on commit.
@greschd greschd merged commit 4f75b6f into develop Jun 26, 2020
@greschd greschd deleted the fix/531/pp-parser-gnuplot-2d branch June 26, 2020 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

PP parser error
2 participants