Skip to content

Handle SyntaxErrors in a slightly smarter way

username-removed-6325 requested to merge sigmavirus24/flake8:bug/259 into master

SyntaxErrors are strange and mystical beasts. On top of the problems we encountered previously in GitLab#237, it's now apparent that SyntaxErrors can also occur across multiple lines (in fact, across the rest of a file). In the event of a "multi-line" SyntaxError, we need to determine what row to report and what the column number is.

For now, we're going to use the row number of the first line and limit the column number to be less than the end of the line. It may not be perfect, but it is slightly better.

Related-to #237 (closed)
Closes #259 (closed)

cc @arcanemagus

Merge request reports