Fix the issues reported by phpcs

Created on 24 April 2023, about 1 year ago
Updated 18 May 2023, about 1 year ago

Problem/Motivation

Getting following error/warnings.

FILE: /var/www/html/modules/contrib/auto_node_translate/auto_node_translate.module
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
FOUND 6 ERRORS AFFECTING 6 LINES
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
94 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "javali_node_insert_submit" but expected "auto_node_translate_javali_node_insert_submit"
116 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "javali_node_edit_submit" but expected "auto_node_translate_javali_node_edit_submit"
154 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "update_translation" but expected "auto_node_translate_update_translation"
175 | ERROR | The array declaration extends to column 95 (the limit is 80). The array content should be split up over multiple lines
206 | ERROR | All functions defined in a module file must be prefixed with the module's name, found "translate_node" but expected "auto_node_translate_translate_node"
227 | ERROR | The array declaration extends to column 91 (the limit is 80). The array content should be split up over multiple lines
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/auto_node_translate/auto_node_translate.links.menu.yml
------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------------
6 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/auto_node_translate/auto_node_translate.routing.yml
---------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
---------------------------------------------------------------------------------------
10 | ERROR | [x] Expected 1 newline at end of file; 2 found
---------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------------

FILE: /var/www/html/modules/contrib/auto_node_translate/auto_node_translate.permissions.yml
-------------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
-------------------------------------------------------------------------------------------
4 | ERROR | [x] Expected 1 newline at end of file; 0 found
-------------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
-------------------------------------------------------------------------------------------

Time: 2.82 secs; Memory: 6MB

Steps to reproduce

Run following command

phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml modules/contrib/auto_node_translate/

Proposed resolution

Above error/warnings need to be fixed.

📌 Task
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

🇮🇳India samit.310@gmail.com

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 @samit.310@gmail.com
  • Status changed to Needs review about 1 year ago
  • 🇮🇳India samit.310@gmail.com

    Above errors/warnings has been fixed.

  • Status changed to Needs work about 1 year ago
  • 🇵🇭Philippines paraderojether

    Hi samit.310@gmail.com

    I reviewed patch #2, and confirmed it fixes the errors/warnings that you reported. However, I'm getting these additional errors/warnings when I run the command against Drupal core version 9.5.7, Auto Node Translate 8.x-1.x-dev.

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/auto_node_translate/src/Form/ConfigForm.php
    -------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 4 WARNINGS AFFECTING 4 LINES
    -------------------------------------------------------------------------------------------------------------------
    10 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    88 | WARNING | #options values usually have to run through t() for translation
    89 | WARNING | #options values usually have to run through t() for translation
    90 | WARNING | #options values usually have to run through t() for translation
    -------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/auto_node_translate/src/GoogleTranslationApi.php
    ------------------------------------------------------------------------------------------------------------------------
    FOUND 3 ERRORS AFFECTING 3 LINES
    ------------------------------------------------------------------------------------------------------------------------
    20 | ERROR | [x] Expected 1 blank line before function; 0 found
    29 | ERROR | [x] Expected 1 space after closing parenthesis; found 0
    30 | ERROR | [x] Whitespace found at end of line
    ------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/auto_node_translate/src/TranslationApiInterface.php
    ---------------------------------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    ---------------------------------------------------------------------------------------------------------------------------
    7 | WARNING | The class short comment should describe what the class does and not simply repeat the class name
    ---------------------------------------------------------------------------------------------------------------------------

    FILE: /Users/studenttrainees/Drupal2/drupalsite/docroot/modules/contrib/auto_node_translate/src/IbmWatsonTranslationApi.php
    --------------------------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------------------------
    49 | ERROR | The array declaration extends to column 177 (the limit is 80). The array content should be split up over multiple lines
    --------------------------------------------------------------------------------------------------------------------------------------

    Time: 414ms; Memory: 10MB

    Please check.
    Thank You

  • 🇮🇳India chanderbhushan

    Added patch

  • Status changed to Needs review about 1 year ago
  • Status changed to Needs work about 1 year ago
  • 🇵🇭Philippines paraderojether

    Hi chanderbhushan

    Patch #4 is failed to apply.

    Please check.
    Thank You

  • Status changed to Closed: won't fix about 1 year ago
  • 🇵🇹Portugal jmauricio

    The 8.x-1.x-dev will be descontinued, so this will not be fixed.

Production build 0.69.0 2024