Skip to content

Commit b53397b

Browse files
committed
Wiki/Reporting: update example output for gitblame reports
The generation of the output examples for the `gitblame` report cannot easily be automated for the following reasons: 1. If using code samples committed to this repo, there would (for now) only be one author, making the output example not a very good example. 2. If generating these output examples from an existing codebase, there may be privacy issues in play when using the handles/names of real developers. All in all, for now, the output has been manually updated to use the current report format, but using fake data.
1 parent cd989d3 commit b53397b

File tree

2 files changed

+41
-32
lines changed

2 files changed

+41
-32
lines changed

.cspell.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ words:
4848
- pdeveloper
4949
- jscript
5050
- toogood
51+
- mrsperfect
5152

5253
# Used in Wiki Reporting page, "emacs" file.
5354
- defun

wiki/Reporting.md

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -377,19 +377,21 @@ PHP_CodeSniffer can make use of the `git blame` command to try and determine who
377377
$ phpcs --report=gitblame /path/to/code
378378
379379
PHP CODE SNIFFER GIT BLAME SUMMARY
380-
--------------------------------------------------------------------------------
381-
AUTHOR COUNT (%)
382-
--------------------------------------------------------------------------------
383-
jsmith 51 (40.8)
384-
jblogs 44 (30)
385-
pdeveloper 43 (10.33)
386-
jscript 27 (19.84)
387-
--------------------------------------------------------------------------------
388-
A TOTAL OF 165 SNIFF VIOLATION(S) WERE COMMITTED BY 4 AUTHOR(S)
389-
--------------------------------------------------------------------------------
380+
----------------------------------------------------------------------
381+
AUTHOR (Author %) (Overall %) COUNT
382+
----------------------------------------------------------------------
383+
jsmith (2.25) (61.11) 33
384+
jblogs (2.48) (29.63) 16
385+
pdeveloper (0.78) (5.56) 3
386+
jscript (1.39) (1.85) 1
387+
toogood (3.33) (1.85) 1
388+
----------------------------------------------------------------------
389+
A TOTAL OF 54 SNIFF VIOLATIONS WERE COMMITTED BY 5 AUTHORS
390+
----------------------------------------------------------------------
390391
```
391392
392-
Each author is listed with the number of violations they committed and the percentage of error lines to clean lines. The example report above shows that the developer `pdeveloper` has 43 violations but they only make up 10% of all code they have committed, while `jblogs` has 44 violations but they make up 30% of all their committed code. So these developers have about the same number of total violations, but `pdeveloper` seems to be doing a better job of conforming to the coding standard.
393+
Each author is listed with the number of violations they committed and the percentage of error lines to clean lines. The example report above shows that the developer `jscript` has 1 violation but they only make up 1.39% of all code they have committed, while `toogood` has 1 violation but they make up 3.33% of all their committed code. So these developers have about the same number of total violations, but `jscript` seems to be doing a better job of conforming to the coding standard.
394+
393395
394396
To show a breakdown of the types of violations each author is committing, use the `-s` command line argument.
395397
@@ -398,18 +400,23 @@ $ phpcs -s --report=gitblame /path/to/code
398400
399401
PHP CODE SNIFFER GIT BLAME SUMMARY
400402
--------------------------------------------------------------------------------
401-
AUTHOR SOURCE COUNT (%)
403+
AUTHOR SOURCE (Author %) (Overall %) COUNT
402404
--------------------------------------------------------------------------------
403-
jsmith 51 (40.8)
404-
Squiz.Files.LineLength 47
405-
PEAR.Functions.FunctionCallSignature 4
406-
jblogs 44 (30)
407-
Squiz.Files.LineLength 40
408-
Generic.CodeAnalysis.UnusedFunctionParameter 2
409-
Squiz.CodeAnalysis.EmptyStatement 1
410-
Squiz.Formatting.MultipleStatementAlignment 1
405+
jsmith (2.25) (61.11) 33
406+
Generic.Files.LineLength.TooLong 22
407+
PEAR.Functions.FunctionCallSignature 1
408+
jblogs (2.48) (29.63) 16
409+
Squiz.Formatting.MultipleStatementAlignment 10
410+
PSR12.Classes.ClosingBrace.StatementAfter 4
411+
Generic.Files.LineLength.TooLong 2
412+
pdeveloper (0.78) (5.56) 3
413+
Generic.CodeAnalysis.UnusedFunctionParameter 3
414+
jscript (1.39) (1.85) 1
415+
Squiz.CodeAnalysis.EmptyStatement 1
416+
toogood (3.33) (1.85) 1
417+
PSR12.Classes.ClosingBrace.StatementAfter 1
411418
--------------------------------------------------------------------------------
412-
A TOTAL OF 95 SNIFF VIOLATION(S) WERE COMMITTED BY 2 AUTHOR(S)
419+
A TOTAL OF 54 SNIFF VIOLATIONS WERE COMMITTED BY 5 AUTHORS
413420
--------------------------------------------------------------------------------
414421
```
415422
@@ -419,17 +426,18 @@ To include authors with no violations, use the `-v` command line argument.
419426
$ phpcs -v --report=gitblame /path/to/code
420427
421428
PHP CODE SNIFFER GIT BLAME SUMMARY
422-
--------------------------------------------------------------------------------
423-
AUTHOR COUNT (%)
424-
--------------------------------------------------------------------------------
425-
jsmith 51 (40.8)
426-
jblogs 44 (30)
427-
pdeveloper 43 (10.33)
428-
jscript 27 (19.84)
429-
toogood 0 (0)
430-
--------------------------------------------------------------------------------
431-
A TOTAL OF 165 SNIFF VIOLATION(S) WERE COMMITTED BY 5 AUTHOR(S)
432-
--------------------------------------------------------------------------------
429+
----------------------------------------------------------------------
430+
AUTHOR (Author %) (Overall %) COUNT
431+
----------------------------------------------------------------------
432+
jsmith (2.25) (61.11) 33
433+
jblogs (2.48) (29.63) 16
434+
pdeveloper (0.78) (5.56) 3
435+
jscript (1.39) (1.85) 1
436+
toogood (3.33) (1.85) 1
437+
mrsperfect (0) (0) 0
438+
----------------------------------------------------------------------
439+
A TOTAL OF 54 SNIFF VIOLATIONS WERE COMMITTED BY 6 AUTHORS
440+
----------------------------------------------------------------------
433441
```
434442
435443
> [!IMPORTANT]

0 commit comments

Comments
 (0)