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

Comments

arunkumark created an issue. See original summary.

bhanuprakashnani’s picture

Assigned: Unassigned » bhanuprakashnani
Status: Active » Needs review
StatusFileSize
new1.79 KB

Made the changes in the array syntax wherever required. Please review and mention if any more changes are to be made. Thank you.

deepanker_bhalla’s picture

Status: Needs review » Needs work

Hi @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

deepanker_bhalla’s picture

Status: Needs work » Needs review
StatusFileSize
new7.26 KB

Hi,

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....

msankhala’s picture

Status: Needs review » Needs work
+++ b/README.txt
@@ -47,12 +51,14 @@ CONFIGURATION
-	3.In the configure page, user can provide the Step value and Speed value which applies to all pages.
+	3.In the configure page, user can provide the Step value and Speed ¶
+          value which applies to all pages.

one trailing whitespace, rest looks good.

dhirendra.mishra’s picture

let me do it.

dhirendra.mishra’s picture

Status: Needs work » Needs review
StatusFileSize
new392 bytes
new7.25 KB

Please find patch here.

dhirendra.mishra’s picture

Assigned: dhirendra.mishra » Unassigned
deepanker_bhalla’s picture

Status: Needs review » Reviewed & tested by the community

@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.

siva_drupal’s picture

The above patch changes is available in development version. It will be added in the next release.

siva_drupal’s picture

Assigned: Unassigned » siva_drupal
Status: Reviewed & tested by the community » Fixed
dhirendra.mishra’s picture

Status: Fixed » Closed (fixed)

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