17:02:21.307 INFO: Sensor Import of Flake8 issues [python]
17:02:21.334 ERROR: No issues information will be saved as the report file '/github/workspace/flake8.txt' can't be read. IllegalArgumentException: -1 is not a valid line offset for a file
And the flake8 info is not coming through to SonarCloud
Are you able to help with what the error means and how to fix it? Many thanks
This would typically imply that some issue in the report is being reported as raised on a the -1st “something” of a file/line (a line number or column). Of course… that doesn’t make much sense. Anything look like this in your report file?
For anyone else having similar problems, in my case the problem lines in flake8.txt were of the form:
./path/to/file.py:21:0: F523 ‘…’.format(…) has unused arguments at position(s): 0
and the problem is the column/character number of 0 in ./path/to/file.py:21:0...
This column number of 0 comes from pyflakes, and results originally from a bug in cpython on Python 3.7, in how it handles column numbers for triple-quoted strings over multiple lines.
Solution for me is to exclude F523 from flake8 - in the longer term, upgrading to Python 3.8 would resolve the issue.