Fix the issues reported by PHPCS

Created on 18 April 2023, over 1 year ago

Problem/Motivation

FILE: /var/www/html/contribution/drupal10/web/modules/contrib/oswald/js/oswald.js
---------------------------------------------------------------------------------
FOUND 4 ERRORS AFFECTING 3 LINES
---------------------------------------------------------------------------------
26 | ERROR | [x] Expected 1 newline at end of file; 5 found
29 | ERROR | [ ] More than 2 empty lines are not allowed
30 | ERROR | [ ] More than 2 empty lines are not allowed
30 | ERROR | [x] Additional whitespace found at end of file
---------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
---------------------------------------------------------------------------------

FILE: ...www/html/contribution/drupal10/web/modules/contrib/oswald/oswald.libraries.yml
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
9 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: ...l/contribution/drupal10/web/modules/contrib/oswald/src/Form/ConfigTestForm.php
------------------------------------------------------------------------------------
FOUND 2 ERRORS AND 2 WARNINGS AFFECTING 4 LINES
------------------------------------------------------------------------------------
68 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
72 | WARNING | [ ] Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
74 | ERROR | [x] Functions must not contain multiple empty lines in a row; found
| | 2 empty lines
83 | ERROR | [x] Functions must not contain multiple empty lines in a row; found
| | 2 empty lines
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 2 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: .../html/contribution/drupal10/web/modules/contrib/oswald/src/Form/ConfigForm.php
------------------------------------------------------------------------------------
FOUND 3 ERRORS AND 5 WARNINGS AFFECTING 7 LINES
------------------------------------------------------------------------------------
16 | WARNING | [ ] The class short comment should describe what the class does
| | and not simply repeat the class name
76 | WARNING | [ ] t() calls should be avoided in classes, use
| | \Drupal\Core\StringTranslation\StringTranslationTrait and
| | $this->t() instead
79 | WARNING | [ ] Translatable strings must not begin or end with white spaces,
| | use placeholders with t() for variables
103 | ERROR | [x] No space found before comment text; expected "//
| | 'selected_only' => $this->t('Selected paths only')," but found
| | "//'selected_only' => $this->t('Selected paths only'),"
104 | ERROR | [x] No space found before comment text; expected "//
| | 'selected_not' => $this->t('Everywhere except selected
| | paths')," but found "//'selected_not' => $this->t('Everywhere
| | except selected paths'),"
120 | WARNING | [ ] #options values usually have to run through t() for
| | translation
143 | WARNING | [ ] Line exceeds 80 characters; contains 84 characters
143 | ERROR | [x] No space found before comment text; expected "//
| | ->set('content_type_filters',
| | $form_state->getValue('content_type_filters'))" but found
| | "//->set('content_type_filters',
| | $form_state->getValue('content_type_filters'))"
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 3 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: /var/www/html/contribution/drupal10/web/modules/contrib/oswald/oswald.module
------------------------------------------------------------------------------------
FOUND 7 ERRORS AFFECTING 7 LINES
------------------------------------------------------------------------------------
31 | ERROR | [x] Functions must not contain multiple empty lines in a row; found 2
| | empty lines
37 | ERROR | [x] Namespaced classes/interfaces/traits should be referenced with
| | use statements
61 | ERROR | [ ] Doc comment is empty
64 | ERROR | [x] Expected 1 space before opening brace; found 0
70 | ERROR | [x] Case breaking statements must be followed by a single blank line
78 | ERROR | [ ] Doc comment is empty
89 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: ...ww/html/contribution/drupal10/web/modules/contrib/oswald/oswald.links.menu.yml
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
13 | ERROR | [x] Expected 1 newline at end of file; 2 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: ...r/www/html/contribution/drupal10/web/modules/contrib/oswald/oswald.routing.yml
------------------------------------------------------------------------------------
FOUND 1 ERROR AFFECTING 1 LINE
------------------------------------------------------------------------------------
21 | ERROR | [x] Expected 1 newline at end of file; 0 found
------------------------------------------------------------------------------------
PHPCBF CAN FIX THE 1 MARKED SNIFF VIOLATIONS AUTOMATICALLY
------------------------------------------------------------------------------------

FILE: /var/www/html/contribution/drupal10/web/modules/contrib/oswald/oswald.info.yml
------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
------------------------------------------------------------------------------------
9 | WARNING | All dependencies must be prefixed with the project name, for example
| | "drupal:"
------------------------------------------------------------------------------------

Time: 507ms; 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 oswald/

Proposed resolution

Fix all the issues for Drupal and DrupalPractice standards

Remaining tasks

Patch Review.

📌 Task
Status

Closed: won't fix

Version

2.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
  • Assigned to akshaydalvi212
  • 🇮🇳India akshaydalvi212

    hey @urvashi_vora,
    Thanks for the patch. I will review the it.

  • Issue was unassigned.
  • 🇮🇳India akshaydalvi212

    Reviewed the patch it gets smoothly applied and works fine.
    providing the screenshot before and after the patch is applied.
    hence shifting the issue status to RTBC.

  • Status changed to Closed: won't fix over 1 year ago
  • 🇧🇪Belgium BramDriesen Belgium 🇧🇪

    To discourage people from adding issues, patches or MRs that appear to seek easy commit credits I will not be merging these types of requests. Generally, these tickets create unnecessary noise and maintainer workload.
    If however you feel I'm unfairly confused a meaningful contribution with attempts motivated by earning commit credit, please respond and let me know. I don't want to stand in the way of genuine contribution, only to preserve the valuable time and energy available in the community for meaningful efforts. If I've got this wrong, I want to hear from you.

    Furthermore the patch is created for a very outdated and not even supported branch. The work which was done here was unfortunately a waste of time and effort.

Production build 0.71.5 2024