- Issue created by @sidharth_soman
- Issue was unassigned.
- Status changed to Needs review
almost 2 years ago 2:56pm 5 July 2023 - 🇮🇳India sidharth_soman Bangalore
I've fixed all the errors apart from those about filling out/editing documentation and variable naming conventions. Might be better to leave those out for the maintainers to change as seen fit.
Please review the MR
- Status changed to Needs work
8 months ago 9:17am 21 August 2024 - 🇵ðŸ‡Philippines cleavinjosh
Hi @sidhart_soman,
I applied MR!6, it was applied smoothly and fixed most of the phpcs issues.
These are the remaining issues after I ran
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
:➜ menu_position git:(8.x-1.x) curl https://git.drupalcode.org/project/menu_position/-/merge_requests/6.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 7884 0 7884 0 0 18144 0 --:--:-- --:--:-- --:--:-- 18124 patching file menu_position.install patching file src/Form/MenuPositionRuleForm.php patching file src/Form/MenuPositionRuleOrderForm.php patching file src/Form/MenuPositionSettings.php patching file src/Menu/MenuPositionActiveTrail.php patching file src/Plugin/Derivative/MenuPositionLink.php ➜ menu_position git:(8.x-1.x) ✗ .. ➜ contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig menu_position FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/CHANGELOG.txt ------------------------------------------------------------------------------------------------ FOUND 0 ERRORS AND 10 WARNINGS AFFECTING 10 LINES ------------------------------------------------------------------------------------------------ 7 | WARNING | Line exceeds 80 characters; contains 87 characters 11 | WARNING | Line exceeds 80 characters; contains 102 characters 17 | WARNING | Line exceeds 80 characters; contains 99 characters 28 | WARNING | Line exceeds 80 characters; contains 87 characters 36 | WARNING | Line exceeds 80 characters; contains 100 characters 38 | WARNING | Line exceeds 80 characters; contains 90 characters 40 | WARNING | Line exceeds 80 characters; contains 99 characters 41 | WARNING | Line exceeds 80 characters; contains 135 characters 42 | WARNING | Line exceeds 80 characters; contains 101 characters 43 | WARNING | Line exceeds 80 characters; contains 87 characters ------------------------------------------------------------------------------------------------ FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Form/MenuPositionRuleOrderForm.php -------------------------------------------------------------------------------------------------------------------------------------- FOUND 5 ERRORS AND 1 WARNING AFFECTING 5 LINES -------------------------------------------------------------------------------------------------------------------------------------- 12 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Menu\MenuLinkManagerInterface. 19 | WARNING | [ ] The class short comment should describe what the class does and not simply repeat the class name 34 | ERROR | [ ] Class property $menu_link_manager should use lowerCamel naming without underscores 41 | ERROR | [ ] Class property $route_builder should use lowerCamel naming without underscores 50 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 50 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line -------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Form/MenuPositionRuleForm.php --------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 9 ERRORS AND 2 WARNINGS AFFECTING 10 LINES --------------------------------------------------------------------------------------------------------------------------------------------------- 14 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Plugin\Context\ContextRepositoryInterface. 28 | ERROR | [ ] Class property $entity_type_manager should use lowerCamel naming without underscores 35 | ERROR | [ ] Class property $menu_parent_form_selector should use lowerCamel naming without underscores 42 | ERROR | [ ] Class property $menu_link_manager should use lowerCamel naming without underscores 49 | ERROR | [ ] Class property $condition_plugin_manager should use lowerCamel naming without underscores 56 | ERROR | [ ] Class property $context_repository should use lowerCamel naming without underscores 63 | ERROR | [ ] Class property $route_builder should use lowerCamel naming without underscores 90 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 90 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line 249 | WARNING | [ ] Unused variable $menu_name. 302 | WARNING | [ ] Unused variable $menu_link. --------------------------------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY --------------------------------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Form/MenuPositionSettings.php -------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 2 LINES -------------------------------------------------------------------------------------------------------------------- 23 | ERROR | [ ] Class property $route_builder should use lowerCamel naming without underscores 30 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter -------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Form/MenuPositionRuleDeleteForm.php -------------------------------------------------------------------------------------------------------------------------- FOUND 4 ERRORS AFFECTING 3 LINES -------------------------------------------------------------------------------------------------------------------------- 23 | ERROR | [ ] Class property $menu_link_manager should use lowerCamel naming without underscores 30 | ERROR | [ ] Class property $route_builder should use lowerCamel naming without underscores 45 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 45 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line -------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Entity/MenuPositionRule.php ------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ------------------------------------------------------------------------------------------------------------------- 271 | ERROR | Doc comment short description must be on a single line, further text should be a separate paragraph ------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Plugin/Derivative/MenuPositionLink.php ----------------------------------------------------------------------------------------------------------------------------- FOUND 1 ERROR AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------------- 33 | ERROR | Class property $config_factory should use lowerCamel naming without underscores ----------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Plugin/Menu/MenuPositionLink.php -------------------------------------------------------------------------------------------------------------------------- FOUND 12 ERRORS AFFECTING 10 LINES -------------------------------------------------------------------------------------------------------------------------- 96 | ERROR | [x] The first parameter of a multi-line function declaration must be on the line after the opening bracket 97 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 98 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 99 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 100 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30 101 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 102 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 103 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 30 104 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 105 | ERROR | [x] Multi-line function declaration not indented correctly; expected 4 spaces but found 2 105 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 105 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line -------------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 12 MARKED SNIFF VIOLATIONS AUTOMATICALLY -------------------------------------------------------------------------------------------------------------------------- FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/menu_position/src/Menu/MenuPositionActiveTrail.php ----------------------------------------------------------------------------------------------------------------------- FOUND 2 ERRORS AFFECTING 1 LINE ----------------------------------------------------------------------------------------------------------------------- 85 | ERROR | [x] Multi-line function declarations must have a trailing comma after the last parameter 85 | ERROR | [x] The closing parenthesis of a multi-line function declaration must be on a new line ----------------------------------------------------------------------------------------------------------------------- PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY ----------------------------------------------------------------------------------------------------------------------- Time: 433ms; Memory: 12MB ➜ contrib
Thank you.
- 🇵ðŸ‡Philippines cleavinjosh
Hi @dhruv.mittal,
Thank you for updating the MR. I applied MR!6, it was applied smoothly and fixed most of the phpcs issues.
These are the remaining issues after I ran
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml
:➜ menu_position git:(8.x-1.x) curl https://git.drupalcode.org/project/menu_position/-/merge_requests/6.diff | patch -p1 % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 30098 0 30098 0 0 69865 0 --:--:-- --:--:-- --:--:-- 69832 patching file CHANGELOG.txt patching file menu_position.install patching file src/Entity/MenuPositionRule.php patching file src/Form/MenuPositionRuleDeleteForm.php patching file src/Form/MenuPositionRuleForm.php patching file src/Form/MenuPositionRuleOrderForm.php patching file src/Form/MenuPositionSettings.php patching file src/Menu/MenuPositionActiveTrail.php patching file src/Plugin/Derivative/MenuPositionLink.php patching file src/Plugin/Menu/MenuPositionLink.php ➜ menu_position git:(8.x-1.x) ✗ .. ➜ contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml menu_position FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/menu_position/src/Form/MenuPositionRuleForm.php ------------------------------------------------------------------------------------------------------------------------------------------------- FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES ------------------------------------------------------------------------------------------------------------------------------------------------- 250 | WARNING | Unused variable $menu_name. 303 | WARNING | Unused variable $menu_link. ------------------------------------------------------------------------------------------------------------------------------------------------- Time: 520ms; Memory: 12MB ➜ contrib git:(main) ✗
Please check and advise.
Thank you. - 🇮🇳India akulsaxena
Hi @dhruv.mittal
Thank you for updating the MR. I applied MR!6, it was applied smoothly and fixed all of the phpcs issues.
Thank you
Moving it to RTBC+ - 🇮🇹Italy apaderno Brescia, 🇮🇹
Since GitLab CI is enabled for every project, that should be used to get the list of the PHP_CodeSniffer errors/warnings to fix.
- 🇮🇳India akulsaxena
The phpcs pipeline is passing and no errors/warnings were reported
Moving to RTBC+ - 🇮🇹Italy apaderno Brescia, 🇮🇹
People who change the code in the issue fork cannot change the status to Reviewed & tested by the community.
See my previous comment, to understand what it needs to be done. - First commit to issue fork.
- Merge request !12Created a new merge request to get the list of all the PHP_CodeSniffer errors/warnings to fix → (Open) created by apaderno
- 🇮🇹Italy apaderno Brescia, 🇮🇹
avpaderno → changed the visibility of the branch 3372605-gitlab-ci-reports to hidden.
- 🇮🇹Italy apaderno Brescia, 🇮🇹
The merge request changes 10 files, but the report is for nine files.
- Status changed to Needs review
3 months ago 11:51am 13 January 2025 - 🇵ðŸ‡Philippines roberttabigue
Hi @akulsaxena,
I reviewed the PHPCS in the GitLab CI pipeline and confirmed that the PHPCS errors no longer exist. Here is the link for reference: https://git.drupalcode.org/issue/menu_position-3372605/-/jobs/4005447."
unning with gitlab-runner 17.7.0 (3153ccc6) on gitlab-runner-564784654-4shlp s8ex1X2yJ, system ID: r_gVw7gScOvZha Resolving secrets Preparing the "kubernetes" executor 00:00 "CPURequest" overwritten with "2" Using Kubernetes namespace: gitlab-runner Using Kubernetes executor with image drupalci/php-8.3-ubuntu-apache:production ... Using attach strategy to execute scripts... Preparing environment 00:31 Using FF_USE_POD_ACTIVE_DEADLINE_SECONDS, the Pod activeDeadlineSeconds will be set to the job timeout: 1h0m0s... Waiting for pod gitlab-runner/runner-s8ex1x2yj-project-115373-concurrent-0-39yg0y93 to be running, status is Pending Running on runner-s8ex1x2yj-project-115373-concurrent-0-39yg0y93 via gitlab-runner-564784654-4shlp... Getting source from Git repository 00:01 Fetching changes... Initialized empty Git repository in /builds/issue/menu_position-3372605/.git/ Created fresh repository. Checking out e1946f76 as detached HEAD (ref is 3372605-fix-the-errorswarnings)... Skipping Git submodules setup Downloading artifacts 00:14 Downloading artifacts for composer (4002465)... Downloading artifacts from coordinator... ok host=drupal-gitlab-job-artifacts.s3.us-west-2.amazonaws.com id=4002465 responseStatus=200 OK token=glcbt-64 Executing "step_script" stage of the job script 00:01 $ test -f phpcs.xml.dist || curl -OL https://git.drupalcode.org/$_CURL_TEMPLATES_REPO/-/raw/$_CURL_TEMPLATES_REF/assets/phpcs.xml.dist % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 320 100 320 0 0 4749 0 --:--:-- --:--:-- --:--:-- 4776 $ vendor/bin/phpcs --version PHP_CodeSniffer version 3.11.2 (stable) by Squiz and PHPCSStandards $ composer show | awk '$0 ~ /codesniffer|coder|coding-standard|variable-analysis/ {print $1 " " $2}'; dealerdirect/phpcodesniffer-composer-installer 1.0.0 drupal/coder 8.3.27 sirbrillig/phpcs-variable-analysis 2.11.22 slevomat/coding-standard 8.15.0 squizlabs/php_codesniffer 3.11.2 $ vendor/bin/phpcs --config-show installed_paths Using config file: /builds/issue/menu_position-3372605/vendor/squizlabs/php_codesniffer/CodeSniffer.conf installed_paths: ../../drupal/coder/coder_sniffer,../../sirbrillig/phpcs-variable-analysis,../../slevomat/coding-standard $ vendor/bin/phpcs -i The installed coding standards are MySource, PEAR, PSR1, PSR2, PSR12, Squiz, Zend, Drupal, DrupalPractice, VariableAnalysis and SlevomatCodingStandard $ vendor/bin/phpcs -s $_WEB_ROOT/modules/custom --report-junit=junit.xml --report-full --report-summary --report-source $_PHPCS_EXTRA Uploading artifacts for successful job 00:02 Uploading artifacts... junit.xml: found 1 matching artifact files and directories Uploading artifacts as "archive" to coordinator... 201 Created id=4005447 responseStatus=201 Created token=glcbt-64 Uploading artifacts... junit.xml: found 1 matching artifact files and directories Uploading artifacts as "junit" to coordinator... 201 Created id=4005447 responseStatus=201 Created token=glcbt-64 Cleaning up project directory and file based variables 00:00 Job succeeded
I'm moving this now to ‘RTBC’.
Thank you!