As at 20 Dec 2022 there are zero PHP coding standards faults on the 8.x-3.x and 4.x branches.

The javascript coding standards errors are covered in the follow-up issue #3331002: [META] Javascript and YML coding standards

The original (very long) issue summary is in the attached text file.

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

akshay_d’s picture

Status: Needs work » Needs review
StatusFileSize
new27.98 KB

Updated the drupal standard please review

ankush_03’s picture

Issue tags: +Srijancontribution2020
Anonymous’s picture

StatusFileSize
new35.14 KB
new6.66 KB

Hello @akshay_d, I tested your patch and found a few more issues.
I attached a patch bellow. Please review and test it.

Kind regards, Denis

ilgnerfagundes’s picture

Status: Needs review » Needs work
StatusFileSize
new187.49 KB

An error occurred while applying the patch

mrinalini9’s picture

Status: Needs work » Needs review
StatusFileSize
new31.72 KB

Rerolled patch #4 for 8.x-3.x, please review.

ankithashetty’s picture

StatusFileSize
new31 KB
new1.55 KB

Updated the patch in #6 to use $this->getRequest() instead of $this->requestStack in src/Form/ModuleFilterUpdateStatusForm.php file as Drupal\Core\Form\FormBase already implements $this->getRequest().

Thanks!

jonathan1055’s picture

Title: Drupal Coding Standarad issues » Drupal coding standards

What we really need here is for automated testing to be enabled on this module. I know there are no functional or kernel tests (yet) but we can run phpcs, csslint, eslint, phpstan if testing was enabled. The module has not had a commit since April 2020, so do we know if it is still actively maintained?

It's a very helpful module, with 226,000 installs, so it would be good to see it continue into Drupal 10.

smustgrave credited mrcdrx.

smustgrave credited PCate.

smustgrave’s picture

Status: Needs review » Needs work

There are several changes going in right now so this will have to be rechecked.

Moving over credit from https://www.drupal.org/project/module_filter/issues/3167690

smustgrave’s picture

Status: Needs work » Fixed

Addressed the conflict

If someone is free please test https://www.drupal.org/project/module_filter/issues/3327754

jonathan1055’s picture

Version: 8.x-3.x-dev » 4.x-dev
Issue summary: View changes
Status: Fixed » Needs work
Issue tags: -Srijancontribution2020
StatusFileSize
new41.01 KB

This is good progress, lots of the coding standards have been fixed, but there are still many remaining. They are all in javascript files, so first we need to verify that the source code is being checked against the correct standards.

Also it would be useful for the project to have a phpcs.xml.dist file, so that local standards checking is easier. We can also adjust which sniffs we want the module to use or ignore.

jonathan1055’s picture

Status: Needs work » Needs review

Second MR to investigate the js warnings and add phpcs.xml.dist

jonathan1055’s picture

StatusFileSize
new131.08 KB

@smustgrave Please could you enable drupalci testing on the 4.x branch, then the new MR can be tested. Currently testing is only set for the 8.x-3.x branch it appears, looking at https://www.drupal.org/node/328228/qa

testing on 4.x

Thanks

smustgrave’s picture

Status: Needs review » Fixed

Merged the MR.

Have added automated tests for 4.x-dev branch.

jonathan1055’s picture

Title: Drupal coding standards » Drupal PHP coding standards
Issue summary: View changes
Related issues: +#3331002: [META] Javascript and YML coding standards

Thanks for the commit and for setting up tests at 4.x

I've raised #3331002: [META] Javascript and YML coding standards as a follow-up for the javascript problems.

jonathan1055’s picture

StatusFileSize
new608 bytes

After adding the phpcs.xml.dist coding standards config, the project is now checking .md files, which it was not before. There's one coding standards error

module_filter/README.md
-------------------------------------------------------------------------------------------------------------
FOUND 0 ERRORS AND 1 WARNING AFFECTING 1 LINE
-------------------------------------------------------------------------------------------------------------
 130 | WARNING | Line exceeds 80 characters; contains 83 characters
     |         | (Drupal.Files.TxtFileLineLength.TooLong)
------------------------------------------------------------------------

It is trivial, but when running phpcs locally to check that a change is clean it always crops up, and just creates a mental overhead to keep ignoring it. It is the only fault reported by phpcs and nice to get it fixed, here's a patch. The links are allowed to extend beyond 80 chars when formatted properly using the [text](url) syntax.

jonathan1055’s picture

The patch result https://www.drupal.org/pift-ci-job/2564371 shows that the patched readme.md is clean, compared to the error reported at the very end of the list on https://www.drupal.org/pift-ci-job/2564331

jonathan1055’s picture

Added related issues.

jonathan1055’s picture

Status: Fixed » Needs review

Setting back to NR for the additional patch in #26
This is important because the coding standards failure is causing branch teest to end with grey "Build Successful" instead of green "Pass"

smustgrave’s picture

Status: Needs review » Fixed

Merged

Status: Fixed » Closed (fixed)

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