-
Notifications
You must be signed in to change notification settings - Fork 10
feat: P002827-13 Add drupal coding standards #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,21 @@ All notable changes to this project will be documented in this file. | |
| The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
| and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
|
||
| ## [3.1.0] | ||
| ### Added | ||
| - Added coding standards for `drupal`. | ||
| - Added packages for `phpstan` for drupal based on [this documentation](https://www.drupal.org/docs/develop/development-tools/phpstan/getting-startedhttps://www.drupal.org/docs/develop/development-tools/phpstan/getting-started) | ||
| - `phpstan/phpstan` | ||
| - `phpstan/extension-installer` | ||
| - `mglaman/phpstan-drupal` | ||
| - `phpstan/phpstan-deprecation-rules` | ||
| - Added package for `phpcs` based on (this documentation)[https://www.drupal.org/docs/extending-drupal/contributed-modules/contributed-module-documentation/coder/installing-coder] | ||
| - `drupal/coder` | ||
| ### Fixed | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Duplicate fixed |
||
| - Mapping for drupal was added to prevent error that file is missing in `templates/mapping/project/drupal`. | ||
| ### Fixed | ||
| - Magento 2 makes use of `phtml` moved triggered by for phpcs from default to magento2 scope. | ||
|
|
||
| ## [3.0.3] | ||
| ### Fixed | ||
| - When running GrumPHP on an environment with the Redis PHP extension installed, it errored with `The package | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -3,8 +3,4 @@ imports: | |
|
|
||
| # Extend git triggers with common Drupal constructs | ||
| parameters: | ||
| git_blacklist.triggered_by: [ 'php', 'js', 'twig' ] | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't you need .module files to be checked for conflict markers, die() calls etc. too if they are just PHP files under the hood? |
||
|
|
||
| # securitychecker.allow_list: | ||
| # - CVE-2002-0121 # Add a jira ticket indicating when this vulnerability will be fixed (update/upgrade will be | ||
| # performed). Within that ticket explain this (new) vulnerability. | ||
| phpcs.triggered_by: [ 'php' , 'module' ] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| imports: | ||
| - resource: 'vendor/youwe/testing-suite/config/pimcore/grumphp.yml' | ||
Anve94 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| - resource: 'vendor/youwe/testing-suite/config/drupal/grumphp.yml' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| <?xml version="1.0"?> | ||
| <ruleset name="YouweDrupal" | ||
| <ruleset name="YouweMagento2" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This seems unintentional. We don't want the ruleset for drupal to be called this, right? :P |
||
| xmlns="http://pmd.sf.net/ruleset/1.0.0" | ||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
| xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd" | ||
|
|
@@ -9,5 +9,7 @@ | |
| <!-- Append arg -s to phpcs to display the name of failed sniffs --> | ||
| <arg value="s"/> | ||
|
|
||
| <!--<exclude-pattern>path/to/exclude/*</exclude-pattern>--> | ||
| </ruleset> | ||
| <exclude-pattern>build</exclude-pattern> | ||
| <exclude-pattern>drush</exclude-pattern> | ||
| <exclude-pattern>.ddev</exclude-pattern> | ||
| </ruleset> | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -5,12 +5,6 @@ includes: | |
| # - phpstan-baseline.neon | ||
|
|
||
| parameters: | ||
| level: 1 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why level 1? It barely does anything. If needed due to issues they can just generate a baseline, no? The other neon configuration files also don't have a level defined. Level 1 just for undefined variables, unknown magic methods and properties on classes with |
||
| paths: | ||
| - web | ||
|
|
||
| # Add any other project folder containing source files, e.g. | ||
| # - tests | ||
|
|
||
| excludePaths: | ||
| # Add any path you want to exclude (note, only files/folders within the configured `paths` are relevant to note here), e.g.: | ||
| # - tests/fixtures/* | ||
| - web/modules/custom | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| {drupal/,}grumphp.yml | ||
| {drupal/,}phpcs.xml | ||
| {drupal/,}phpmd.xml | ||
| {drupal/,}phpstan.neon |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this URL will work