Skip to content
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

Add support for phpcs #111

Closed
wants to merge 9 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion runners/phpcs/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@

set -e $DRUPAL_TI_DEBUG

ARGS=( $DRUPAL_TI_PHPCS_ARGS )
if [[ -n $DRUPAL_TI_PHPCS_ARGS ]]; then
ARGS=( $DRUPAL_TI_PHPCS_ARGS )
else
ARGS=(
"--colors"
"--standard=Drupal,DrupalPractice"
"--extensions=php,module,inc,install,test,profile,theme,css,info,txt,md"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure you should lint css files :D

"--ignore=node_modules,bower_components,vendor"
"${TRAVIS_BUILD_DIR}"
)
fi

$HOME/.composer/vendor/bin/phpcs "${ARGS[@]}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about also using phpcsp (Code Sniffer Drupal Practice) ?

ARGS=( $DRUPAL_TI_PHPCSP_ARGS )
$HOME/.composer/vendor/bin/phpcsp "${ARGS[@]}"

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not familiar with the phpcsp binary. Is there something I can read to learn about it?

I made a couple of modifications to provide default arguments and to make it easier to invoke drupal/coder standards.