Fix the issues reported by phpcs

Created on 15 February 2023, almost 2 years ago
Updated 21 August 2024, 4 months ago
šŸ“Œ Task
Status

RTBC

Version

3.0

Component

Code

Created by

šŸ‡®šŸ‡³India sidharth_soman Bangalore

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

  • Issue created by @sidharth_soman
  • Status changed to Needs work almost 2 years ago
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore

    Finding the following issues using php codesniffer. I will work on them.

    C:\xampp\htdocs\backendassignment\web\modules\contrib>phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml,twig views_semantic_tabs-3341851
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\views_semantic_tabs-3341851\css\views-semantic-tabs.css
    -------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] Expected 1 newline at end of file; 0 found
    -------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\views_semantic_tabs-3341851\README.md
    -------------------------------------------------------------------------------------------------
    FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------
     14 | WARNING | Line exceeds 80 characters; contains 83 characters
    -------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\views_semantic_tabs-3341851\src\Plugin\views\style\ViewsSemanticTabs.php
    ------------------------------------------------------------------------------------------------------------------------------------
    FOUND 4 ERRORS AND 2 WARNINGS AFFECTING 6 LINES
    ------------------------------------------------------------------------------------------------------------------------------------
      1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
     49 | WARNING | [x] A comma should follow the last multiline array item. Found: )
     77 | ERROR   | [x] Doc comment short description must end with a full stop
     84 | WARNING | [x] A comma should follow the last multiline array item. Found: ]
     87 | ERROR   | [x] Expected 1 blank line after function; 0 found
     88 | ERROR   | [x] The closing brace for the class must have an empty line before it
    ------------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 6 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\views_semantic_tabs-3341851\views_semantic_tabs.install
    -------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    -------------------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
    -------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    -------------------------------------------------------------------------------------------------------------------
    
    
    FILE: C:\xampp\htdocs\backendassignment\web\modules\contrib\views_semantic_tabs-3341851\views_semantic_tabs.module
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 12 ERRORS AND 5 WARNINGS AFFECTING 12 LINES
    ------------------------------------------------------------------------------------------------------------------------------
      1 | ERROR   | [x] End of line character is invalid; expected "\n" but found "\r\n"
     37 | ERROR   | [ ] Type hint "array" missing for $variables
     66 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 3
     67 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     72 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     75 | WARNING | [x] A comma should follow the last multiline array item. Found: 'views-semantic-tabs'
     80 | WARNING | [x] 'todo : hide group field from row content' should match the format '@todo Fix problem X here.'
     80 | ERROR   | [x] Inline comments must start with a capital letter
     83 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
     85 | ERROR   | [ ] Comment indentation error, expected only 2 spaces
     86 | WARNING | [x] There must be no blank line following an inline comment
     86 | WARNING | [ ] There must be no blank line following an inline comment
     86 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     88 | WARNING | [x] 'todo : group field value should be plain text' should match the format '@todo Fix problem X here.'
     88 | ERROR   | [x] Inline comments must start with a capital letter
     88 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     98 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
    ------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 13 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------
    
    Time: 557ms; Memory: 6MB
    
  • Issue was unassigned.
  • Status changed to Needs review almost 2 years ago
  • šŸ‡®šŸ‡³India sidharth_soman Bangalore

    I have solved all the above issues and made an MR for the same. Please review.

  • Assigned to annmarysruthy
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
  • Issue was unassigned.
  • First commit to issue fork.
  • šŸ‡§šŸ‡·Brazil mabho Rio de Janeiro, RJ

    @sidharth_soman, I have tested your changes and they seem to be working all right. Thank you for taking the time to apply the code standard changes.

    Do you mind reviewing and applying changes (the same way you did here) to the 4.0.x branch, since that is the latest dev version?

    Thank you so much in advance.

  • Status changed to Needs work 4 months ago
  • šŸ‡µšŸ‡­Philippines cleavinjosh

    Hi @sidharth_soman,

    I applied MR!7 on 4.0.x branch and it was not applied smoothly.

    āžœ  views_semantic_tabs git:(4.0.x) curl https://git.drupalcode.org/project/views_semantic_tabs/-/merge_requests/7.diff | patch -p1
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5529    0  5529    0     0   8270      0 --:--:-- --:--:-- --:--:--  8276
    patching file README.md
    patching file css/views-semantic-tabs.css
    patching file src/Plugin/views/style/ViewsSemanticTabs.php
    Hunk #2 succeeded at 62 (offset -12 lines).
    patching file views_semantic_tabs.install
    patching file views_semantic_tabs.module
    Hunk #2 FAILED at 63.
    Hunk #3 succeeded at 89 (offset -5 lines).
    1 out of 3 hunks FAILED -- saving rejects to file views_semantic_tabs.module.rej
    āžœ  views_semantic_tabs git:(4.0.x) āœ— ..
    āžœ  contrib phpcs --standard=Drupal,DrupalPractice --extensions=php,module,inc,install,test,profile,theme,css,info,txt,md,yml views_semantic_tabs
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/views_semantic_tabs/css/views-semantic-tabs.css
    --------------------------------------------------------------------------------------------------------------------
    FOUND 1 ERROR AFFECTING 1 LINE
    --------------------------------------------------------------------------------------------------------------------
     1 | ERROR | [x] Additional whitespace found at start of file
    --------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    --------------------------------------------------------------------------------------------------------------------
    
    
    FILE: /Users/interns/Demo-site/drupal-org-issues/web/modules/contrib/views_semantic_tabs/views_semantic_tabs.module
    ------------------------------------------------------------------------------------------------------------------------------
    FOUND 9 ERRORS AND 5 WARNINGS AFFECTING 9 LINES
    ------------------------------------------------------------------------------------------------------------------------------
     58 | ERROR   | [x] Line indented incorrectly; expected 2 spaces, found 3
     59 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     67 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     70 | WARNING | [x] A comma should follow the last multiline array item. Found: 'views-semantic-tabs'
     75 | WARNING | [x] 'todo : hide group field from row content' should match the format '@todo Fix problem X here.'
     75 | ERROR   | [x] Inline comments must start with a capital letter
     78 | ERROR   | [ ] Comment indentation error, expected only 1 spaces
     80 | ERROR   | [ ] Comment indentation error, expected only 2 spaces
     81 | WARNING | [x] There must be no blank line following an inline comment
     81 | WARNING | [ ] There must be no blank line following an inline comment
     81 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
     83 | WARNING | [x] 'todo : group field value should be plain text' should match the format '@todo Fix problem X here.'
     83 | ERROR   | [x] Inline comments must start with a capital letter
     83 | ERROR   | [x] Inline comments must end in full-stops, exclamation marks, question marks, colons, or closing parentheses
    ------------------------------------------------------------------------------------------------------------------------------
    PHPCBF CAN FIX THE 11 MARKED SNIFF VIOLATIONS AUTOMATICALLY
    ------------------------------------------------------------------------------------------------------------------------------
    
    Time: 117ms; Memory: 10MB
    
    āžœ  contrib
    āžœ  views_semantic_tabs git:(4.0.x) curl https://git.drupalcode.org/project/views_semantic_tabs/-/merge_requests/7.diff | git apply -v
      % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                     Dload  Upload   Total   Spent    Left  Speed
    100  5529    0  5529    0     0   8528      0 --:--:-- --:--:-- --:--:--  8532
    Checking patch README.md...
    Checking patch css/views-semantic-tabs.css...
    error: while searching for:
    
    error: patch failed: css/views-semantic-tabs.css:0
    error: css/views-semantic-tabs.css: patch does not apply
    Checking patch src/Plugin/views/style/ViewsSemanticTabs.php...
    Hunk #2 succeeded at 62 (offset -12 lines).
    Checking patch views_semantic_tabs.install...
    Checking patch views_semantic_tabs.module...
    error: while searching for:
    
      // Attach our library.
      $variables['view']->element['#attached']['library'][] = 'views_semantic_tabs/views-semantic-tabs';
       $variables['#attached']['library'][] = 'user/drupal.user';
      // Get first group field selected
      if ($options) {
        $first_group_field = $options['group'];
      }
    
      // Add tabs id and class to main div
      $variables['attributes'] = new Attribute([
        'id' => $unique_id,
        'class' => 'views-semantic-tabs'
      ]);
    
      $variables['default_row_class'] = !empty($options['default_row_class']);
      foreach ($rows as $id => $row) {
        // todo : hide group field from row content
        // Skip building the attributes and content if the field is to be excluded
        // from the display.
        //  $fields[$first_group_field]->options['exclude'] = ture;
        //  if (!empty($fields[$first_group_field]->options['exclude'])) {
        //    continue;
        //  }
    
        // todo : group field value should be plain text
        $field_output = $handler->getField($id, $first_group_field);
        $variables['rows']['group'][] = $field_output;
        $variables['rows'][$id] = [];
    
    error: patch failed: views_semantic_tabs.module:63
    error: views_semantic_tabs.module: patch does not apply
    āžœ  views_semantic_tabs git:(4.0.x)

    Please check and advise.
    Thank you.

  • Pipeline finished with Success
    4 months ago
    Total: 169s
    #259995
  • Status changed to RTBC 4 months ago
  • Pipeline finished with Success
    4 months ago
    Total: 163s
    #260008
  • šŸ‡®šŸ‡¹Italy apaderno Brescia, šŸ‡®šŸ‡¹
Production build 0.71.5 2024