Skip to content

Wiki/Reporting: improve report display #15

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

Merged
merged 1 commit into from
Jul 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions wiki/Reporting.md
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,8 @@ PHP_CodeSniffer can output an XML report similar to the one produced by Checksty

```bash
$ phpcs --report=checkstyle /path/to/code

```
```xml
<?xml version="1.0" encoding="UTF-8"?>
<checkstyle version="x.x.x">
<file name="/path/to/code/classA.php">
Expand All @@ -284,7 +285,8 @@ PHP_CodeSniffer can output a CSV report to allow you to parse the output and use

```bash
$ phpcs --report=csv /path/to/code

```
```csv
File,Line,Column,Type,Message,Source,Severity,Fixable
"/path/to/code/classA.php",2,1,error,"Missing file doc comment",PEAR.Commenting.FileComment.Missing,5,0
"/path/to/code/classA.php",4,12,error,"TRUE, FALSE and NULL must be lowercase; expected \"false\" but found \"FALSE\"",Generic.PHP.LowerCaseConstant.Found,5,1
Expand All @@ -308,7 +310,8 @@ PHP_CodeSniffer can output a diff file that can be applied using the `patch` com

```bash
$ phpcs --report=diff /path/to/code

```
```diff
--- /path/to/code/file.php
+++ PHP_CodeSniffer
@@ -1,8 +1,8 @@
Expand Down Expand Up @@ -441,7 +444,8 @@ PHP_CodeSniffer can output an JSON report to allow you to parse the output and u

```bash
$ phpcs --report=json /path/to/code

```
```json
{
"totals": {
"errors": 4,
Expand Down Expand Up @@ -520,7 +524,8 @@ PHP_CodeSniffer can output an XML report similar to the one produced by JUnit, a

```bash
$ phpcs --report=junit /path/to/code

```
```xml
<?xml version="1.0" encoding="UTF-8"?>
<testsuites name="PHP_CodeSniffer x.x.x" tests="6" failures="5">
<testsuite name="/path/to/code/classA.php" tests="5" failures="5">
Expand Down Expand Up @@ -612,7 +617,8 @@ PHP_CodeSniffer can output an XML report to allow you to parse the output and us

```bash
$ phpcs --report=xml /path/to/code

```
```xml
<?xml version="1.0" encoding="UTF-8"?>
<phpcs version="x.x.x">
<file name="/path/to/code/classA.php" errors="4" warnings="1" fixable="3">
Expand Down