Problem/Motivation

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.

Steps to reproduce

Review a Gitlab pipeline and check the PHPCS result, such as this one: https://git.drupalcode.org/project/smart_date/-/jobs/1251055

Proposed resolution

Focus on the following error tyoes:

  • Drupal.Files.LineLength.TooLong
  • Drupal.Arrays.Array.ArrayIndentation
  • Squiz.WhiteSpace.SuperfluousWhitespace.EndLine
  • Drupal.Commenting.DocComment.SpacingBeforeTags
  • Drupal.WhiteSpace.OpenTagNewline.BlankLine

Remaining tasks

Fix the above errors.

User interface changes

N/A

API changes

N/A

Data model changes

N/A

Issue fork smart_date-3439011

Command icon 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:

Comments

lostcarpark created an issue. See original summary.

lostcarpark’s picture

Status: Active » Needs review

Fixed 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.

mandclu made their first commit to this issue’s fork.

  • mandclu committed 9db9d967 on 4.1.x authored by lostcarpark
    Issue #3439011 by lostcarpark: GitLab CI - PHPCS - Long lines and...
mandclu’s picture

Status: Needs review » Fixed

Thanks 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.