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

[Swift] Error when importing swiftlint report #5502

Open
cah-iswaria-sasi opened this issue Mar 20, 2024 · 5 comments
Open

[Swift] Error when importing swiftlint report #5502

cah-iswaria-sasi opened this issue Mar 20, 2024 · 5 comments
Labels

Comments

@cah-iswaria-sasi
Copy link

This is for iOS swift project for code smell while using swiftlint ,
swiftlint(path: “.”, output_file: “sonar-reports/swiftlint.txt”, ignore_exit_status: true),
we are seeing results published in sonarqube
but if we give below output as .json, no datas are displaying.
swiftlint(path: “.”, output_file: “sonar-reports/swiftlint.json”, reporter: “sonarqube”, ignore_exit_status: true)
(i referred from swiftlint and sonarqube documentation and created this command)

why this isnt working with .json as per documentation?

@SimplyDanny
Copy link
Collaborator

I don't get it. Where do you want to import what from where?

@cah-iswaria-sasi
Copy link
Author

swiftlint says swiftlint format for sonarqube should be .json but installed backelite swift plugin, it says swiftlint format is .txt...

however .json isnt working or parsing in sonarqube but swiftlint.txt parses and prints result..

@SimplyDanny
Copy link
Collaborator

SimplyDanny commented Mar 24, 2024

Sonar itself offers a Swift plugin that can import SwiftLint reports in JSON format. That's what the sonarqube reporter generates.

The Backelite plugin seems to parse the default SwiftLint output (that is the output of the xcode reporter). That's what I conclude from the regex used in their parser. So if you use this third-party plugin instead of the official one from Sonar, you need to pipe the normal SwiftLint output into a txt file instead of using the sonarqube output.

@cah-iswaria-sasi
Copy link
Author

we have duplications block which is reported as 0% but we have duplications in files. we are using your plugin for swift project analysis. can you please tell why is it so not working or its following any algorithm or methodology that we need to be aware of

@SimplyDanny
Copy link
Collaborator

Analysis of duplicated code is not part of SwiftLint. It might only be part of the Sonar plugins and I've never used any of them. Therefore, I cannot help you with that.

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

No branches or pull requests

2 participants