robincornett/genesis-accessible

Add PHPCS support

Closed this issue · 0 comments

Adding PHPCS support locally, I see the following in reports:

Summary Report
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
---------------------------------------------------------------------------
    SOURCE                                                            COUNT
---------------------------------------------------------------------------
[x] Generic.Commenting.DocComment.SpacingBeforeTags                   22
[x] WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterStart  18
[ ] Squiz.Commenting.InlineComment.InvalidEndChar                     17
[ ] WordPress.Security.EscapeOutput.UnsafePrintingFunction            11
[ ] Squiz.Commenting.FunctionComment.MissingParamName                 10
[ ] Squiz.Commenting.FunctionComment.MissingParamTag                  10
[x] PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket      9
[ ] Squiz.Commenting.FileComment.MissingPackageTag                    9
[ ] WordPress.Security.EscapeOutput.OutputNotEscaped                  9
[ ] Generic.Commenting.DocComment.ShortNotCapital                     8
[x] Generic.Commenting.DocComment.SpacingAfter                        8
[x] WordPress.WhiteSpace.ControlStructureSpacing.BlankLineBeforeEnd   8
[x] PEAR.Functions.FunctionCallSignature.CloseBracketLine             6
[x] Squiz.Commenting.InlineComment.NoSpaceBefore                      6
[x] PEAR.Functions.FunctionCallSignature.MultipleArguments            5
[ ] Squiz.Commenting.FileComment.Missing                              4
[ ] WordPress.PHP.StrictComparisons.LooseComparison                   4
[ ] WordPress.WP.AlternativeFunctions.strip_tags_strip_tags           4
[ ] Squiz.Commenting.FunctionComment.MissingParamComment              2
[ ] WordPress.Files.FileName.InvalidClassFileName                     2
[ ] WordPress.PHP.StrictInArray.MissingTrueStrict                     2
[x] Squiz.Commenting.BlockComment.NoNewLine                           1
[ ] Squiz.Commenting.ClassComment.SpacingAfter                        1
[ ] Squiz.Commenting.FileComment.DuplicateAuthorTag                   1
[ ] Squiz.Commenting.FileComment.SpacingAfterComment                  1
[ ] Squiz.Commenting.FileComment.WrongStyle                           1
[ ] Squiz.Commenting.FunctionComment.Missing                          1
[x] Squiz.Commenting.FunctionComment.SpacingAfterParamType            1
[x] Squiz.Commenting.InlineComment.SpacingAfter                       1
[ ] Squiz.PHP.CommentedOutCode.Found                                  1
[x] Squiz.PHP.EmbeddedPhp.ContentBeforeOpen                           1
[ ] WordPress.Security.NonceVerification.NoNonceVerification          1
[ ] WordPress.WP.I18n.MissingTranslatorsComment                       1
---------------------------------------------------------------------------
A TOTAL OF 186 SNIFF VIOLATIONS WERE FOUND IN 33 SOURCES
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 12 MARKED SOURCES AUTOMATICALLY (86 VIOLATIONS IN TOTAL)
---------------------------------------------------------------------------

Time: 740ms; Memory: 10Mb
Gitblame Report
PHP CODE SNIFFER GIT BLAME SUMMARY
-------------------------------------------------------------------------------------------------------
AUTHOR   SOURCE                                                            (Author %) (Overall %) COUNT
-------------------------------------------------------------------------------------------------------
Unknown                                                                       (90.12)     (90.86)   169
         [x] Generic.Commenting.DocComment.SpacingBeforeTags                                         20
         [x] WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterStart                        17
         [ ] WordPress.Security.EscapeOutput.UnsafePrintingFunction                                  11
         [ ] Squiz.Commenting.FunctionComment.MissingParamName                                       10
         [ ] Squiz.Commenting.FunctionComment.MissingParamTag                                        10
         [ ] Squiz.Commenting.InlineComment.InvalidEndChar                                           10
         [ ] Squiz.Commenting.FileComment.MissingPackageTag                                           9
         [ ] WordPress.Security.EscapeOutput.OutputNotEscaped                                         9
         [x] WordPress.WhiteSpace.ControlStructureSpacing.BlankLineBeforeEnd                          8
         [x] PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket                             8
         [x] Generic.Commenting.DocComment.SpacingAfter                                               8
         [ ] Generic.Commenting.DocComment.ShortNotCapital                                            8
         [x] PEAR.Functions.FunctionCallSignature.CloseBracketLine                                    6
         [x] Squiz.Commenting.InlineComment.NoSpaceBefore                                             5
         [x] PEAR.Functions.FunctionCallSignature.MultipleArguments                                   5
         [ ] WordPress.PHP.StrictComparisons.LooseComparison                                          4
         [ ] WordPress.WP.AlternativeFunctions.strip_tags_strip_tags                                  4
         [ ] Squiz.Commenting.FileComment.Missing                                                     4
         [ ] WordPress.PHP.StrictInArray.MissingTrueStrict                                            2
         [ ] WordPress.Files.FileName.InvalidClassFileName                                            2
         [ ] Squiz.Commenting.FunctionComment.MissingParamComment                                     2
         [x] Squiz.PHP.EmbeddedPhp.ContentBeforeOpen                                                  1
         [x] Squiz.Commenting.InlineComment.SpacingAfter                                              1
         [x] Squiz.Commenting.FunctionComment.SpacingAfterParamType                                   1
         [ ] Squiz.Commenting.FileComment.SpacingAfterComment                                         1
         [ ] WordPress.WP.I18n.MissingTranslatorsComment                                              1
         [ ] Squiz.Commenting.FunctionComment.Missing                                                 1
         [ ] Squiz.Commenting.ClassComment.SpacingAfter                                               1
Robin Cornett                                                                 (17.14)      (7.53)    14
         [ ] Squiz.Commenting.InlineComment.InvalidEndChar                                            7
         [x] PEAR.Functions.FunctionCallSignature.ContentAfterOpenBracket                             1
         [x] WordPress.WhiteSpace.ControlStructureSpacing.BlankLineAfterStart                         1
         [x] Generic.Commenting.DocComment.SpacingBeforeTags                                          1
         [x] Squiz.Commenting.InlineComment.NoSpaceBefore                                             1
         [ ] WordPress.Security.NonceVerification.NoNonceVerification                                 1
         [ ] Squiz.PHP.CommentedOutCode.Found                                                         1
         [ ] Squiz.Commenting.FileComment.DuplicateAuthorTag                                          1
Rian Rietveld                                                                  (2.04)      (1.61)     3
         [x] Generic.Commenting.DocComment.SpacingBeforeTags                                          1
         [x] Squiz.Commenting.BlockComment.NoNewLine                                                  1
         [ ] Squiz.Commenting.FileComment.WrongStyle                                                  1
-------------------------------------------------------------------------------------------------------
A TOTAL OF 186 SNIFF VIOLATIONS WERE COMMITTED BY 3 AUTHORS
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 17 MARKED SOURCES AUTOMATICALLY (86 VIOLATIONS IN TOTAL)
-------------------------------------------------------------------------------------------------------

Time: 776ms; Memory: 10Mb

Adding PHPCS in as a development dependency will allow these violations to more easily be addressed.