GitLab CI reports PHP_CodeSniffer warnings/errors which should be fixed.

FILE: ...les/custom/cloudflare-3352408/tests/src/Functional/OverrideGlobalsTest.php
--------------------------------------------------------------------------------
FOUND 3 ERRORS AFFECTING 3 LINES
--------------------------------------------------------------------------------
 10 | ERROR | [x] Doc comment short description must end with a full stop
    |       |     (Drupal.Commenting.DocComment.ShortFullStop)
 56 | ERROR | [x] Expected 1 blank line after function; 0 found
    |       |     (Squiz.WhiteSpace.FunctionSpacing.AfterLast)
 57 | ERROR | [x] The closing brace for the class must have an empty line
    |       |     before it
    |       |     (Drupal.Classes.ClassDeclaration.CloseBraceAfterBody)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
FILE: ...stom/cloudflare-3352408/modules/cloudflarepurger/src/Form/SettingsForm.php
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
 39 | ERROR | [x] Expected 1 space after "=>"; 2 found
    |       |     (Squiz.WhiteSpace.OperatorSpacing.SpacingAfter)
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------
Time: 780ms; Memory: 6MB

 
 

Issue fork cloudflare-3352408

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

TanujJain-TJ created an issue. See original summary.

tanuj.’s picture

StatusFileSize
new23.83 KB

Adding a patch to resolve all phpcs errors.

ignored these 2 errors as it contains installation commands

FILE: /docs/enterprise_setup.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | WARNING | Line exceeds 80 characters; contains 128 characters
----------------------------------------------------------------------


FILE: /docs/freetier_setup.md
----------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
----------------------------------------------------------------------
 4 | WARNING | Line exceeds 80 characters; contains 128 characters
----------------------------------------------------------------------
tanuj.’s picture

Status: Needs work » Needs review
avpaderno’s picture

Priority: Normal » Minor
Issue tags: +Coding standards
kenyoowen’s picture

Status: Needs review » Reviewed & tested by the community
StatusFileSize
new259.25 KB
new345.99 KB

Hi tanuj

I applied patch #2 to the “CloudFlare” module against Version 2.0.x-dev and confirmed that the errors and warnings are resolved and the remaining issue is ignored since it is an installation command. Please see the screenshots attached.

For your review.
Thank you.

avpaderno’s picture

Status: Reviewed & tested by the community » Needs work
 /**
- * Class SettingsForm.
+ * Creates Settings Form.

I am not sure Creates is the right verb.
Settings and Form are misspelled, since they are not the first word in the phrase.

+  /**
+   * The state store.
+   *
+   * @var Drupal\Core\State\StateInterface
+   */
+  protected $state;
+   * @param Drupal\Core\State\StateInterface $state
+   *   The object State.

That service is usually described as The state key/value store.

imustakim’s picture

Assigned: Unassigned » imustakim

Working on this.

imustakim’s picture

Assigned: imustakim » Unassigned
Status: Needs work » Needs review
StatusFileSize
new23.86 KB
new2.13 KB

Patch updated.
Please review.

bindu r’s picture

StatusFileSize
new50.42 KB

Hi, Reviewed the patch at #8, applies cleanly and addresses the comment #6, but found few warnings. Attaching the ss for reference.

silvi.addweb’s picture

StatusFileSize
new35.32 KB

Re-roll the patch #8 according to the latest code changes.

avpaderno’s picture

Issue summary: View changes

jcnventura changed the visibility of the branch 3352408-fix-the-issues to hidden.

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

  • rosk0 committed 38842814 on 2.0.x authored by avpaderno
    Issue #3352408 by avpaderno, imustakim, tanuj., jcnventura: Fix the...
rosk0’s picture

Status: Needs review » Fixed

Thanks

Status: Fixed » Closed (fixed)

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