joomla / coding-standards

Joomla Coding Standards Definition
https://developer.joomla.org/coding-standards/basic-guidelines.html
GNU General Public License v2.0
128 stars 129 forks source link

[META] Finalizing PHPCS 2.x support #143

Open mbabker opened 7 years ago

mbabker commented 7 years ago

Extracted from https://github.com/joomla/coding-standards/pull/109#issuecomment-268876448

photodude commented 6 years ago

For now let us strip the code coverage annotations out of the code. I doubt there is a way to ignore a specific case like that without creating a custom sniff

photodude commented 6 years ago

With #218 and #219 merged is there any reason not to do a stable release of the coding standards? (I'm considering CMS compliance and use as a separate case of ongoing PRs unrelated to the actual stability of the coding standards)

photodude commented 6 years ago

We need to finalize our "stable" release of the PHPCS 2.x version. The next release of PHPCS 2.9.x will be the last bug fix for that branch. Note #227 for consideration with the PHPCS 2.x version.

Once our PHPCS 2.x "stable" version is released we need to move the PHPCS 3.x dev branch to master and make a release.

mbabker commented 6 years ago

Just finished switching over the Database package. This build should keep someone busy for a few minutes 😉

https://travis-ci.org/joomla-framework/database/jobs/339728069

photodude commented 6 years ago

Interesting the code comment is being included by the sniff as part of the type New issue opened https://github.com/joomla/coding-standards/issues/228

photodude commented 6 years ago

I have a fix for the return type issues in the database package... #229 The fix works and the new tests pass... but there is an unresolvable code style issue with the multi-line if statements in the fix that I'm trying to get resolved by PHPCS.

wilsonge commented 6 years ago

I've tagged a 2.0 RC https://github.com/joomla/coding-standards/releases/tag/2.0.0-rc :) Let's get the rest of the CMS and framework packages in compliance before we tag a stable :)

mbabker commented 6 years ago

Finally all ~90 Framework package branches are done. Until the next masochistic mass update is needed...

wilsonge commented 6 years ago

OK so @photodude what's the status of the CMS?

photodude commented 6 years ago

I was hoping to work on it about 2 weeks ago before I got hit with a very bad stomach flu. I'm finally better but now playing catch up on everything I should have gotten done.

Currently, we have two choices with the CMS 1) more PR's to fix things that are now detected and reported. (2.x does a better job catching things than 1.5.x) or 2) expand the exclusions list. (see in progress list above)

The administrator section is nearly in compliance, although there are some indenting issues from recent commits that the 1.5.x ruleset didn't catch. I think the components section has a little bit of work needing to be done. The biggest problem areas are libraries and tests.

This is a travis report with the larger exclusions list (although not as comprehensive as the one listed above) https://travis-ci.org/photodude/joomla-cms/builds/346905854

It's a bit slow getting the CMS in compliance as I feel the PR's need to be small to avoid disrupting all of the nearly 400 open PR's in the CMS. I've tried to keep the number of files under 20 in each PR both for review and to limit disruptions and merge conflicts.

Last few PR's I've been targeting specific rules to eliminate exclusions. As such, we no longer have any exclusions on space indenting. All thanks to the last 3 PR's we are now completely enforcing tab indenting.

I think it will be a few more days before I can bust out some more PR's to see how far we are off at the moment.

wilsonge commented 6 years ago

Ok, so I’m totally happy excluding the entire tests folder. The components folder I guess it depends what we’re excluding. But I really need to get this into the 4.x branch because we’re doing anonymous classes and it’s all going wrong with the current rule set xD

photodude commented 6 years ago

If I set up the source report correctly this is a list of the current failures by frequency of errors. I expanded the existing exclusions to exclude the tests folder for this report. As you can see some of these are manual only changes

------------------------------------------------------------------------------
[ ] Joomla.Commenting.FunctionComment.MissingParamTag                    289
[ ] Joomla.Commenting.FunctionComment.ParamNameNoMatch                   279
[x] PEAR.Functions.FunctionCallSignature.Indent                          64
[ ] Joomla.Commenting.FunctionComment.InvalidReturnNotVoid               46
[x] Joomla.Commenting.FunctionComment.InvalidReturn                      45
[ ] Joomla.Commenting.FunctionComment.InvalidNoReturn                    38
[x] Squiz.Commenting.BlockComment.SingleLine                             26
[x] PEAR.Functions.FunctionCallSignature.CloseBracketLine                23
[ ] Joomla.Commenting.FunctionComment.InvalidReturnVoid                  21
[x] PEAR.WhiteSpace.ObjectOperatorIndent.Incorrect                       18
[ ] Joomla.Commenting.FunctionComment.WrongStyle                         15
[x] PEAR.Functions.FunctionDeclaration.CloseBracketLine                  11
[x] Generic.WhiteSpace.ScopeIndent.Incorrect                             10
[ ] Joomla.Commenting.FunctionComment.Missing                            8
[x] Squiz.WhiteSpace.SuperfluousWhitespace.EndLine                       7
[x] Squiz.Commenting.BlockComment.WrongEnd                               7
[x] Joomla.ControlStructures.WhiteSpaceBefore.SpaceBefore                6
[x] PEAR.Functions.FunctionDeclaration.SpaceAfterFunction                6
[ ] Squiz.Commenting.BlockComment.CloserSameLine                         6
[ ] Joomla.Commenting.SingleComment.SameLine                             6
[x] Generic.ControlStructures.InlineControlStructure.NotAllowed          5
[x] Squiz.WhiteSpace.ControlStructureSpacing.NoLineAfterClose            5
[x] PEAR.Functions.FunctionCallSignature.SpaceBeforeOpenBracket          4
[ ] Joomla.Commenting.FunctionComment.MissingReturn                      4
[x] Squiz.Commenting.BlockComment.NoNewLine                              3
[x] PEAR.ControlStructures.MultiLineCondition.StartWithBoolean           2
[x] Joomla.Commenting.SingleComment.LowerCaseAfterSentenceEnd            2
[ ] Joomla.Commenting.FunctionComment.SpacingAfter                       2
[x] Joomla.ControlStructures.ControlStructuresBrackets.SpaceBeforeBrace  1
[x] PEAR.Functions.FunctionDeclaration.SpaceBeforeOpenParen              1
[x] Squiz.WhiteSpace.OperatorSpacing.SpacingAfter                        1