Problem/Motivation

The .gitlab-ci.yml applies a subset of coding standards that are tested in the pipeline. As a result, there is a mismatch in code editors when using the Drupal coding standard supplied by drupal/coder.

Proposed resolution

Use gitlab CI defaults for phpcs

Remaining tasks

  1. Write a merge request
  2. Review
  3. Commit

User interface changes

None

API changes

None

Data model changes

None

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

idebr created an issue. See original summary.

idebr’s picture

Status: Active » Needs review

The merge request applies gitlab CI defaults for phpcs

alexpott’s picture

I'm not convinced we should be using drupal/coder's standards out of the box. Using core's standards mean we only ever adopt rules that actually work for the whole of core. Unfortunately the shipped Drupal standards contain things like the array declaration long line standard which makes code worse and less readable. #3185082-12: Drupal.Arrays.Array.LongLineDeclaration make me write less readable code kind of lays this all out. But the whole line length limit stuff as shown by the changes here to SettingsForm makes for worse code.

idebr’s picture

Status: Needs review » Needs work

Gitlab CI will pick up a custom phpcs configuration, as do IDEs like PHPStorm. Is Drupal.Arrays.Array.LongLineDeclaration the only rule that should not be enforced?

See webform for reference: https://git.drupalcode.org/project/webform/-/blob/6.3.x/phpcs.xml?ref_ty...

alexpott’s picture

Yep I am aware of that, I just like that core's rules get worked on and that core applies them so I know they are good. Also I find core's ruleset very easy to run locally...

composer run phpcs --modules/content_lock

idebr’s picture

Title: Use gitlab CI defaults for phpcs » Formalize phpcs ruleset
Status: Needs work » Needs review

The merge request now include a custom Content Lock phpcs ruleset that excludes Drupal.Arrays.Array.LongLineDeclaration

Changes for Drupal.Arrays.Array.LongLineDeclaration were reverted.

alexpott’s picture

alexpott’s picture

Status: Needs review » Reviewed & tested by the community

  • alexpott committed 5120894c on 3.x authored by idebr
    Issue #3529824 by idebr, alexpott: Formalize phpcs ruleset
    
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Status: Fixed » Closed (fixed)

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