Closed (fixed)
Project:
Smart Date
Version:
4.1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
6 Apr 2024 at 00:14 UTC
Updated:
20 Apr 2024 at 10:14 UTC
Jump to comment: Most recent
Latest PHPCS error list is much improved. The summary is:
PHP CODE SNIFFER VIOLATION SOURCE SUMMARY
--------------------------------------------------------------------------------
SOURCE COUNT
--------------------------------------------------------------------------------
[ ] Drupal.Files.LineLength.TooLong 7
[x] Drupal.Commenting.TodoComment.TodoFormat 6
[x] Drupal.Classes.UnusedUseStatement.UnusedUse 5
[x] SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.Incorrectl 5
[x] Drupal.Arrays.Array.ArrayIndentation 3
[x] Drupal.Commenting.DataTypeNamespace.DataTypeNamespace 3
[x] Drupal.Commenting.FunctionComment.Missing 3
[ ] Drupal.NamingConventions.ValidVariableName.LowerCamelName 3
[x] SlevomatCodingStandard.ControlStructures.RequireNullCoalesceOperator. 3
[x] SlevomatCodingStandard.PHP.ShortList.LongListUsed 2
[x] Squiz.WhiteSpace.SuperfluousWhitespace.EndLine 2
[x] Drupal.Arrays.Array.ArrayClosingIndentation 1
[x] Drupal.Commenting.ClassComment.Missing 1
[x] Drupal.Commenting.DocComment.SpacingBeforeTags 1
[ ] Drupal.Commenting.FunctionComment.MissingParamType 1
[x] Drupal.Commenting.InlineComment.NotCapital 1
[x] Drupal.Commenting.PostStatementComment.Found 1
[ ] Drupal.Commenting.VariableComment.Missing 1
[ ] Drupal.Semantics.FunctionT.NotLiteralString 1
[x] Drupal.WhiteSpace.OpenTagNewline.BlankLine 1
[ ] Generic.CodeAnalysis.UselessOverridingMethod.Found 1
[x] SlevomatCodingStandard.TypeHints.DeclareStrictTypes.IncorrectStrictTy 1
--------------------------------------------------------------------------------
A TOTAL OF 53 SNIFF VIOLATIONS WERE FOUND IN 22 SOURCES
--------------------------------------------------------------------------------
The most common error relates to long lines, but there are also some whitespace errors, so I think they can be dealt with together.
Review a Gitlab pipeline and check the PHPCS result, such as this one: https://git.drupalcode.org/project/smart_date/-/jobs/1251055
Focus on the following error tyoes:
Fix the above errors.
N/A
N/A
N/A
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:
Comments
Comment #3
lostcarpark commentedFixed long line and whitespace issues.
Most of the changes are fairly self explanatory, except possibly the removal of a line of commented out code from
src/Plugin/views/argument/Date.php.I checked
git blame, and it reported the line was commented in 2022, so at present it seems unnecessary.Comment #6
mandclu commentedThanks for filing this @lostcarpark. Having reviewed the commented line of code, I believe that ultimately the token support was added as a separate argument default class, so it is fine to remove. It does also highlight that the Date Token should be removed from the argument schema file, so I have filed #3439022: Remove "Token" from the argument schema for that work.