Problem/Motivation
Drupal Coding standards should be fixed.
FILE: /home/akash/Documents/patches/node_access_allow/node_access_allow.install
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 1 ERROR AND 7 WARNINGS AFFECTING 8 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
3 | WARNING | [x] Unused use statement
11 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
34 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
41 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
48 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
55 | WARNING | [x] A comma should follow the last multiline array item. Found: ''
65 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FILE: /home/akash/Documents/patches/node_access_allow/node_access_allow.module
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 78 ERRORS AND 22 WARNINGS AFFECTING 61 LINES
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
3 | ERROR | [ ] Missing short description in doc comment
7 | WARNING | [x] Unused use statement
7 | ERROR | [x] When importing a class with "use", do not include a leading \
8 | WARNING | [x] Unused use statement
8 | ERROR | [x] When importing a class with "use", do not include a leading \
9 | ERROR | [x] When importing a class with "use", do not include a leading \
12 | WARNING | [x] Unused use statement
14 | WARNING | [x] Unused use statement
16 | WARNING | [x] Unused use statement
17 | WARNING | [x] Unused use statement
18 | WARNING | [x] Unused use statement
18 | ERROR | [x] There must be one blank line after the last USE statement; 2 found;
22 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
24 | ERROR | [x] Expected 1 blank line before function; 2 found
29 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
39 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
47 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
65 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
85 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
88 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but found "true"
121 | ERROR | [x] Function comment short description must start with exactly one space
121 | ERROR | [x] Doc comment short description must end with a full stop
125 | WARNING | [ ] Line exceeds 80 characters; contains 226 characters
126 | WARNING | [ ] Line exceeds 80 characters; contains 113 characters
126 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
127 | WARNING | [ ] Line exceeds 80 characters; contains 117 characters
127 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 6
128 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
130 | ERROR | [x] No space found before comment text; expected "// die;" but found "//die;"
130 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
131 | WARNING | [ ] Line exceeds 80 characters; contains 116 characters
131 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
132 | WARNING | [ ] Line exceeds 80 characters; contains 107 characters
132 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
133 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
135 | WARNING | [ ] Line exceeds 80 characters; contains 110 characters
135 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
136 | WARNING | [ ] Line exceeds 80 characters; contains 106 characters
136 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
137 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
139 | WARNING | [ ] Line exceeds 80 characters; contains 224 characters
139 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
140 | WARNING | [ ] Line exceeds 80 characters; contains 110 characters
140 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 4
141 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 3
143 | WARNING | [x] There must be no blank line following an inline comment
143 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
143 | ERROR | [x] No space found before comment text; expected "// dump($access_allow['scheduler']);die;" but found "//dump($access_allow['scheduler']);die;"
143 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
145 | WARNING | [x] There must be no blank line following an inline comment
145 | ERROR | [x] No space found before comment text; expected "// dump($access_allow['scheduler']['start']);die;" but found "//dump($access_allow['scheduler']['start']);die;"
145 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
147 | ERROR | [x] Expected 1 space after IF keyword; 0 found
148 | ERROR | [x] Expected 1 space after IF keyword; 0 found
155 | ERROR | [x] Function comment short description must start with exactly one space
155 | ERROR | [x] Doc comment short description must end with a full stop
192 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
194 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
203 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
205 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with use statements
215 | WARNING | [ ] Format should be "* Implements hook_foo().", "* Implements hook_foo_BAR_ID_bar() for xyz_bar().",, "* Implements hook_foo_BAR_ID_bar() for xyz-bar.html.twig.", "* Implements
| | hook_foo_BAR_ID_bar() for xyz-bar.tpl.php.", or "* Implements hook_foo_BAR_ID_bar() for block templates."
220 | ERROR | [x] Expected one space after the comma, 0 found
221 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
221 | ERROR | [x] Object operator not indented correctly; expected 6 spaces but found 4
222 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
223 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
224 | ERROR | [x] Line indented incorrectly; expected 6 spaces, found 4
227 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but found "false"
230 | ERROR | [x] Use "elseif" in place of "else if"
240 | ERROR | [x] Expected one space after the comma, 0 found
243 | ERROR | [x] Expected one space after the comma, 0 found
245 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
245 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
246 | ERROR | [x] Expected 1 space before ">"; 0 found
246 | ERROR | [x] Expected 1 space after ">"; 0 found
246 | ERROR | [x] Expected 1 space before ">"; 0 found
246 | ERROR | [x] Expected 1 space after ">"; 0 found
253 | ERROR | [x] Use "elseif" in place of "else if"
253 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
253 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
254 | ERROR | [x] Expected 1 space before ">"; 0 found
254 | ERROR | [x] Expected 1 space after ">"; 0 found
254 | ERROR | [x] Expected 1 space before ">"; 0 found
254 | ERROR | [x] Expected 1 space after ">"; 0 found
261 | ERROR | [x] Use "elseif" in place of "else if"
261 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
261 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
262 | ERROR | [x] Expected 1 space before ">"; 0 found
262 | ERROR | [x] Expected 1 space after ">"; 0 found
262 | ERROR | [x] Expected 1 space before ">"; 0 found
262 | ERROR | [x] Expected 1 space after ">"; 0 found
269 | ERROR | [x] Use "elseif" in place of "else if"
269 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
269 | ERROR | [x] Expected 1 space(s) after cast statement; 0 found
270 | ERROR | [x] Expected 1 space before ">"; 0 found
270 | ERROR | [x] Expected 1 space after ">"; 0 found
270 | ERROR | [x] Expected 1 space before ">"; 0 found
270 | ERROR | [x] Expected 1 space after ">"; 0 found
282 | ERROR | [x] Whitespace found at end of line
284 | ERROR | [x] Whitespace found at end of line
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 86 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Steps to reproduce
phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml"
Proposed resolution
Follow https://www.drupal.org/docs/develop/standards/coding-standards to fix it
Comments
Comment #2
akashkumar07 commentedPatch added to fix drupal cs issues. Please review.
Thanks!
Comment #3
dipesh_goswamiHi @AkashKumar07,
I am reviewing your patch.
Comment #4
dipesh_goswamiHi,
Your patch applied cleanly (see below):
Most of the issues are resolved but some issues are still left (see below):
So, moving it to "Needs work".
Comment #5
abhijith s commentedFixed CS issues.Please review.
Comment #6
abhijith s commented