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>
Comments
Comment #6
jvbrian commentedYou could try these settings.
Comment #7
debrup commentedWorking on it.
Comment #8
debrup commentedChanged 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.
Comment #9
ankitv18 commented@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
Comment #10
debrup commentedReverted the changes as requested by @ankitv18.
Comment #11
utkarsh_33 commentedI 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.
Comment #12
chrisfromredfinComment #13
sayan_k_dutta commented@utkarsh_33 are you working on it now?
Comment #14
utkarsh_33 commentedNo you can take that if you want.
Comment #15
sayan_k_dutta commentedWorking on it.
Comment #16
sayan_k_dutta commentedFixed the phpcs and phpstan issues.
The pipeline is failing for some tests and eslint errors. Someone please look into it.
Comment #20
tim.plunkettRebuilt 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
Comment #21
phenaproximaThis 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. :)
Comment #23
chrisfromredfinwe've come a long way, baby