Skip to content

Commit f93397a

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 handled 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 cb3e80b commit f93397a

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 CONTRIBUTING.
5354
- maxlevel

wiki/Reporting.md

Lines changed: 40 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -374,19 +374,21 @@ PHP_CodeSniffer can make use of the `git blame` command to try and determine who
374374
$ phpcs --report=gitblame /path/to/code
375375
376376
PHP CODE SNIFFER GIT BLAME SUMMARY
377-
--------------------------------------------------------------------------------
378-
AUTHOR COUNT (%)
379-
--------------------------------------------------------------------------------
380-
jsmith 51 (40.8)
381-
jblogs 44 (30)
382-
pdeveloper 43 (10.33)
383-
jscript 27 (19.84)
384-
--------------------------------------------------------------------------------
385-
A TOTAL OF 165 SNIFF VIOLATION(S) WERE COMMITTED BY 4 AUTHOR(S)
386-
--------------------------------------------------------------------------------
377+
----------------------------------------------------------------------
378+
AUTHOR (Author %) (Overall %) COUNT
379+
----------------------------------------------------------------------
380+
jsmith (2.25) (61.11) 33
381+
jblogs (2.48) (29.63) 16
382+
pdeveloper (0.78) (5.56) 3
383+
jscript (1.39) (1.85) 1
384+
toogood (3.33) (1.85) 1
385+
----------------------------------------------------------------------
386+
A TOTAL OF 54 SNIFF VIOLATIONS WERE COMMITTED BY 5 AUTHORS
387+
----------------------------------------------------------------------
387388
```
388389
389-
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.
390+
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.
391+
390392
391393
To show a breakdown of the types of violations each author is committing, use the `-s` command line argument.
392394
@@ -395,18 +397,23 @@ $ phpcs -s --report=gitblame /path/to/code
395397
396398
PHP CODE SNIFFER GIT BLAME SUMMARY
397399
--------------------------------------------------------------------------------
398-
AUTHOR SOURCE COUNT (%)
400+
AUTHOR SOURCE (Author %) (Overall %) COUNT
399401
--------------------------------------------------------------------------------
400-
jsmith 51 (40.8)
401-
Squiz.Files.LineLength 47
402-
PEAR.Functions.FunctionCallSignature 4
403-
jblogs 44 (30)
404-
Squiz.Files.LineLength 40
405-
Generic.CodeAnalysis.UnusedFunctionParameter 2
406-
Squiz.CodeAnalysis.EmptyStatement 1
407-
Squiz.Formatting.MultipleStatementAlignment 1
402+
jsmith (2.25) (61.11) 33
403+
Generic.Files.LineLength.TooLong 22
404+
PEAR.Functions.FunctionCallSignature 1
405+
jblogs (2.48) (29.63) 16
406+
Squiz.Formatting.MultipleStatementAlignment 10
407+
PSR12.Classes.ClosingBrace.StatementAfter 4
408+
Generic.Files.LineLength.TooLong 2
409+
pdeveloper (0.78) (5.56) 3
410+
Generic.CodeAnalysis.UnusedFunctionParameter 3
411+
jscript (1.39) (1.85) 1
412+
Squiz.CodeAnalysis.EmptyStatement 1
413+
toogood (3.33) (1.85) 1
414+
PSR12.Classes.ClosingBrace.StatementAfter 1
408415
--------------------------------------------------------------------------------
409-
A TOTAL OF 95 SNIFF VIOLATION(S) WERE COMMITTED BY 2 AUTHOR(S)
416+
A TOTAL OF 54 SNIFF VIOLATIONS WERE COMMITTED BY 5 AUTHORS
410417
--------------------------------------------------------------------------------
411418
```
412419
@@ -416,17 +423,18 @@ To include authors with no violations, use the `-v` command line argument.
416423
$ phpcs -v --report=gitblame /path/to/code
417424
418425
PHP CODE SNIFFER GIT BLAME SUMMARY
419-
--------------------------------------------------------------------------------
420-
AUTHOR COUNT (%)
421-
--------------------------------------------------------------------------------
422-
jsmith 51 (40.8)
423-
jblogs 44 (30)
424-
pdeveloper 43 (10.33)
425-
jscript 27 (19.84)
426-
toogood 0 (0)
427-
--------------------------------------------------------------------------------
428-
A TOTAL OF 165 SNIFF VIOLATION(S) WERE COMMITTED BY 5 AUTHOR(S)
429-
--------------------------------------------------------------------------------
426+
----------------------------------------------------------------------
427+
AUTHOR (Author %) (Overall %) COUNT
428+
----------------------------------------------------------------------
429+
jsmith (2.25) (61.11) 33
430+
jblogs (2.48) (29.63) 16
431+
pdeveloper (0.78) (5.56) 3
432+
jscript (1.39) (1.85) 1
433+
toogood (3.33) (1.85) 1
434+
mrsperfect (0) (0) 0
435+
----------------------------------------------------------------------
436+
A TOTAL OF 54 SNIFF VIOLATIONS WERE COMMITTED BY 6 AUTHORS
437+
----------------------------------------------------------------------
430438
```
431439
432440
> [!IMPORTANT]

0 commit comments

Comments
 (0)