Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Checkstyle pipe not finding the report file Edited

I've configured the pipe through several ways and just can't figure out how to get the pipe read the report file generated by php-cs-fixer. The file is being generated and I can confirm that by running the cat command to see its content.

- step: &code-standard
name: Code Standard
script:
- php-cs-fixer fix --dry-run --format=checkstyle . > checkstyle-result.xml
after-script:
- pipe: atlassian/checkstyle-report:0.2.0
variables:
REPORT_FAIL_SEVERITY: 'error'
- cat checkstyle-result.xml 

 

1 answer

0 votes

Hello @tsantos if to look at the docs of the pipe , I don't see php-cs-fixer to be supported actually.

I guess it can be supported if it generates absolutely compliant report xml file.

 I have checked this tool on compliance https://github.com/FriendsOfPHP/PHP-CS-Fixer/issues/3459 and I have some doubts that it is truly compliant.

You can ensure this and we can continue to investigate your case.

Also, please provide the logs of the pipe if it is failing or explain your actual output , you get.

 

Regards, Galyna

Hi @Galyna Zholtkevych , thanks for replying. This is a sample of the file that PHP CS Fixer generates for Checkstyle format:

 

<?xml version="1.0" encoding="UTF-8"?>
<checkstyle>
<file name="MyClass.php">
<error severity="warning" source="PHP-CS-Fixer.no_spaces_inside_parenthesis" message="Found violation(s) of type: no_spaces_inside_parenthesis"/>
<error severity="warning" source="PHP-CS-Fixer.phpdoc_summary" message="Found violation(s) of type: phpdoc_summary"/>
</file>
</checkstyle>

 

The step fails as expected because there are violations in the source. and the report is generated but without any issues on it (it is green instead of red).

@tsantos regarding your case, I see in your file generated warnings (severity="warning"),

and you put the REPORT_FAIL_SEVERITY as "error". Try to put REPORT_FAIL_SEVERITY as warning, so it will report warnings and above. Contact us, please telling the feedback of what you've got.

Regards, Galyna

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket Pipelines

What We Learned When We Researched Open Source Vulnerabilities in 7 Popular Coding Languages

...hey are a part of us, shaping how we interact with the world around us. The same holds true for programming languages when we think about how different kinds of vulnerabilities raise their heads in t...

1,327 views 0 3
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you