CommentFileSizeAuthor
#17 phpcs-fixed.png41.71 KBroberttabigue

Issue fork gmv-3358798

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

himanshu_jhaloya created an issue. See original summary.

himanshu_jhaloya’s picture

Assigned: himanshu_jhaloya » Unassigned
Status: Active » Needs review
avpaderno’s picture

Priority: Normal » Minor
Issue tags: -Fix the issues reported by phpcs +Coding standards
cleavinjosh’s picture

Status: Needs review » Needs work

Hi @himanshu_jhaloya,

I applied MR!1 and it was applied smoothly. However, I still encountered some issues after I ran phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml.

➜  gmv git:(1.0.x) curl https://git.drupalcode.org/project/gmv/-/merge_requests/1.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 11829    0 11829    0     0  27115      0 --:--:-- --:--:-- --:--:-- 27130
patching file README.md
patching file gmv.info.yml
patching file gmv.libraries.yml
patching file gmv.module
patching file src/Plugin/Field/FieldFormatter/ThreeDeeObjectFieldFormatter.php
patching file src/Plugin/Field/FieldType/ThreeDeeObject.php
patching file src/Plugin/Field/FieldWidget/ThreeDeeObjectWidget.php
➜  gmv git:(1.0.x) ✗ ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml gmv

FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/gmv/src/Plugin/Field/FieldType/ThreeDeeObject.php
-----------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Form\FormStateInterface.
-----------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------


FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/gmv/src/Plugin/Field/FieldFormatter/ThreeDeeObjectFieldFormatter.php
-----------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------------------------------
 8 | ERROR | [x] Use statements should be sorted alphabetically. The first wrong one is Drupal\Core\Entity\EntityTypeManagerInterface.
-----------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------

Time: 174ms; Memory: 10MB

➜  contrib git:(main) ✗

avpaderno’s picture

There are still two PHP_CodeSniffer errors to fix.

FILE: ...b/modules/custom/gmv-3358798/src/Plugin/Field/FieldType/ThreeDeeObject.php
-------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------
 8 | Use statements should be sorted alphabetically. The first
   | wrong one is Drupal\Core\Form\FormStateInterface.
   | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------
FILE: ...v-3358798/src/Plugin/Field/FieldFormatter/ThreeDeeObjectFieldFormatter.php
-------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------
 8 | Use statements should be sorted alphabetically. The first
   | wrong one is Drupal\Core\Entity\EntityTypeManagerInterface.
   | (SlevomatCodingStandard.Namespaces.AlphabeticallySortedUses.IncorrectlyOrderedUses)
-------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------
Time: 166ms; Memory: 6MB

 

avpaderno’s picture

Issue summary: View changes
Status: Needs work » Needs review
avpaderno’s picture

Version: 1.0.0-beta1 » 1.0.x-dev
avpaderno’s picture

amanbtr72’s picture

Assigned: Unassigned » amanbtr72
Status: Needs review » Needs work

Reviewed the MR 3 Still found some errors

$ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml .

FILE: D:\wamp64\www\drupal10\modules\custom\doissues\gmv-3358798\gmv.module
--------------------------------------------------------------------------------
FOUND 5 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
3 | ERROR | Missing short description in doc comment
10 | ERROR | Doc comment short description must end with a full stop
12 | ERROR | The array declaration extends to column 150 (the limit is 120).
| | The array content should be split up over multiple lines
12 | ERROR | The array declaration extends to column 149 (the limit is 120).
| | The array content should be split up over multiple lines
12 | ERROR | The array declaration extends to column 148 (the limit is 120).
| | The array content should be split up over multiple lines
--------------------------------------------------------------------------------

FILE: D:\wamp64\www\drupal10\modules\custom\doissues\gmv-3358798\README.md
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 3 LINES
--------------------------------------------------------------------------
3 | WARNING | Line exceeds 80 characters; contains 87 characters
4 | WARNING | Line exceeds 80 characters; contains 107 characters
7 | WARNING | Line exceeds 80 characters; contains 132 characters
--------------------------------------------------------------------------

FILE: ...v-3358798\src\Plugin\Field\FieldFormatter\ThreeDeeObjectFieldFormatter.php
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
62 | WARNING | File::load calls should be avoided in classes, use dependency
| | injection instead
67 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
72 | WARNING | File::load calls should be avoided in classes, use dependency
| | injection instead
73 | WARNING | \Drupal calls should be avoided in classes, use dependency
| | injection instead
--------------------------------------------------------------------------------

Time: 852ms; Memory: 12MB

amanbtr72’s picture

Assigned: amanbtr72 » Unassigned
Status: Needs work » Needs review

fixed remaining issues

bhaveshdas’s picture

Status: Needs review » Needs work

I applied MR!3 and I still encountered some issues after I ran vendor/bin/phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig modules/custom/gmv-3358798/

FILE: /var/www/html/drupal-contri-d10/modules/custom/gmv-3358798/gmv.module
---------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------
 10 | ERROR | [x] There must be no blank lines after the function comment
 14 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
 28 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
---------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------

Time: 138ms; Memory: 10MB
bhaveshdas’s picture

Status: Needs work » Needs review

I have fixed remaining issues on this 9be7c077 ticket could you please review it.

Thankyou !

avpaderno’s picture

The MR to review was MR !1, which already fixed all the issues. MR !3 has been used to obtain a list of all the issues that were to be fixed.

apaderno changed the visibility of the branch 3358798-gitlab-ci-reports to hidden.

roberttabigue’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new41.71 KB

Hi @everyone!

I have applied the latest fixes to the Google Module Viewer module against 1.0.x-dev on Drupal 10 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,css,info,txt,md,yml gmv/

Please see the attached file for reference.

I'm moving this now to ‘RTBC’.

Thank you!

harivenuv’s picture

Status: Reviewed & tested by the community » Fixed

Thanks you for the effort

Status: Fixed » Closed (fixed)

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