Problem/Motivation
Fix the all coding standard issues.
FILE: ...web/vendor/drupal/pareviewsh/pareview_temp/src/Form/SmoothScroll.php
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------
43 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
56 | WARNING | t() calls should be avoided in classes, use dependency
| | injection and $this->t() instead
--------------------------------------------------------------------------
FILE: ...r/drupal/pareviewsh/pareview_temp/smooth_mouse_scrolling.routing.yml
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------
7 | WARNING | The administration page callback should probably use
| | "administer site configuration" - which implies the user
| | can change something - rather than "access administration
| | pages" which is about viewing but not changing
| | configurations.
--------------------------------------------------------------------------
Time: 116ms; Memory: 4Mb
FILE: ...00000/site1101/web/vendor/drupal/pareviewsh/pareview_temp/README.txt
--------------------------------------------------------------------------
FOUND 0 ERRORS AND 2 WARNINGS AFFECTING 2 LINES
--------------------------------------------------------------------------
14 | WARNING | Line exceeds 80 characters; contains 85 characters
15 | WARNING | Line exceeds 80 characters; contains 92 characters
--------------------------------------------------------------------------
FILE: ...drupal/pareviewsh/pareview_temp/smooth_mouse_scrolling.libraries.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...wsh/pareview_temp/config/install/smooth_mouse_scrolling.settings.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
2 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...vendor/drupal/pareviewsh/pareview_temp/smooth_mouse_scrolling.module
--------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 2 LINES
--------------------------------------------------------------------------
26 | ERROR | [x] Missing function doc comment
33 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...web/vendor/drupal/pareviewsh/pareview_temp/src/Form/SmoothScroll.php
--------------------------------------------------------------------------
FOUND 35 ERRORS AND 3 WARNINGS AFFECTING 35 LINES
--------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one
| | blank line
2 | ERROR | [x] Namespaced classes, interfaces and traits should not
| | begin with a file doc comment
8 | WARNING | [x] Unused use statement
13 | ERROR | [x] Missing class doc comment
17 | ERROR | [x] Expected 1 blank line before function; 0 found
19 | ERROR | [x] Expected 1 blank line after function; 0 found
20 | ERROR | [x] Whitespace found at end of line
27 | ERROR | [x] Expected 1 blank line after function; 0 found
34 | ERROR | [x] Short array syntax must be used to define arrays
36 | ERROR | [x] Short array syntax must be used to define arrays
37 | ERROR | [x] Array indentation error, expected 8 spaces but found
| | 10
42 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
44 | ERROR | [x] Whitespace found at end of line
45 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 10
47 | ERROR | [x] Short array syntax must be used to define arrays
49 | ERROR | [x] Short array syntax must be used to define arrays
50 | ERROR | [x] Array indentation error, expected 8 spaces but found
| | 10
55 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected
| | "FALSE" but found "false"
57 | ERROR | [x] Expected 1 space before "?"; 0 found
58 | WARNING | [x] A comma should follow the last multiline array item.
| | Found: 10
62 | ERROR | [x] Short array syntax must be used to define arrays
73 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
74 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
75 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
76 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
77 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
78 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 8
79 | ERROR | [x] Line indented incorrectly; expected 4 spaces, found 6
80 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
80 | ERROR | [x] Expected 1 blank line after function; 0 found
85 | ERROR | [x] A cast statement must be followed by a single space
86 | ERROR | [x] A cast statement must be followed by a single space
88 | ERROR | [x] Inline comments must end in full-stops, exclamation
| | marks, colons, question marks, or closing parentheses
90 | ERROR | [x] Inline comments must end in full-stops, exclamation
| | marks, colons, question marks, or closing parentheses
97 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
97 | ERROR | [x] Closing brace indented incorrectly; expected 2
| | spaces, found 3
98 | ERROR | [x] Expected 1 newline at end of file; 0 found
98 | ERROR | [x] The closing brace for the class must have an empty
| | line before it
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 38 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
FILE: ...r/drupal/pareviewsh/pareview_temp/smooth_mouse_scrolling.routing.yml
--------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------
7 | ERROR | [x] Expected 1 newline at end of file; 0 found
--------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------
Time: 285ms; Memory: 4Mb
Proposed resolution
Fix the all coding standard issues.
Remaining tasks
Nil
User interface changes
Nil
API changes
Nil
Data model changes
Nil
| Comment | File | Size | Author |
|---|---|---|---|
| #7 | 2964861-Drupal-coding-standard-7.patch | 7.25 KB | dhirendra.mishra |
| #7 | 4-7_interdiff.txt | 392 bytes | dhirendra.mishra |
| #4 | 2964861-Drupal-coding-standard-4.patch | 7.26 KB | deepanker_bhalla |
| #2 | 2964861-2.patch | 1.79 KB | bhanuprakashnani |
Comments
Comment #2
bhanuprakashnani commentedMade the changes in the array syntax wherever required. Please review and mention if any more changes are to be made. Thank you.
Comment #3
deepanker_bhalla commentedHi @bhanuprakashnani,
I am unable to apply your patch. Here is the output:
modules/git/smooth_mouse_scrolling$ git apply -v 2964861-2.patch
Checking patch src/Form/SmoothScroll.php...
error: while searching for:
public function buildForm(array $form, FormStateInterface $form_state) {
// kint($this);
$config = $this->config('smooth_mouse_scrolling.settings');
$form['step'] = array(
'#type' => 'textfield',
'#attributes' => array(
'data-type' => 'number',
),
'#title' => 'Step',
'#width' => '30%',
'#align' => 'center',
error: patch failed: src/Form/SmoothScroll.php:31
error: src/Form/SmoothScroll.php: patch does not apply
Comment #4
deepanker_bhalla commentedHi,
Thus i am updating the patch which is also covering the issues from coding standard as well as drupal best practices also.
https://pareview.sh/pareview/https-git.drupal.org-project-smooth_mouse_s....
Comment #5
msankhala commentedone trailing whitespace, rest looks good.
Comment #6
dhirendra.mishra commentedlet me do it.
Comment #7
dhirendra.mishra commentedPlease find patch here.
Comment #8
dhirendra.mishra commentedComment #9
deepanker_bhalla commented@dhirendra.mishra Good work. I can confirm the patch #7 is applying cleanly. Here is the output:
❯ smooth_mouse_scrolling 8.x-1.x* git apply -v 2964861-Drupal-coding-standard-7.patch
Checking patch README.txt...
Checking patch config/install/smooth_mouse_scrolling.settings.yml...
Checking patch smooth_mouse_scrolling.libraries.yml...
Checking patch smooth_mouse_scrolling.module...
Checking patch smooth_mouse_scrolling.routing.yml...
Checking patch src/Form/SmoothScroll.php...
Applied patch README.txt cleanly.
Applied patch config/install/smooth_mouse_scrolling.settings.yml cleanly.
Applied patch smooth_mouse_scrolling.libraries.yml cleanly.
Applied patch smooth_mouse_scrolling.module cleanly.
Applied patch smooth_mouse_scrolling.routing.yml cleanly.
Applied patch src/Form/SmoothScroll.php cleanly.
❯ smooth_mouse_scrolling 8.x-1.x* phpcs --standard=Drupal .
❯ smooth_mouse_scrolling 8.x-1.x*
PHPCS is reporting no coding standard warning after applying the patch #7.
Comment #11
siva_drupal commentedThe above patch changes is available in development version. It will be added in the next release.
Comment #12
siva_drupal commentedComment #13
dhirendra.mishra commented