There are 268 sniff violations reported in 41 sources by phpcs.
phpcs --standard=Drupal,DrupalPractice --extensions=php,inc,module,install,info,test,profile,theme modules/contrib/token/
Report:
https://git.drupalcode.org/project/token/-/jobs/668566
To get lastest phpcs report check https://git.drupalcode.org/project/token/-/pipelines
List of violation by rules
Drupal.Arrays.Array.ArrayClosingIndentation 1
Drupal.Arrays.Array.ArrayIndentation 14
Drupal.Arrays.Array.CommaLastItem 8
Drupal.Arrays.Array.LongLineDeclaration 12
Drupal.Arrays.DisallowLongArraySyntax.Found 1
Drupal.Classes.ClassDeclaration.CloseBraceAfterBody 15
Drupal.Classes.UnusedUseStatement.UnusedUse 1
Drupal.Commenting.ClassComment.Missing 6
Drupal.Commenting.DocComment.MissingShort 17
Drupal.Commenting.DocComment.ShortSingleLine 2
Drupal.Commenting.DocComment.TagGroupSpacing 1
Drupal.Commenting.FileComment.Missing 1
Drupal.Commenting.FileComment.SpacingAfterComment 1
Drupal.Commenting.FunctionComment.Missing 33
Drupal.Commenting.FunctionComment.MissingParamComment 1
Drupal.Commenting.FunctionComment.MissingParamType 7
Drupal.Commenting.FunctionComment.MissingReturnType 1
Drupal.Commenting.FunctionComment.ParamCommentIndentation 1
Drupal.Commenting.FunctionComment.ReturnCommentIndentation 1
Drupal.Commenting.FunctionComment.WrongStyle 1
Drupal.Commenting.HookComment.HookCommentFormat 3
Drupal.Commenting.InlineComment.InvalidEndChar 13
Drupal.Commenting.InlineComment.NoSpaceBefore 4
Drupal.Commenting.InlineComment.NotCapital 1
Drupal.Commenting.InlineComment.SpacingAfter 3
Drupal.Commenting.InlineComment.SpacingBefore 11
Drupal.Commenting.InlineVariableComment.VarInline 9
Drupal.Commenting.VariableComment.Missing 3
Drupal.Files.LineLength.TooLong 7
Drupal.NamingConventions.ValidFunctionName.NotCamelCaps 1
Drupal.NamingConventions.ValidVariableName.LowerCamelName 2
Drupal.Scope.MethodScope.Missing 33
Drupal.Semantics.FunctionT.BackslashSingleQuote 1
Drupal.WhiteSpace.ScopeIndent.IncorrectExact 5
DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter 3
Generic.PHP.UpperCaseConstant.Found 2
PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse 1
SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator. 12
SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl 11
SlevomatCodingStandard.PHP.ShortList.LongListUsed 2
Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak 4
Squiz.WhiteSpace.FunctionSpacing.AfterLast 15
Squiz.WhiteSpace.FunctionSpacing.Before 1
Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines 1
Fix rules by MR.
- SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses
- Drupal.Classes.ClassDeclaration.CloseBraceAfterBody
- Drupal.Classes.UnusedUseStatement.UnusedUse
- PSR2.Namespaces.UseDeclaration.SpaceAfterLastUse
- SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator.NullCoalesceOperatorNotUsed
- Drupal.Arrays.Array.ArrayClosingIndentation
- Drupal.Arrays.Array.ArrayIndentation
- Drupal.Arrays.Array.CommaLastItem
- Drupal.Arrays.Array.LongLineDeclaration
- SlevomatCodingStandard.PHP.ShortList.LongListUsed
- Drupal.Scope.MethodScope.Missing
- Drupal.NamingConventions.ValidFunctionName.NotCamelCaps
- Drupal.Commenting.ClassComment.Missing
- Drupal.Commenting.DocComment.MissingShort
- Drupal.Commenting.DocComment.ShortSingleLine
- Drupal.Commenting.DocComment.TagGroupSpacing
- Drupal.Commenting.FileComment.Missing
- Drupal.Commenting.FileComment.SpacingAfterComment
- Drupal.Commenting.FunctionComment.Missing
- Drupal.Commenting.FunctionComment.MissingParamComment
- Drupal.Commenting.FunctionComment.MissingParamType
- Drupal.Commenting.FunctionComment.MissingReturnType
- Drupal.Commenting.FunctionComment.ParamCommentIndentation
- Drupal.Commenting.FunctionComment.ReturnCommentIndentation
- Drupal.Commenting.FunctionComment.WrongStyle
- Drupal.Commenting.HookComment.HookCommentFormat
- Drupal.Commenting.InlineComment.InvalidEndChar
- Drupal.Commenting.InlineComment.NoSpaceBefore
- Drupal.Commenting.InlineComment.NotCapital
- Drupal.Commenting.InlineComment.SpacingAfter
- Drupal.Commenting.InlineComment.SpacingBefore
- Drupal.Commenting.InlineVariableComment.VarInline
- Drupal.Commenting.VariableComment.Missing
- Drupal.Files.LineLength.TooLong
- DrupalPractice.Commenting.CommentEmptyLine.SpacingAfter
- Squiz.ControlStructures.SwitchDeclaration.SpacingAfterBreak
- Squiz.WhiteSpace.FunctionSpacing.AfterLast
- Squiz.WhiteSpace.FunctionSpacing.Before
- Squiz.WhiteSpace.SuperfluousWhitespace.EmptyLines
- Drupal.NamingConventions.ValidVariableName.LowerCamelName
- Drupal.Semantics.FunctionT.BackslashSingleQuote
- Generic.PHP.UpperCaseConstant.Found
Note.
Branch 2774071-fix-cs-base-branch used as base branch for all the MRs. This will add phpcs.xml file, and disable allow-faillure on phpcs check on Gitlab CI.
Comment | File | Size | Author |
---|
Issue fork token-2774071
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 2774071-left-violations changes, plain diff MR !65
- 2774071-fix-comments changes, plain diff MR !58
- 2774071-use-fix-empty-line-fix changes, plain diff MR !54
- 2774071-fix-cs-squiz changes, plain diff MR !64
- 2774071-null-coalesce changes, plain diff MR !55
- 2774071-comments-switch changes, plain diff MR !56
- 2774071-visibility-array-indention changes, plain diff MR !57
- 2774071-fix-cs-base-branch compare
- 2774071-fix-coding-standard changes, plain diff MR !53
Comments
Comment #2
vinod_kc CreditAttribution: vinod_kc at Zyxware Technologies commentedAs there are lot of coding standard issues, fix can be done in separate patches. Adding my first patch.
Comment #3
hussainwebTypo
"in any" can go on the previous line.
Typo.
The description isn't really useful.
This is no longer encouraged. Core has removed @file everywhere.
"important" can go above.
Comment #4
rajeshwari10 CreditAttribution: rajeshwari10 as a volunteer and at Blisstering Solutions commentedComment #5
rajeshwari10 CreditAttribution: rajeshwari10 as a volunteer and at Blisstering Solutions commentedComment #6
cmsMinds CreditAttribution: cmsMinds as a volunteer commentedPlease do check coding standards issues.
Comment #7
Yago Elias CreditAttribution: Yago Elias as a volunteer and at CI&T commentedHI! I couldn't apply patch #2 .
used : phpcs --standard=Drupal --extensions='php,module,inc,install,test,profile,theme,css,info,txt,md'
and then passed phpcbf.
Here is what i have until now.
Comment #8
MatroskeenComment #9
amarphule CreditAttribution: amarphule at DevsAdda for DevsAdda commentedComment #10
amarphule CreditAttribution: amarphule at DevsAdda for DevsAdda commentedFixed all module code as Drupal standard coding, Still one warning message is in
modules/token/css/token.treetable.theme.css
.
Comment #12
purvitagupta CreditAttribution: purvitagupta commentedHi, here is the updated patch for module code as Drupal standard coding.
Comment #13
BerdirComment #14
BerdirThere is a syntax error in that patch.
Comment #15
ravi.shankar CreditAttribution: ravi.shankar at OpenSense Labs commentedI have fixed.
Comment #16
urvashi_vora CreditAttribution: urvashi_vora at Valuebound for Valuebound commentedHi @ravi
Patch #15 works fine.
Comment #17
Christopher Riley CreditAttribution: Christopher Riley commentedThis patch does not apply to 8.x-1.11 so were all of the issues addressed?
Comment #18
BerdirLike I said in #2933031: Drupal best practices and coding standards:
Coding standard improvements must be provided as merge requests now, so that we can verify it using GitlabCI.
Additionally, this is way too big as a single patch and overlaps with many other issues. This is impossible to review and needs to be split up into issues for specific changes or groups of related changes.
Comment #22
sakthi_dev CreditAttribution: sakthi_dev at Specbee for Drupal India Association commentedUpdated Issue Summary and also created a MR 53. Please review. Still minified css error is there.
Comment #25
Nikolay ShapovalovAs requested by @Berdir I will create several smaller MRs, not sure if each MR should have separate issue.
First one https://git.drupalcode.org/project/token/-/merge_requests/54 is ready for review.
Comment #28
Nikolay ShapovalovMRs are ready for review:
Comment #30
Nikolay ShapovalovMR 57 is ready for review.
Comment #33
Nikolay ShapovalovMRs are ready for review:
Comment #34
Nikolay ShapovalovComment #35
Nikolay ShapovalovComment #36
apadernoComment #40
Nikolay ShapovalovI create branch 2774071-fix-cs-base-branch with phpcs.xml file and exclude all the rules that has any violation. Also gitlab ci should fail when there is phpcs found.
I rebased all existing MRs on this branch, and remove rules from phpcs that exists in this branch.
My suggestion to Merge base 2774071-fix-cs-base-branch to 8.x-1.x, in that case MR diff will be more transperent, right now it's impossible to see what rules will be fixed in the MR. But I add rules to MR description.
At the moment there are violations that still need to be fixed:
Todo: add list of all violations name with the link to the MR that will fix it.
Comment #41
Nikolay ShapovalovComment #42
Nikolay ShapovalovComment #43
Nikolay ShapovalovComment #44
Nikolay ShapovalovComment #46
Nikolay ShapovalovCreated MR 65, now all MRs ready for review.
Comment #47
Nikolay ShapovalovComment #48
Nikolay ShapovalovComment #49
BerdirNot sure what to do with this.
Each of those MR's will conflict as they all change the phpcs and gitlab config.
I'd rather not change those files, including the allow fail. I'd rather rely on the code quality difference, which gitlabCI I think is still working on properly supporting. Then we can see if the situation gets worse or improves in a MR.
drupal.org issues are also not well suited to merge multiple merge requests per issue. We should either split them into separate issues or combine it.