Coding Standard Issues

Created on 5 September 2024, 14 days ago
Updated 6 September 2024, 13 days ago

Problem/Motivation

Drupal Coding standards should be fixed.

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml config_ignore/

FILE: .../web/modules/custom/config_ignore/tests/src/Functional/ConfigWithTranslationTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
96 | ERROR | The array declaration extends to column 83 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/config_ignore/tests/src/Functional/ConfigIgnoreTest.php
--------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------
51 | ERROR | The array declaration extends to column 100 (the limit is 80). The array content should be split up over multiple lines
--------------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/config_ignore/tests/src/Kernel/IgnoreKernelTest.php
---------------------------------------------------------------------------------------------------------------------------------------
FOUND 10 ERRORS AFFECTING 6 LINES
---------------------------------------------------------------------------------------------------------------------------------------
287 | ERROR | The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
287 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
288 | ERROR | The array declaration extends to column 90 (the limit is 80). The array content should be split up over multiple lines
288 | ERROR | The array declaration extends to column 89 (the limit is 80). The array content should be split up over multiple lines
292 | ERROR | The array declaration extends to column 92 (the limit is 80). The array content should be split up over multiple lines
292 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
296 | ERROR | The array declaration extends to column 86 (the limit is 80). The array content should be split up over multiple lines
296 | ERROR | The array declaration extends to column 85 (the limit is 80). The array content should be split up over multiple lines
431 | ERROR | The array declaration extends to column 105 (the limit is 80). The array content should be split up over multiple lines
432 | ERROR | The array declaration extends to column 106 (the limit is 80). The array content should be split up over multiple lines
---------------------------------------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/config_ignore/tests/src/Kernel/IgnoreSchemaTest.php
---------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------
133 | ERROR | Type hint "array" missing for $config_data
---------------------------------------------------------------------------------------------------------

FILE: .../web/modules/custom/config_ignore/tests/src/Unit/ConfigIgnoreConfigTest.php
-------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------
44 | ERROR | The array declaration extends to column 81 (the limit is 80). The array content should be split up over multiple lines
-------------------------------------------------------------------------------------------------------------------------------------

Steps to reproduce

phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml config_ignore/

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

📌 Task
Status

Closed: works as designed

Version

3.0

Component

Code

Created by

🇵🇪Peru alyaj2a

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @alyaj2a
  • Merge request !39Coding Standard Issues - #3472360 → (Open) created by alyaj2a
  • Pipeline finished with Success
    14 days ago
    Total: 224s
    #274859
  • Status changed to Needs review 14 days ago
  • 🇵🇭Philippines pconcordia

    Hi,

    I'm new in the Drupal Community and I'd like to help with this issue. So please feel free to enlighten me if I said anything wrong

    After checking your Merge Request(merge request !39), I noticed that in the file tests/src/Kernel/IgnoreKernelTest.php(Line 301 & 310) it's still in '' => ['config_test.system' => ['foo' => 'New Foo', 'baz' => 'new baz']], which is not indented like the others.

  • Status changed to Closed: works as designed 13 days ago
  • 🇨🇭Switzerland bircher 🇨🇿

    We run phpcs in CI and it passes just fine.
    see https://git.drupalcode.org/project/config_ignore/-/jobs/2664453

    Also this particular rule makes the file less readable in this case. So the "fix" would be to ignore the rule for at least these files (and in particular the test files where the fixtures trip it)

Production build 0.71.5 2024