Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/views_remote_data/tests/modules/views_remote_data_pokeapi/config/install/core.entity_view_display.node.pokemon.teaser.yml
-------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------------------------------------------------------
35 | ERROR | [x] Expected 1 newline at end of file; 2 found
-------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/modules/views_remote_data_pokeapi/config/install/core.entity_view_display.node.pokemon.default.yml
--------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------------------------------------------------------------------------------------
34 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/modules/views_remote_data_pokeapi/README.md
-------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
-------------------------------------------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 119 characters
6 | WARNING | Line exceeds 80 characters; contains 119 characters
11 | WARNING | Line exceeds 80 characters; contains 111 characters
16 | WARNING | Line exceeds 80 characters; contains 89 characters
-------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/sort/PropertySortTest.php
-------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
-------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/argument/PropertyArgumentTest.php
---------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
---------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/ViewsPluginTestBase.php
-----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------
27 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/field/PropertyFieldTest.php
---------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
---------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/filter/PropertyFilterTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
24 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Plugin/views/query/RemoteDataQueryTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Events/RemoteDataQueryEventTest.php
----------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
----------------------------------------------------------------------------------------------------------
25 | ERROR | [x] Expected 1 blank line before function; 0 found
----------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
----------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/tests/src/Kernel/Events/RemoteDataLoadEntitiesEventTest.php
-----------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-----------------------------------------------------------------------------------------------------------------
26 | ERROR | [x] Expected 1 blank line before function; 0 found
-----------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/views_remote_data/README.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
5 | WARNING | Line exceeds 80 characters; contains 119 characters
----------------------------------------------------------------------

Time: 10.38 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/views_remote_data/

Proposed resolution

Above error/warnings need to be fixed.

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

samit.310@gmail.com created an issue. See original summary.

samitk’s picture

Assigned: samitk » Unassigned
Status: Needs work » Needs review
StatusFileSize
new7.18 KB

Above error/warnings are fixed.

spriya2896’s picture

Assigned: Unassigned » spriya2896

I will test this patch.

spriya2896’s picture

StatusFileSize
new133.44 KB

I have tested this patch. This patch was applied successfully and shows no phpcs errors.

spriya2896’s picture

Assigned: spriya2896 » Unassigned
Status: Needs review » Reviewed & tested by the community
avpaderno’s picture

Title: Drupal Coding Standards Issues | phpcs » Fix the issues reported by phpcs
Issue tags: -, -

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

avpaderno’s picture

Priority: Normal » Minor
avpaderno’s picture

Status: Reviewed & tested by the community » Needs review

It would be better that the patch is reviewed by somebody who does not work on the same organization.

paraderojether’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new193.43 KB
new128.31 KB

I reviewed patch #2, and verified it fixes the issues reported by the phpcs. Drupal core version 9.5.8, and Views Remote Data 1.0.X-dev.

I added screenshots for reference.
Thank You.

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

ankitv18’s picture

Status: Reviewed & tested by the community » Needs review
ankitv18’s picture

@mglaman please review the MR!20

clarkssquared’s picture

Status: Needs review » Needs work

Hi

I applied the updated MR !20 after commit #14 and I can still see many PHPCS issues:

➜  views_remote_data git:(1.0.x) curl https://git.drupalcode.org/project/views_remote_data/-/merge_requests/20.diff | patch -p1
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6783    0  6783    0     0  13277      0 --:--:-- --:--:-- --:--:-- 13647
patching file 'tests/src/Kernel/Events/RemoteDataQueryEventTest.php'
patching file 'tests/src/Kernel/Plugin/views/ViewsPluginTestBase.php'
patching file 'tests/src/Kernel/Plugin/views/argument/PropertyArgumentTest.php'
patching file 'tests/src/Kernel/Plugin/views/field/PropertyFieldTest.php'
patching file 'tests/src/Kernel/Plugin/views/filter/PropertyFilterTest.php'
patching file 'tests/src/Kernel/Plugin/views/query/RemoteDataQueryTest.php'
patching file 'tests/src/Kernel/Plugin/views/sort/PropertySortTest.php'
➜  views_remote_data git:(1.0.x) ✗ ..
➜  contrib git:(main) ✗ phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml views_remote_data 

FILE: ...ta_pokeapi/config/install/core.entity_view_display.node.pokemon.teaser.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 35 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...a_pokeapi/config/install/core.entity_view_display.node.pokemon.default.yml
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 34 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: ...ontrib/views_remote_data/tests/modules/views_remote_data_pokeapi/README.md
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
--------------------------------------------------------------------------------
  5 | WARNING | Line exceeds 80 characters; contains 119 characters
  6 | WARNING | Line exceeds 80 characters; contains 119 characters
 11 | WARNING | Line exceeds 80 characters; contains 111 characters
 16 | WARNING | Line exceeds 80 characters; contains 89 characters
--------------------------------------------------------------------------------


FILE: ...ws_remote_data/tests/src/Kernel/Events/RemoteDataLoadEntitiesEventTest.php
--------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------------
  8 | ERROR | [x] Use statements should be sorted alphabetically. The first
    |       |     wrong one is Drupal\Component\Serialization\Json.
 26 | ERROR | [x] Expected 1 blank line before function; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------


FILE: .../Projects/d10/drupal_local/web/modules/contrib/views_remote_data/README.md
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
 5 | WARNING | Line exceeds 80 characters; contains 119 characters
--------------------------------------------------------------------------------

Time: 754ms; Memory: 12MB

➜  contrib git:(main) ✗ 
ankitv18’s picture

Status: Needs work » Needs review

Rebased and made minor changes to make pipelines green for all.

mglaman’s picture

Status: Needs review » Reviewed & tested by the community
mglaman’s picture

  • mglaman committed 9249a485 on 1.0.x authored by ankitv18
    Issue #3342224 by ankitv18, samit.310@gmail.com, urvashi_vora,...
mglaman’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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