Problem/Motivation

Including a phpcs.xml.dist would assist in running phpcs locally before pushing.

Proposed resolution

The usual phpxml.cs.dist that gets downloaded with ddev-drupal-contrib works OK, but I think there's a few additions we need, mostly just the `exclude-patterns`:

<?xml version="1.0" encoding="UTF-8"?>
<ruleset name="drupal-project">
  <description>Default PHP CodeSniffer configuration for Drupal project.</description>
  <rule ref="vendor/drupal/coder/coder_sniffer/Drupal/ruleset.xml"/>
  <arg name="extensions" value="php,inc,module,install,info,test,profile,theme"/>
  <exclude-pattern>\.ddev</exclude-pattern>
  <exclude-pattern>sveltejs/node_modules</exclude-pattern>
</ruleset>
CommentFileSizeAuthor
#6 phpcs.xml_.txt1.03 KBjvbrian
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

chrisfromredfin created an issue. See original summary.

nexusnovaz made their first commit to this issue’s fork.

ankitv18 made their first commit to this issue’s fork.

zaryab_drupal made their first commit to this issue’s fork.

jvbrian’s picture

Status: Active » Needs review
StatusFileSize
new1.03 KB

You could try these settings.

debrup’s picture

Assigned: Unassigned » debrup

Working on it.

debrup’s picture

Changed the phpcs.xml.dist file according to suggestion and also to pass the GitLab pipelines.
@chrisfromredfin @jvbrian Please let me know if the changes are satisfactory or not.

ankitv18’s picture

Status: Needs review » Needs work

@debrup your both commits are totally irrelevant. Please do revert those commits.
Phpcs failures needs to be to address separate ~~ objective of this issue to add the phpcs.xml.dist file

debrup’s picture

Assigned: debrup » Unassigned
Status: Needs work » Needs review

Reverted the changes as requested by @ankitv18.

utkarsh_33’s picture

Status: Needs review » Needs work

I think we should also fix the problems with the coding standards in PB in the scope of the issue.I'll take this and do that.If someone thinks that it should be done as a separate issue then I'll revert my changes in the commit that I will push.

chrisfromredfin’s picture

Title: Include phpcs.xml.dist » Include phpcs.xml.dist & address standards errors
Assigned: Unassigned » utkarsh_33
Issue tags: -Novice +core-mvp, +stable blocker
sayan_k_dutta’s picture

@utkarsh_33 are you working on it now?

utkarsh_33’s picture

Assigned: utkarsh_33 » Unassigned

No you can take that if you want.

sayan_k_dutta’s picture

Assigned: Unassigned » sayan_k_dutta

Working on it.

sayan_k_dutta’s picture

Assigned: sayan_k_dutta » Unassigned

Fixed the phpcs and phpstan issues.
The pipeline is failing for some tests and eslint errors. Someone please look into it.

tim.plunkett changed the visibility of the branch 2.0.x to hidden.

ankitv18 changed the visibility of the branch 3477335-include-phpcs.xml.dist to hidden.

tim.plunkett’s picture

Status: Needs work » Needs review

Rebuilt this based on how XB is handling it, with @todos pointing to #3452183: Only run linting jobs if the files changed make sense for the job

phenaproxima’s picture

Status: Needs review » Reviewed & tested by the community

This seems like great clean-up and it will help us actually catch bugs. I didn't review the .gitlab-ci.yml changes in depth, to be honest, but I'm not particularly concerned about those anyway. The pipeline looks like it's running, and passing, and that seems right to me. I don't really feel like blocking quality improvements. :)

chrisfromredfin’s picture

Status: Reviewed & tested by the community » Fixed

we've come a long way, baby

Status: Fixed » Closed (fixed)

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