Skip to content
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

Support SonarQube issue format #2350

Closed
2 tasks done
junkpiano opened this issue Aug 9, 2018 · 2 comments
Closed
2 tasks done

Support SonarQube issue format #2350

junkpiano opened this issue Aug 9, 2018 · 2 comments
Labels
enhancement Ideas for improvements of existing features and rules.

Comments

@junkpiano
Copy link

junkpiano commented Aug 9, 2018

New Issue Checklist

Proposal

This is a new feature proposal.

Looking at #175 , SwiftLint was integrated by SonarQube plugin.
Now SonarQube 7.2 provides the way to import issues from the 3rd party analyzers.

So I added another reporter for SonarQube.
I conducted tests on my personal applications, and found my patch works fine and sents collect data.

It looks like this.

imageedit_2_9847954649

The difference is that the issue has SwiftLint tag besides the issue description.
We can continuously check our code violations on SonarQube.

On the other hand, there is a limitation. We cannot use character in the JSON we send.
I took a look at SonarQube code, where I got a java exception error.

https://github.com/SonarSource/sonarqube/blob/4bccde70aab57079a0c7b6055528f776fac315fe/sonar-scanner-engine/src/main/java/org/sonar/scanner/externalissue/ExternalIssueImporter.java#L120

If startColumn(= character in SwiftLint) is specified, it throws null pointer exception, since SwiftLint StyleViolation doesn't have endColumn, and endLine. So I skipped startColumn intentionally to avoid the exception.

That said, it's appreciated if you consider adding this feature to SwiftLint.

My code is junkpiano@eaff52c.
If you are OK with it, I can send PR.

@realm-probot realm-probot bot added the O:User label Aug 9, 2018
@marcelofabri marcelofabri added the enhancement Ideas for improvements of existing features and rules. label Aug 9, 2018
@marcelofabri
Copy link
Collaborator

A PR would be welcome!

@marcelofabri
Copy link
Collaborator

Implemented on #2352.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Ideas for improvements of existing features and rules.
Projects
None yet
Development

No branches or pull requests

2 participants