Fix the issues reported by phpcs

Created on 26 May 2023, over 1 year ago
Updated 24 October 2023, about 1 year ago

Problem/Motivation

FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\config_inspector.drush.inc
-------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\config_inspector.install
-----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\config_inspector.module
----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\css\config_inspector.css
-----------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\src\Commands\InspectorCommands.php
---------------------------------------------------------------------------------------------------------------------------------------------
FOUND 11 ERRORS AND 2 WARNINGS AFFECTING 12 LINES
---------------------------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   8 | WARNING | [x] Unused use statement
 144 | ERROR   | [ ] The array declaration extends to column 105 (the limit is 80). The array content should be split up over multiple lines
 194 | ERROR   | [ ] The array declaration extends to column 112 (the limit is 80). The array content should be split up over multiple lines
 208 | WARNING | [ ] Line exceeds 80 characters; contains 91 characters
 220 | ERROR   | [x] Array indentation error, expected 14 spaces but found 15
 221 | ERROR   | [x] Array indentation error, expected 14 spaces but found 15
 223 | ERROR   | [x] Functions must not contain multiple empty lines in a row; found 2 empty lines
 260 | ERROR   | [x] Missing class doc comment
 262 | ERROR   | [x] Missing function doc comment
 269 | ERROR   | [x] Expected 1 blank line after function; 0 found
 270 | ERROR   | [x] The closing brace for the class must have an empty line before it
 270 | ERROR   | [ ] Closing class brace must be on a line by itself
---------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 9 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\src\ConfigInspectorManager.php
-----------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AND 3 WARNINGS AFFECTING 9 LINES
-----------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
   7 | WARNING | [x] Unused use statement
   8 | WARNING | [x] Unused use statement
  12 | WARNING | [x] Unused use statement
 147 | ERROR   | [x] There must be exactly one blank line before the tags in a doc comment
 149 | ERROR   | [ ] Parameter tags must be defined first in a doc comment
 281 | ERROR   | [x] There must be no blank lines after the function comment
 294 | ERROR   | [ ] Parameter $violations is not described in comment
 297 | ERROR   | [ ] Doc comment for parameter $list does not match actual variable name $violations
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\src\ConfigSchemaValidatability.php
---------------------------------------------------------------------------------------------------------------
FOUND 12 ERRORS AND 1 WARNING AFFECTING 13 LINES
---------------------------------------------------------------------------------------------------------------
  1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
  7 | ERROR   | [x] Missing class doc comment
  9 | ERROR   | [ ] Missing member variable doc comment
 10 | ERROR   | [ ] Missing member variable doc comment
 12 | ERROR   | [x] Missing function doc comment
 18 | WARNING | [ ] Line exceeds 80 characters; contains 81 characters
 34 | ERROR   | [x] Missing function doc comment
 38 | ERROR   | [x] Missing function doc comment
 49 | ERROR   | [x] Missing function doc comment
 53 | ERROR   | [x] Missing function doc comment
 57 | ERROR   | [x] Missing function doc comment
 61 | ERROR   | [x] Missing function doc comment
 65 | ERROR   | [x] Missing function doc comment
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 10 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\src\Controller\ConfigInspectorController.php
-------------------------------------------------------------------------------------------------------------------------
FOUND 4 ERRORS AND 1 WARNING AFFECTING 5 LINES
-------------------------------------------------------------------------------------------------------------------------
   1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
 202 | ERROR   | [x] Array indentation error, expected 12 spaces but found 14
 207 | ERROR   | [x] Array indentation error, expected 12 spaces but found 14
 265 | WARNING | [x] A comma should follow the last multiline array item. Found: 'config-inspector-tree'
 386 | ERROR   | [x] Array indentation error, expected 10 spaces but found 12
-------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\src\Form\ConfigInspectorItemForm.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\tests\src\Functional\ConfigInspectorUITest.php
---------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
---------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\tests\src\Functional\LoadTest.php
--------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
--------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------


FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\config_inspector\tests\src\Kernel\ConfigInspectorManagerTest.php
----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------------------------
 1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------------------------

Time: 3.37 secs; Memory: 8MB

Steps to reproduce

phpcs --standard=โ€œDrupal,DrupalPracticeโ€ --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,css,js .

๐Ÿ“Œ Task
Status

Fixed

Version

2.1

Component

Code

Created by

๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @sidharth_soman
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

    Working on this.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update over 1 year ago
    3 pass
  • @sidharth_soman opened merge request.
  • Issue was unassigned.
  • Status changed to Needs review over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sidharth_soman Bangalore

    I have raised an MR. The only errors remaining are those related to editing/filling out documentation comments.

  • Status changed to Needs work over 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡นItaly apaderno Brescia, ๐Ÿ‡ฎ๐Ÿ‡น

    The issue summary should always describe what the issue is trying to fix and, in the case, of coding standards issues, show which command and arguments have been used, and which report that command shown.

  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia imustakim Ahmedabad

    Issue summary updated.

  • First commit to issue fork.
  • Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    Not currently mergeable.
  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ต๐Ÿ‡ญPhilippines clarkssquared

    Hi,

    I tried to applied the updated MR !3 but It seems that the MR didn't apply properly please refer to the snippet of the output in my terminal.

    config_inspector git:(2.1.x) โœ— curl https://git.drupalcode.org/project/config_inspector/-/merge_requests/3.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100 12148    0 12148    0     0  21960      0 --:--:-- --:--:-- --:--:-- 22208
    Checking patch src/Commands/InspectorCommands.php...
    error: while searching for:
    use Consolidation\AnnotatedCommand\CommandResult;
    use Consolidation\OutputFormatters\StructuredData\MetadataInterface;
    use Consolidation\OutputFormatters\StructuredData\RowsOfFields;
    use Consolidation\OutputFormatters\StructuredData\UnstructuredListData;
    use Drupal\config_inspector\ConfigInspectorManager;
    use Drupal\config_inspector\ConfigSchemaValidatability;
    use Drupal\Core\Config\StorageInterface;
    
    error: patch failed: src/Commands/InspectorCommands.php:5
    error: src/Commands/InspectorCommands.php: patch does not apply
    Checking patch src/ConfigInspectorManager.php...
    error: while searching for:
    
    use Drupal\Core\Cache\CacheBackendInterface;
    use Drupal\Core\Config\ConfigFactoryInterface;
    use Drupal\Core\Config\Schema\Ignore;
    use Drupal\Core\Config\Schema\Undefined;
    use Drupal\Core\Config\TypedConfigManagerInterface;
    use Drupal\Core\Config\Schema\Element;
    use Drupal\Core\Config\Schema\SchemaCheckTrait;
    use Drupal\Core\TypedData\PrimitiveInterface;
    use Drupal\Core\TypedData\TraversableTypedDataInterface;
    use Drupal\Core\TypedData\Type\BooleanInterface;
    use Drupal\Core\TypedData\Type\DateTimeInterface;
    
    error: patch failed: src/ConfigInspectorManager.php:4
    error: src/ConfigInspectorManager.php: patch does not apply
    Checking patch src/ConfigSchemaValidatability.php...
    error: while searching for:
    
    namespace Drupal\config_inspector;
    
    final class ConfigSchemaValidatability {
    
      private $constraints = [];
      private $results = [];
    
      public function __construct(string $property_path, array $constraints) {
        $this->constraints[$property_path] = $constraints;
        $this->results[$property_path] = !empty($constraints);
      }
    
      /**
       * Merges other validatability; not necessarily of the same root property path.
       *
       * @param self $other
       *   Another validatability.
    
    error: patch failed: src/ConfigSchemaValidatability.php:4
    error: src/ConfigSchemaValidatability.php: patch does not apply
    Checking patch src/Controller/ConfigInspectorController.php...
    Hunk #3 succeeded at 198 (offset -1 lines).
    Hunk #4 succeeded at 261 (offset -1 lines).
    Hunk #5 succeeded at 388 (offset 5 lines).
    โžœ  config_inspector git:(2.1.x) โœ— 
    
  • First commit to issue fork.
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    1 pass, 4 fail
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia sakthi_dev

    Rebased and fixed the remaining issues. Please review.

  • Status changed to Needs review about 1 year ago
  • ๐Ÿ‡ฎ๐Ÿ‡ณIndia aayushDrupal

    Hi,
    Merge request !3 has resolved all the phpcs errors and everything seems fine to me . A screenshot is attached for reference.


    Moving to RTBC.
    Thanks

  • Status changed to RTBC about 1 year ago
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Thanks for doing this!

    But โ€ฆ 4 tests are failing ๐Ÿ˜… So, not quite working fine just yet.

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    1 pass, 4 fail
  • Status changed to Needs review about 1 year ago
  • Assigned to wim leers
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    Just merged ๐Ÿ“Œ Adopt GitLab CI Fixed , which will allow us to ensure to never regress against this again ๐Ÿ˜…

    Thanks for the work here, everyone! Now reviewingโ€ฆ

  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    1 pass, 4 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    1 pass, 4 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    1 pass, 4 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    2 pass, 2 fail
  • Status changed to Needs work about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ

    I wanted to say "thanks", but it's hard to do so in this case, because this was done very poorly. It's literally breaking code, and it's removing parameters.

    Therefore I'm not crediting:

    1. @sidharth_soman (for breaking code by literally deleting it ๐Ÿคฏ, thus me having to re-check everything โ€” not what I'd expect from somebody with even the most basic experience)
    2. @sakthi_dev (for not correctly realigning to 80 columns width and adding useless comments, thus me having to re-do all that)
    3. @shiv_yadav (for not correctly realigning to 80 columns width and adding useless comments, thus me having to re-do all that)
    4. @aayushmankotia (for RTBC'ing an issue at #14 that is literally no longer passing tests and uploading a useless screenshot of a patch applying)

    To all of you: please read https://www.drupal.org/drupalorg/blog/ensuring-a-fair-drupal-contributio... โ†’ ๐Ÿ™ This was clear gaming behavior.

    I am crediting:

    1. @apaderno for asking for clarifications in #5
    2. @clarkssquared for correctly pointing out bugs in the MR at #10
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    2 pass, 2 fail
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    3 pass
  • Issue was unassigned.
  • Status changed to RTBC about 1 year ago
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Open in Jenkins โ†’ Open on Drupal.org โ†’
    Core: 9.5.x + Environment: PHP 7.4 & MySQL 5.7
    last update about 1 year ago
    3 pass
  • ๐Ÿ‡ง๐Ÿ‡ชBelgium wim leers Ghent ๐Ÿ‡ง๐Ÿ‡ช๐Ÿ‡ช๐Ÿ‡บ
  • Status changed to Fixed about 1 year ago
  • Automatically closed - issue fixed for 2 weeks with no activity.

Production build 0.71.5 2024