-
Notifications
You must be signed in to change notification settings - Fork 12
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
feat: Allow custom phpcs coding standard #149
base: main
Are you sure you want to change the base?
Conversation
working-directory: standard | ||
run: composer require dealerdirect/phpcodesniffer-composer-installer | ||
|
||
- name: Install Magento2 Coding Standard |
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.
Are these two things (the custom standard install and the Magento standard install) mutually exclusive? Wouldn't custom_standard
have a dep on Magento?
shell: bash | ||
working-directory: standard | ||
run: composer require "magento/magento-coding-standard:${{ inputs.version || '*' }}" | ||
|
||
- name: Register Coding Standard | ||
- name: Install Custom Coding Standard |
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 foresee two situations for this action to be used:
- Extensions
- Stores
both of them will often have this extra repo already included in require-dev
. Should we be the ones to install this? It seems like an unnecessary network IO if it is already installed. Perhaps #133 applies to this as well?
I don't personally think custom_coding_standard_repo
is a good idea, though I like the ability to change the standard via coding_standard
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Currently, when
mage-os/github-actions/coding-standard
is used the Magento 2 coding standard is always used.What is the new behavior?
If we want to make this the default PHPCS coding standard workflow we should add an option to specify a custom coding standard. This is usefull for vendors who want to modify/add sniffs to the official Magento 2 coding standards.
For example, we have excluded some rules
You can see the new options in action here
In addition to this, i've also added
dealerdirect/phpcodesniffer-composer-installer
, so all of the available phpcs standards in the project are automatically registered. The "Register Coding Standard" step became redundant and was removed.Does this PR introduce a breaking change?