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

Introduce Sonarqube Generic Format Report #400

Open
iVegas opened this issue Mar 15, 2024 · 3 comments
Open

Introduce Sonarqube Generic Format Report #400

iVegas opened this issue Mar 15, 2024 · 3 comments

Comments

@iVegas
Copy link

iVegas commented Mar 15, 2024

Is your feature request related to a problem?

I want to provide a code quality report to the Sonarqube instance.

Describe the solution you'd like

I want to be able to choose a report type for code quality check that is compatible with the Sonarqube generic report format.

Additional context (optional)

See https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/importing-external-issues/generic-issue-import-format/

@jrfnl
Copy link
Member

jrfnl commented Mar 16, 2024

@iVegas Thank you for your interest in contributing to PHP_CodeSniffer.

There have been requests for this before. I suggest you read the previous discussion about this and take note of the reasons why this was not accepted so far.

squizlabs/PHP_CodeSniffer#2451

More than anything, I would like to point out that custom reports can already be provided via an external standard since PHPCS 3.3.0: squizlabs/PHP_CodeSniffer#1948. That would very much be the preferred route as that means the maintenance burden would not fall on the maintainers of PHPCS.

@iVegas
Copy link
Author

iVegas commented Mar 17, 2024

So, if I create a project that will implement the expected Report class in a separate composer package, is there a way phpcs will pick definitions of the new Report class as an additional report option?

UPD: I see the linked PR. As I understand, the approach you are proposing to declare the custom Report implementation is through autoloader, which will initiate the custom code standard. Can we update the https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Reporting page to describe how to set to use the custom report format for phpcs call?

@jrfnl
Copy link
Member

jrfnl commented Mar 17, 2024

Can we update the https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Reporting page to describe how to set to use the custom report format for phpcs call?

@iVegas That sounds like a good idea! Would you like to create a text proposal ? We can then fine-tune it together before I update the page.

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

No branches or pull requests

2 participants