We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
build:
environment:
php:
version: 7.1
tests:
override:
# Define some variables.
- COMMAND=vendor/bin/phpcs
# Remvoe old analysis results.
- rm -f /tmp/analysis_result_phpcs
# Save version information.
- echo "php_code_sniffer" > "${SCRUTINIZER_VERSION_FILE:-/dev/null}"
- $COMMAND --version >> "${SCRUTINIZER_VERSION_FILE:-/dev/null}"
- VERSION="unknown"
- if [ -f "$SCRUTINIZER_VERSION_FILE" ]; then VERSION=$(cat $SCRUTINIZER_VERSION_FILE); fi
# Print version information.
- echo "Running $COMMAND --report=checkstyle $* ($VERSION)" >&2
# Finally, run PHPCS.
- $COMMAND --config-set installed_paths ../../wp-coding-standards/wpcs/,../../wimg/php-compatibility
- $COMMAND -p src/ tests/ --ignore=tests/perf.php,tests/coverage --extensions=php --colors --report-checkstyle=/tmp/analysis_result_phpcs "$@" >&2 || true
# Print & rmeove results file.
- cat /tmp/analysis_result_phpcs
- rm -f /tmp/analysis_result_phpcs
filter:
excluded_paths:
- 'tests/*'
checks:
php:
side_effects_or_types: false
uppercase_constants: true
simplify_boolean_return: true
return_doc_comments: true
return_doc_comment_if_not_inferrable: true
remove_extra_empty_lines: true
parameter_doc_comments: true
encourage_single_quotes: true
avoid_perl_style_comments: true
avoid_multiple_statements_on_same_line: true
avoid_todo_comments: true
coding_standard:
name: WordPress
coding_style:
php:
indentation:
general:
use_tabs: true
spaces:
around_operators:
concatenation: true
negation: true
build: true