Problem/Motivation

FILE: ...al_11_test/install-dir/drupal_11_test_site/web/modules/contrib/fireworksai/modules/ai_interpolator_fireworks/src/Plugin/AiInterpolatorFieldRules/FireworksaiEntityReference.php
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
27 | ERROR | [x] The closing brace for the class must have an empty line before it
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/fireworksai/src/Plugin/AiProvider/FireworksProvider.php
---------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 4 LINES
---------------------------------------------------------------------------------------------------------------------------------------------------------
254 | ERROR | [ ] Parameter $capabilities is not described in comment
256 | ERROR | [ ] Doc comment short description must end with a full stop
256 | ERROR | [ ] Doc comment short description must be on a single line, further text should be a separate paragraph
257 | ERROR | [x] There must be exactly one blank line before the tags in a doc comment
269 | ERROR | [x] No space found before comment text; expected "// return $cache_data->data;" but found "//return $cache_data->data;"
269 | ERROR | [x] Inline comments must start with a capital letter
269 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
---------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /Users/interns/Demo-site/drupal_11_test/install-dir/drupal_11_test_site/web/modules/contrib/fireworksai/src/FireworksaiApi.php
------------------------------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------------------------------------------------------
7 | WARNING | [x] Unused use statement
------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------------

Time: 1.84 secs; Memory: 12MB

Steps to reproduce

Run the phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml command to get the drupal coding standard issues.

Proposed resolution

Many of the issues can be fixed by running the phpcbf command. For the remaining ones, we will need to manually address and then commit these changes before pushing them.

CommentFileSizeAuthor
#4 fixed-phpcs.png41.44 KBsarwan_verma
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

sunil jolapara created an issue. See original summary.

sunil jolapara’s picture

Status: Needs work » Needs review
sarwan_verma’s picture

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

Hi,

I have tested MR!1 for the PHP_CodeSniffer issue, and it is working fine. I have also attached a screenshot and moved it to RTBC++.

Thanks!

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

The issue summary for PHP_CodeSniffer issues should always show the report given from PHP_CodeSniffer and the arguments passed to phpcs.

Furthermore, since GitLab CI is now enabled for all the projects, GitLab CI should be used to get PHP_CodeSniffer errors/warnings.

cleavinjosh’s picture

Assigned: » cleavinjosh
cleavinjosh’s picture

Issue summary: View changes
Issue tags: -Needs issue summary update
cleavinjosh’s picture

Status: Needs work » Needs review
cleavinjosh’s picture

Hi @sunil jolapara,

Thank you for providing an MR. I applied MR!1, it was applied smoothly and fixed all the phpcs issues.

➜  fireworksai git:(1.0.x) curl https://git.drupalcode.org/project/fireworksai/-/merge_requests/1.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  2183    0  2183    0     0   3896      0 --:--:-- --:--:-- --:--:--  3898
patching file modules/ai_interpolator_fireworks/src/Plugin/AiInterpolatorFieldRules/FireworksaiEntityReference.php
patching file src/FireworksaiApi.php
patching file src/Plugin/AiProvider/FireworksProvider.php
➜  fireworksai git:(1.0.x) ✗ ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml fireworksai
➜  contrib git:(main) ✗

Thank you.

cleavinjosh’s picture

cleavinjosh changed the visibility of the branch 3476613-phpcs-issues to hidden.

cleavinjosh’s picture

Status: Needs review » Needs work
cleavinjosh’s picture

cleavinjosh’s picture

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

Hi,

Please review, check, and advise on MR!1.

Thank you.

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

marcus_johansson’s picture

Status: Needs review » Fixed

Thank you all of you, I fixed the remaining issues myself and its merged.

Status: Fixed » Closed (fixed)

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