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

Add checkstyle printer #139

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Add checkstyle printer #139

wants to merge 3 commits into from

Conversation

sasezaki
Copy link
Contributor

@sasezaki sasezaki commented Sep 25, 2021

This PR requests adding checkstyle output feature.

I need checkstyle output to work with cs2pr, and other QA tools.

Notes: This PR also inclueds cs-fix

The ``--checkstyle-output`` option will generate a report in checkstyle xml format to the path specified by the option.

The ``--extensions`` option lets you extend the code analysis. The provided extensions must be comma separated.

**By default it analyses conditions, return statements, and switch cases.**
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This line "**By default it analyses ~", was seemed to intended to add after --extensions . So I move "The --extensions ~" line.

ce6fe2e

@sasezaki sasezaki marked this pull request as ready for review September 25, 2021 07:36
@exussum12
Copy link
Collaborator

Would prefer this to be an output=xml or output=checkstyle.

You could pass both flags currently which would be strange- Checkstyle is a great idea though


public function printData(OutputInterface $output, FileReportList $fileReportList, HintList $hintList): void
{
$output->writeln('Generate checkstyle report output...');
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure if these should be printed to stderr ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just did find what you pointed :)
squizlabs/PHP_CodeSniffer#1612

src/Printer/Util.php Outdated Show resolved Hide resolved
src/Printer/Util.php Outdated Show resolved Hide resolved
@sasezaki
Copy link
Contributor Author

Would prefer this to be an output=xml or output=checkstyle.

Not sure if these should be printed to stderr ?

I will try refactor (includes BC breaks) output format on another PR branch.

@povils
Copy link
Owner

povils commented Sep 27, 2021

Would prefer this to be an output=xml or output=checkstyle.

You could pass both flags currently which would be strange- Checkstyle is a great idea though

I also see this as just a different output

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

Successfully merging this pull request may close these issues.

None yet

3 participants