Skip to content

A005 line number zero is incompatible with SonarQube #129

@tremblaysimon

Description

@tremblaysimon

When there is a A005 the format in flake8 report is something like

src/path/email.py:0: [A005] the module is shadowing a Python builtin module "email"

SonarQube sonar-python plugin doesn't like it and throws an error like that one:

ERROR No issues information will be saved as the report file '/path/to/flake8-report.txt' can't be read. IllegalArgumentException: 0 is not a valid line for a file

The problem here is that no information from flake8 report is imported in SonarQube because there was an error to read properly the report.

I understand why you made that decision for line number 0 since the A005 rule doesn't fit to a precise line of code because it's related to the file name not a line of code. But in the end flake8 report must have a line number and I agree with the SonarQube that error that 0 is not a valid line number.

Do you think it would make sense to default to line number 1 instead of 0 for that case?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions