Skip to content

fix sonar-scanner import error when empty line #3

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

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="pylint-sonarjson",
version="2.0.0",
version="2.0.1",
author="Teake Nutma, Topin2001",
description="A PyLint plugin that can output to SonarQube-importable JSON",
long_description=long_description,
Expand Down
5 changes: 3 additions & 2 deletions src/pylint_sonarjson/sonarjson_reporter.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,14 @@ def _msg_to_sonar_dict(self, msg: Message):
"message": msg.msg or "",
"filePath": msg.path,
"textRange": {
"startLine": msg.line,
"startColumn": msg.column,
"startLine": msg.line
}
},
"severity": self.sonar_checker.severity(msg),
"effortMinutes": self.sonar_checker.effort(msg)
}
if hasattr(msg, "column") and msg.column > 0:
sonar_dict["primaryLocation"]["textRange"]["startColumn"] = msg.column
if hasattr(msg, "end_line") and msg.end_line:
sonar_dict["primaryLocation"]["textRange"]["endLine"] = msg.end_line
if hasattr(msg, "end_column") and msg.end_column:
Expand Down