Skip to content
This repository has been archived by the owner on May 2, 2024. It is now read-only.

#7 : sonar-scanner import error when empty line #8

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Turiok
Copy link

@Turiok Turiok commented Oct 17, 2022

Here the proposal solution.

Tell me if you want more details

Copy link
Contributor

@teake teake left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the contribution! However, I'm afraid this needs some changes. Specifically, I would prefer it if end_column is omitted when the text range is zero -- see the other comment for details.

}
},
"severity": self.sonar_checker.severity(msg),
"effortMinutes": self.sonar_checker.effort(msg)
}
if hasattr(msg, "column") and msg.column > 0:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to check for the column attribute, it's always there -- those other checks (for e.g. end_line) were for compatibility with older pylint versions.

Besides, there's still a chance for a SonarQube error when column is bigger than 0 but has the same value as end_column. Hence it would be better to omit end_column (which is optional in PyLint, whereas column is not) if end_column and end_line are the same as column and line, respectively.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants