Problem/Motivation
1: README.md file missing:
In Drupal, the README.md file provides documentation and guidance to users, developers, and contributors. here is the link for creating a README.md file with the write pattern:
README.md ā
template.
2: hook_help() missing from auto_promote.module file.
In Drupal, the hook_help function is used to provide help documentation for your custom module. This documentation is displayed on the Help page of your Drupal site, making it accessible to administrators and users.
I've attached a patch of hook_help() for this module.
3: Fix the issues reported by phpcs
Steps Reproduce
. After Installed and enabled Run the below command on the composer-
phpcs --standard=Drupal --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml ./web/modules/contrib/auto_promote
FILE: /web/modules/contrib/auto_promote/auto_promote.info.yml
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 3 WARNINGS AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
1 | WARNING | Remove "project" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "datestamp" from the info file, it will be added by drupal.org packaging automatically
1 | WARNING | Remove "version" from the info file, it will be added by drupal.org packaging automatically
-------------------------------------------------------------------------------------------------------------
FILE: /web/modules/contrib/auto_promote/auto_promote.module
--------------------------------------------------------------------------------------
FOUND 2 ERRORS AFFECTING 1 LINE
--------------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
--------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------------
FILE: /web/modules/contrib/auto_promote/src/Form/AutoPromoteSettingsForm.php
------------------------------------------------------------------------------------------------------------------------------
FOUND 38 ERRORS AND 2 WARNINGS AFFECTING 32 LINES
------------------------------------------------------------------------------------------------------------------------------
1 | ERROR | [x] The PHP open tag must be followed by exactly one blank line
1 | ERROR | [x] Whitespace found at end of line
9 | ERROR | [x] Missing class doc comment
11 | ERROR | [ ] Missing member variable doc comment
13 | ERROR | [x] Missing function doc comment
17 | ERROR | [x] Missing function doc comment
23 | ERROR | [x] Missing function doc comment
27 | ERROR | [x] Missing function doc comment
31 | ERROR | [x] Missing function doc comment
34 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
36 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
39 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
41 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
42 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
43 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
43 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
43 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
43 | ERROR | [x] Comments may not appear after statements
48 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
49 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
50 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
51 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
54 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
57 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
59 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
60 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
61 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
61 | WARNING | [ ] Line exceeds 80 characters; contains 82 characters
61 | ERROR | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
61 | ERROR | [x] Comments may not appear after statements
66 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
67 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
68 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
69 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
72 | ERROR | [x] Array indentation error, expected 6 spaces but found 8
76 | ERROR | [x] Line indented incorrectly; expected 2 spaces, found 0
76 | ERROR | [x] Closing brace indented incorrectly; expected 2 spaces, found 0
78 | ERROR | [x] Missing function doc comment
85 | ERROR | [x] Expected 1 blank line after function; 0 found
86 | ERROR | [x] The closing brace for the class must have an empty line before it
------------------------------------------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 37 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------------------------------------------