- Issue created by @bluegeek9
- π³π±Netherlands johnv
Yeah, I know, do not try to resolve them.
Ther are stupid rules:
- max 80 char per line
- no empty line after inline comments
- no inline comments after a code line.
- code in inline comments is regardes as text.Unless you can tell me a way to exclude such nonsense from the phpcs jobs, i will leave it this way.
Thanks, anyway
- πΊπΈUnited States bluegeek9
bluegeek9 β changed the visibility of the branch 8.x-1.x to hidden.
- πΊπΈUnited States bluegeek9
code in inline comments is regarded as text.
I am not sure about that one. I think code might need to be in multi line comments.
I add a phpcs.xml.dist to handle:
- max 80 char per line
- no empty line after inline comments
- no inline comments after a code line. - π³π±Netherlands johnv
wow, what a relief. The below difference may not seem so much, but it will make a big difference on my other modules, too.
I now will add other errors at some other time, if needed. Thanks.before: https://git.drupalcode.org/project/office_hours/-/jobs/6276228
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY ----------------------------------------------------------------------- SOURCE COUNT ----------------------------------------------------------------------- [x] Drupal.WhiteSpace.ScopeIndent.IncorrectExact 30 [x] Drupal.Commenting.PostStatementComment.Found 14 [ ] Drupal.Semantics.FunctionT.NotLiteralString 12 [ ] Drupal.Files.LineLength.TooLong 11 [x] Drupal.Commenting.InlineComment.InvalidEndChar 9 [x] Drupal.Classes.UnusedUseStatement.UnusedUse 8 [ ] Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps 8 [x] Drupal.Commenting.InlineComment.NotCapital 7 [ ] Generic.CodeAnalysis.UselessOverridingMethod.Found 6 [x] Drupal.Commenting.InlineComment.SpacingAfter 5 [ ] Drupal.Semantics.FunctionT.ConcatString 4 [ ] Drupal.Commenting.DocComment.MissingShort 3 [ ] Drupal.Commenting.FunctionComment.ParamMissingDefinition 2 [x] Drupal.Commenting.FunctionComment.SeePunctuation 2 [x] Drupal.Classes.ClassDeclaration.CloseBraceAfterBody 1 [ ] Drupal.Commenting.DocComment.ParamGroup 1 [ ] Drupal.Commenting.FunctionComment.MissingReturnComment 1 [ ] Drupal.Commenting.FunctionComment.ParamNameNoMatch 1 [x] Drupal.Commenting.FunctionComment.ReturnVarName 1 [x] Drupal.Commenting.InlineComment.NoSpaceBefore 1 [x] Drupal.Commenting.InlineComment.SpacingBefore 1 [x] Drupal.Commenting.VariableComment.IncorrectVarType 1 [x] Squiz.WhiteSpace.FunctionSpacing.AfterLast 1 [x] Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore 1 ----------------------------------------------------------------------- A TOTAL OF 131 SNIFF VIOLATIONS WERE FOUND IN 24 SOURCES
After: https://git.drupalcode.org/project/office_hours/-/jobs/6277048
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY ----------------------------------------------------------------------- SOURCE COUNT ----------------------------------------------------------------------- [x] Drupal.WhiteSpace.ScopeIndent.IncorrectExact 30 [ ] Drupal.Semantics.FunctionT.NotLiteralString 12 [x] Drupal.Commenting.InlineComment.InvalidEndChar 9 [x] Drupal.Classes.UnusedUseStatement.UnusedUse 8 [ ] Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps 8 [x] Drupal.Commenting.InlineComment.NotCapital 7 [ ] Generic.CodeAnalysis.UselessOverridingMethod.Found 6 [ ] Drupal.Semantics.FunctionT.ConcatString 4 [ ] Drupal.Commenting.DocComment.MissingShort 3 [ ] Drupal.Commenting.FunctionComment.ParamMissingDefinition 2 [x] Drupal.Commenting.FunctionComment.SeePunctuation 2 [x] Drupal.Classes.ClassDeclaration.CloseBraceAfterBody 1 [ ] Drupal.Commenting.DocComment.ParamGroup 1 [ ] Drupal.Commenting.FunctionComment.MissingReturnComment 1 [ ] Drupal.Commenting.FunctionComment.ParamNameNoMatch 1 [x] Drupal.Commenting.FunctionComment.ReturnVarName 1 [x] Drupal.Commenting.InlineComment.NoSpaceBefore 1 [x] Drupal.Commenting.InlineComment.SpacingBefore 1 [x] Drupal.Commenting.VariableComment.IncorrectVarType 1 [x] Squiz.WhiteSpace.FunctionSpacing.AfterLast 1 [x] Squiz.WhiteSpace.OperatorSpacing.NoSpaceBefore 1 ----------------------------------------------------------------------- A TOTAL OF 101 SNIFF VIOLATIONS WERE FOUND IN 21 SOURCES
- πΊπΈUnited States bluegeek9
I addressed obvious items reported by phpcs.
I left commented code alone.
Some of the Hooks have non camel casing. I can fix it but wasn't sure if the change will be welcomed.
Public method name "OfficeHoursThemeHooks::preprocess_field" is not in lowerCamel format
| | (Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps) - π³π±Netherlands johnv
"Some of the Hooks have non camel casing. I can fix it but wasn't sure if the change will be welcomed."
Fixing that would be nice. Thank you.I really appreciate your efforts. I can learn from that and build upon it!
- πΊπΈUnited States bluegeek9
bluegeek9 β changed the visibility of the branch 3542418-phpcs-xml-dist to hidden.
- πΊπΈUnited States bluegeek9
I fixed Drupal.NamingConventions.ValidFunctionName.ScopeNotCamelCaps and added a unit test form the office_hours.module file.
- π³π±Netherlands johnv
Thanks, committed. Let us await the jobs.
You are fast, I assume you have some tool?