-
Notifications
You must be signed in to change notification settings - Fork 2
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
Use extension list instead of ignore for phpcs #148
Conversation
@@ -228,9 +228,8 @@ phpcs: | |||
# Space-separated list of directories to review. | |||
directories: "${drupal.root}/modules/custom ${drupal.root}/themes/custom ${drupal.root}/profiles/custom" | |||
|
|||
# Comma-separated list of patterns for files and directories to exclude from the |
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.
Existing build.xml files use this property -- so we should keep it, but add a comment saying it will be deprecated in 3.0 (which... we don't have a roadmap really so who knows when that would be...)
@@ -132,7 +132,7 @@ | |||
</phplint> | |||
|
|||
<!-- Run PHP Code Sniffer. --> | |||
<property name="phpcs.command" value="vendor/bin/phpcs --standard=${phpcs.standard} --ignore=${phpcs.ignore} ${phpcs.directories}" /> | |||
<property name="phpcs.command" value="vendor/bin/phpcs --standard=${phpcs.standard} --extensions=${phpcs.extensions} ${phpcs.directories}" /> |
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.
👍
Re: your questions... Including js files in code reviews - I think we should go ahead and add this. Existing projects will need to change their build.xml file to get this change anyway, and we should have this as a default on new projects Removing the |
@becw I restored the default value for |
Due to https://www.drupal.org/project/coder/issues/3074176 ("Allow extensions to be overridden in contrib phpcs.xml file") included in Coder 8.37, the default list of extensions checked by
phpcs
has changed.This removes the
ignore
configuration option and replaces it withextensions
with a default that matches the original list in Coder.Note: This will require re-installing The Build or manually updating
build.xml
on projects.Open questions
Should we add
js
to the list of extensions? The default behavior of Coder 8.3.7 checking JS files generated a lot of errors on one project where it was used, but it could be useful to have in the list.Should we remove
ignore
from the defaults? This would cause projects that don't update theirbuild.xml
to start checking.md
files, so it might be best to leave it in? Depending on the answer to the first question above, we could also add*.js
to the list of ignored extensions to avoid checking files that weren't previously checked.