Problem/Motivation

Fix phpcs errors for

  • Drupal.Files.LineLength

Command:

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/custom/pathauto/ --sniffs="Drupal.Files.LineLength"

Result:


FILE: tests/src/Functional/PathautoNodeWebTest.php
----------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
----------------------------------------------
 208 | WARNING | Line exceeds 80 characters; contains 92 characters
     |         | (Drupal.Files.LineLength.TooLong)
 225 | WARNING | Line exceeds 80 characters; contains 81 characters
     |         | (Drupal.Files.LineLength.TooLong)
----------------------------------------------


FILE: tests/src/Kernel/PathautoTokenTest.php
---------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------
 38 | WARNING | Line exceeds 80 characters; contains 81 characters
    |         | (Drupal.Files.LineLength.TooLong)
---------------------------------------------


FILE: tests/src/FunctionalJavascript/PathautoUiTest.php
----------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------
 107 | WARNING | Line exceeds 80 characters; contains 97 characters
     |         | (Drupal.Files.LineLength.TooLong)
----------------------------------------------


FILE: pathauto.module
---------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------
 16 | WARNING | Line exceeds 80 characters; contains 88 characters
    |         | (Drupal.Files.LineLength.TooLong)
---------------------------------------------


FILE: src/AliasUniquifier.php
----------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------
 105 | WARNING | Line exceeds 80 characters; contains 81 characters
     |         | (Drupal.Files.LineLength.TooLong)
----------------------------------------------


FILE: src/PathautoWidget.php
----------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------
 35 | WARNING | Line exceeds 80 characters; contains 149 characters
    |         | (Drupal.Files.LineLength.TooLong)
----------------------------------------------


FILE: src/AliasCleanerInterface.php
---------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
---------------------------------------------
 16 | WARNING | Line exceeds 80 characters; contains 81 characters
    |         | (Drupal.Files.LineLength.TooLong)
 55 | WARNING | Line exceeds 80 characters; contains 81 characters
    |         | (Drupal.Files.LineLength.TooLong)
---------------------------------------------


FILE: src/AliasUniquifierInterface.php
---------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
---------------------------------------------
 13 | WARNING | Line exceeds 80 characters; contains 81 characters
    |         | (Drupal.Files.LineLength.TooLong)
---------------------------------------------

Time: 1.13 secs; Memory: 8MB

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork pathauto-3411807

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

Nikolay Shapovalov created an issue. See original summary.

nikolay shapovalov’s picture

Status: Needs work » Needs review

MR is ready for review.

Used fix for src/PathautoWidget.php same as in #3411792: Fix phpcs Drupal.WhiteSpace, Squiz.WhiteSpace issues.

sidharth_soman’s picture

Probably should have

// Ensure that cleanTokenValues() does not alter this token value.

rather than

// Ensure that the cleanTokenValues() does not alter this token value.

in tests/src/Kernel/PathautoTokenTest.php. It looks better grammatically.

nikolay shapovalov’s picture

Update MR, add phpcs.xml file and exclude rules that will be fixed in different issues.
Gitlab CI check phpcs passed.

nikolay shapovalov’s picture

Removed changes from PathautoWidget.php because there is separate task #3418158: Remove leftover from src/PathautoWidget.php.

a.aaronjake’s picture

Status: Needs review » Needs work

Hi @Nikolay Shapovalov,

Your latest changes on MR66 was applied successfully, however one error still not fixed. Please see below:

pathauto git:(0f4b566) curl https://git.drupalcode.org/project/pathauto/-/merge_requests/66.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6204    0  6204    0     0  17368      0 --:--:-- --:--:-- --:--:-- 18034
patching file pathauto.module
patching file src/AliasCleanerInterface.php
patching file src/AliasUniquifier.php
patching file src/AliasUniquifierInterface.php
patching file tests/src/Functional/PathautoNodeWebTest.php
patching file tests/src/FunctionalJavascript/PathautoUiTest.php
patching file tests/src/Kernel/PathautoTokenTest.php
➜  web git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig modules/contrib/pathauto/ --sniffs="Drupal.Files.LineLength"

FILE: ...o-site/drupal-orgissue/web/modules/contrib/pathauto/src/PathautoWidget.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 35 | WARNING | Line exceeds 80 characters; contains 146 characters
--------------------------------------------------------------------------------

Time: 666ms; Memory: 12MB

Kindly check

Thanks,
Jake

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

santanu mondal’s picture

Assigned: Unassigned » santanu mondal
santanu mondal’s picture

Assigned: santanu mondal » Unassigned
Status: Needs work » Needs review
roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new507.21 KB
new77.63 KB

Hi,

I have applied the latest MR!66 to the Pathauto module with 8.x-1.x-dev and confirmed all PHPCS errors have been fixed.

I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig pathauto/ --sniffs="Drupal.Files.LineLength"

Please see the attached files for reference.

I'm moving this now to ‘RTBC’.

Thank you!

berdir’s picture

Status: Reviewed & tested by the community » Needs work

Reviewed.

This includes a lot more than just line length issues.

jerech’s picture

Status: Needs work » Needs review
roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new49.23 KB

Hi,

I have applied the latest MR!66 to the Pathauto module (8.x-1.x-dev) on my local Drupal setup, confirmed all PHPCS errors have been fixed.

I ran this command on the module:
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,info,txt,md,yml,twig pathauto/ --sniffs="Drupal.Files.LineLength"

Please see the attached file for reference.

I'm moving this now to "RTBC".

Thank you!

mably’s picture

Status: Reviewed & tested by the community » Fixed

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

mably’s picture

Status: Fixed » Closed (fixed)