Skip to content

Commit 1b9f9e4

Browse files
committed
Merge progress reporting sections
When I created the new section about progress reporting on the "Reporting" page, I'd overlooked that the "Usage" page already contained a section on progress reporting. This commit now removes the section from the "Reporting" page again and merges some of the information which was contained in that section, into the information about progress reporting on the "Usage" page. Includes various tweaks and updates to the pre-existing information: * Make it explicit how progress reporting can be enabled. * Shorten the example output for progress. * Mention the name of the configuration option to enable progress reporting by default. * Refresh the example output for the verbose example.
1 parent 6260419 commit 1b9f9e4

File tree

2 files changed

+28
-51
lines changed

2 files changed

+28
-51
lines changed

wiki/Reporting.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
## Table of contents
2-
* [Progress reporting](#progress-reporting)
32
* [Printing Full and Summary Reports](#printing-full-and-summary-reports)
43
* Other Report Types
54
* [Checkstyle](#printing-a-checkstyle-report)
@@ -24,27 +23,6 @@
2423

2524
***
2625

27-
## Progress reporting
28-
29-
To see progress reporting while scanning a code base, use the `-p` command line argument.
30-
31-
Legend for the progress indicators:
32-
33-
| When scanning with | Indicator | Means: |
34-
| ------------------ | ------------ | --------------------------------------------------------- |
35-
| `phpcs`/`phpcbf` | `S` | Skipped file |
36-
| `phpcs` | `E` (red) | Non-fixable errors found in the file |
37-
| | `E` (green) | Fixable errors found in the file |
38-
| | `W` (yellow) | Non-fixable warnings found in the file |
39-
| | `W` (green) | Fixable warnings found in the file |
40-
| | `.` | No errors or warnings found in the file |
41-
| `phpcbf` | `F` (green) | Fixed errors or warnings in the file |
42-
| | `E` (red) | Unfixable errors or warnings in the file (fixer conflict) |
43-
| | `.` | No errors or warnings found in the file |
44-
45-
<p align="right"><a href="#table-of-contents">back to top</a></p>
46-
47-
4826
## Printing Full and Summary Reports
4927
When running a scan, by default, the full report is displayed.
5028

wiki/Usage.md

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -216,48 +216,47 @@ A TOTAL OF 6 ERROR(S) WERE FOUND IN 2 FILE(S)
216216

217217
By default, PHP_CodeSniffer will run quietly, only printing the report of errors and warnings at the end. If you are checking a large number of files, you may have to wait a while to see the report. If you want to know what is happening, you can turn on progress or verbose output.
218218

219-
With progress output enabled, PHP_CodeSniffer will print a single-character status for each file being checked. The possible status characters are:
220-
221-
* `.` : The file contained no errors or warnings
222-
* `E` : The file contained 1 or more errors
223-
* `W` : The file contained 1 or more warnings, but no errors
224-
* `S` : The file contained a [// phpcs:ignoreFile](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Advanced-Usage#ignoring-files-and-folders) comment and was skipped
225-
226-
Progress output will look like this:
219+
To enable progress reporting, use the `-p` command line argument.
220+
With progress output enabled, PHP_CodeSniffer will print a single-character status for each file being checked, like so:
227221

228222
```
229223
$ phpcs /path/to/code/CodeSniffer -p
230224
231-
......................S..................................... 60 / 572
232-
..........EEEE.E.E.E.E.E.E.E.E..W..EEE.E.E.E.EE.E.E.E.E.E.E. 120 / 572
233-
E.E.E.E.E.WWWW.E.W..EEE.E.................E.E.E.E...E....... 180 / 572
234-
E.E.E.E.....................E.E.E.E.E.E.E.E.E.E.W.E.E.E.E.E. 240 / 572
235-
E.W......................................................... 300 / 572
236-
..........................................E.E.E.E...E.E.E.E. 360 / 572
237-
E.E.E.E.E.E..E.E.E..E..E..E.E.WW.E.E.EE.E.E................. 420 / 572
238-
...................E.E.EE.E.E.E.S.E.EEEE.E...E...EE.E.E..EEE 480 / 572
239-
.E.EE.E.E..E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E.E..E..E..E.E.E..E 540 / 572
240-
.E.E....E.E.E...E.....E.E.ES....
225+
...S........W.........S..................................... 60 / 110 (54%)
226+
..........EEEE.E.E.E.E.E.E.E.E..W..EEE.E.E.E.EE.E. 110 / 110 (100%)
241227
```
242228

229+
Legend for the progress indicators:
230+
231+
| When scanning with | Indicator | Means: |
232+
| ------------------ | ------------ | --------------------------------------------------------- |
233+
| `phpcs` | `E` (red) | Non-fixable error(s) found in the file |
234+
| | `E` (green) | Fixable error(s) found in the file |
235+
| | `W` (yellow) | Non-fixable warning(s) found in the file, but no errors |
236+
| | `W` (green) | Fixable warning(s) found in the file, but no errors |
237+
| `phpcbf` | `F` (green) | Fixed errors and/or warnings in the file |
238+
| | `E` (red) | Unfixable errors or warnings in the file (fixer conflict) |
239+
| `phpcs`/`phpcbf` | `.` | No errors or warnings found in the file |
240+
| | `S` | File was skipped |
241+
243242
> [!NOTE]
244-
> You can configure PHP_CodeSniffer to show progress information by default using [the configuration option](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#showing-progress-by-default)</link>.
243+
> You can configure PHP_CodeSniffer to show progress information by default using [the `show_progress` configuration option](https://github.com/PHPCSStandards/PHP_CodeSniffer/wiki/Configuration-Options#showing-progress-by-default)</link>.
245244
246245
With verbose output enabled, PHP_CodeSniffer will print the file that it is checking, show you how many tokens and lines the file contains, and let you know how long it took to process. The output will look like this:
247246

248247
```
249248
$ phpcs /path/to/code/CodeSniffer -v
250249
251-
Registering sniffs in PEAR standard... DONE (24 sniffs registered)
252-
Creating file list... DONE (572 files in queue)
253-
Processing AbstractDocElement.php [1093 tokens in 303 lines]... DONE in < 1 second (0 errors, 1 warnings)
254-
Processing AbstractParser.php [2360 tokens in 558 lines]... DONE in 2 seconds (0 errors, 1 warnings)
255-
Processing ClassCommentParser.php [923 tokens in 296 lines]... DONE in < 1 second (2 errors, 0 warnings)
256-
Processing CommentElement.php [988 tokens in 218 lines]... DONE in < 1 second (1 error, 5 warnings)
257-
Processing FunctionCommentParser.php [525 tokens in 184 lines]... DONE in 1 second (0 errors, 6 warnings)
258-
Processing File.php [10968 tokens in 1805 lines]... DONE in 5 seconds (0 errors, 5 warnings)
259-
Processing Sniff.php [133 tokens in 94 lines]... DONE in < 1 second (0 errors, 0 warnings)
260-
Processing SniffException.php [47 tokens in 36 lines]... DONE in < 1 second (1 errors, 3 warnings)
250+
Registering sniffs in PEAR standard... DONE (28 sniffs registered)
251+
Creating file list... DONE (158 files in queue)
252+
Changing into directory src/Standards/Generic/Sniffs/Arrays
253+
Processing ArrayIndentSniff.php [1409 tokens in 193 lines]... DONE in 39ms (4 errors, 20 warnings)
254+
Processing DisallowLongArraySyntaxSniff.php [405 tokens in 72 lines]... DONE in 11ms (0 errors, 4 warnings)
255+
Processing DisallowShortArraySyntaxSniff.php [331 tokens in 61 lines]... DONE in 9ms (4 errors, 3 warnings)
256+
Changing into directory src/Standards/Generic/Sniffs/Classes
257+
Processing DuplicateClassNameSniff.php [800 tokens in 118 lines]... DONE in 24ms (0 errors, 0 warnings)
258+
Processing OpeningBraceSameLineSniff.php [936 tokens in 123 lines]... DONE in 26ms (4 errors, 12 warnings)
259+
...
261260
```
262261

263262
<p align="right"><a href="#table-of-contents">back to top</a></p>

0 commit comments

Comments
 (0)