From 947a64844a2a28b3bfbe568ace793c6881cfae8c Mon Sep 17 00:00:00 2001 From: Rumperuu Date: Sun, 21 Feb 2021 11:20:11 +0000 Subject: [PATCH] Add more PHPCS tips --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 6bd1e8d..2ff05d5 100644 --- a/README.md +++ b/README.md @@ -23,8 +23,10 @@ Featured on [wpmudev](http://premium.wpmudev.org/blog/12-surprisingly-useful-wor ## Checking WP Coding Standard Compliance 1. Run PHP_CodeSniffer on the file(s) you want to check (`./vendor/bin/phpcs --standard="WordPress" --colors --encoding=utf-8 -n -p `) -1. (If applicable) run the PHP Code Beautifier and Formatter to attempt to automatically fix any errors (`./vendor/bin/phpcbf --standard="WordPress" --encoding=utf-8 -n -p `) - - You can run either across the entire project by adding the argument `--ignore=*/vendor/*` and targetting the file `*/**/*.php` +1. (If applicable) run the PHP Code Beautifier and Formatter to attempt to automatically fix any errors (`./vendor/bin/phpcbf --standard="WordPress" --encoding=utf-8 -p `) + - Add the `-n` flag to ignore warnings (i.e., show only errors) + - Add the `-s` flag to show sniff codes (used for disabling errors in the code with `phpcs disable:` — MAKE SURE THAT YOU HAVE `phpcs enable` AT THE EARLIEST POINT POSSIBLE, and provide a justification for disabling the sniff code) + - You can run either across the entire project by adding the argument `--ignore=*/vendor/*` and targetting the file `./*.php ./**/*.php` ## Updating Documentation