Skip to content

Instantly share code, notes, and snippets.

@bdlangton
Last active May 27, 2022 00:49
Show Gist options
  • Save bdlangton/cd3a26b9987dd676d02cf7c3e35d55e3 to your computer and use it in GitHub Desktop.
Save bdlangton/cd3a26b9987dd676d02cf7c3e35d55e3 to your computer and use it in GitHub Desktop.
phpcs config-set for Drupal using Coder module
# Basic default configs.
phpcs --config-set installed_paths ~/.composer/vendor/drupal/coder/coder_sniffer
phpcs --config-set default_standard Drupal
phpcs --config-set colors 1
# Show all errors.
phpcs --config-set error-severity 1
# Shows warnings, but doesn't return a non-zero return.
phpcs --config-set ignore_warnings_on_exit 1
# Hides some warnings at a lower severity level like "Line exceeds 80 characters".
phpcs --config-set warning-severity 6
# Show current configuration.
phpcs --config-show
# Other useful commands and snippets.
--report=gitblame (shows the author of the git commit of the offending line)
-w (show warnings even if disabled by default)
phpcs --config-set show_warnings 0 (if you want to hide all warnings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment