Fix the issues reported by PHPCS

Created on 19 April 2023, about 2 years ago
Updated 1 August 2024, 9 months ago

Problem/Motivation

FILE: ...al10/web/modules/contrib/a11y_autocomplete_element/js/a11y-autocomplete.js
--------------------------------------------------------------------------------
FOUND 18 ERRORS AFFECTING 12 LINES
--------------------------------------------------------------------------------
14 | ERROR | [x] Expected 1 space before "-"; 0 found
14 | ERROR | [x] Expected 1 space after "-"; 0 found
14 | ERROR | [x] Expected 1 space before "="; 0 found
14 | ERROR | [x] Expected 1 space after "="; 0 found
25 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
| | found "false"
37 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
| | found "true"
47 | ERROR | [x] Expected 1 space before "="; 0 found
47 | ERROR | [x] Expected 1 space after "="; 0 found
63 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
| | found "false"
65 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
| | found "true"
66 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
| | found "true"
68 | ERROR | [x] Expected 1 space before "="; 0 found
68 | ERROR | [x] Expected 1 space after "="; 0 found
70 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
| | found "true"
86 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "FALSE" but
| | found "false"
87 | ERROR | [x] TRUE, FALSE and NULL must be uppercase; expected "TRUE" but
| | found "true"
92 | ERROR | [x] Expected 1 space before "="; 0 found
92 | ERROR | [x] Expected 1 space after "="; 0 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 18 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...odules/contrib/a11y_autocomplete_element/a11y_autocomplete_element.install
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
1 | ERROR | [x] Missing file doc comment
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

FILE: ...dules/contrib/a11y_autocomplete_element/a11y_autocomplete_element.info.yml
--------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
--------------------------------------------------------------------------------
6 | WARNING | All dependencies must be prefixed with the project name, for
| | example "drupal:"
--------------------------------------------------------------------------------

FILE: ...modules/contrib/a11y_autocomplete_element/a11y_autocomplete_element.module
--------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
--------------------------------------------------------------------------------
33 | ERROR | [x] Expected 1 newline at end of file; 2 found
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

Time: 339ms; Memory: 10MB

Steps to reproduce

Execute the command: phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,js,info,txt,md,yml,twig a11y_autocomplete_element/

Proposed resolution

Execute PHPCBF command and fix all issues reported for Drupal and DrupalPractice standards

Remaining tasks

Patch Review

📌 Task
Status

Needs work

Version

1.0

Component

Code

Created by

🇮🇳India urvashi_vora Madhya Pradesh, India

Live updates comments and jobs are added and updated live.
  • Coding standards

    It involves compliance with, or the content of coding standards. Requires broad community agreement.

Sign in to follow issues

Comments & Activities

  • Issue created by @urvashi_vora
  • Status changed to RTBC about 2 years ago
  • 🇵🇭Philippines clarkssquared

    Hi urvashi_vora,

    I applied patch coding-standard-fixes.patch to the "Accessible Autocomplete Element/Widget" against version 1.x-dev and verified that the phpcs errors were fixed.

    Please look at the screenshot for your reference

    Thank you.

  • Status changed to Needs work 9 months ago
  • 🇦🇺Australia larowlan 🇦🇺🏝.au GMT+10
    +++ b/js/a11y-autocomplete.js
    @@ -11,7 +11,7 @@
    -      if (pillsContainer.querySelector(`[data-option="${option.value}"]`)) {
    +      if (pillsContainer.querySelector(`[data - option = "${option.value}"]`)) {
             return;
    

    this is not the correct fix and will break functionality
    We shouldn't be using phpcs against JS files

Production build 0.71.5 2024