From 32c8746ede0dd6a4cd65d4872e00762f950072e7 Mon Sep 17 00:00:00 2001 From: Owen Voke Date: Sat, 10 Feb 2018 12:07:08 +0000 Subject: [PATCH] phpcs: add page (#1970) * phpcs: add page * phpcs: mention the default coding standard (PEAR) * Fix teensy grammatical mistake * Fix teensy grammatical mistake --- pages/common/phpcs.md | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 pages/common/phpcs.md diff --git a/pages/common/phpcs.md b/pages/common/phpcs.md new file mode 100644 index 000000000..e18aded99 --- /dev/null +++ b/pages/common/phpcs.md @@ -0,0 +1,35 @@ +# phpcs + +> Tokenize PHP, JavaScript and CSS files to detect violations of a defined set of coding standards. + +- Sniff the specified directory for issues (defaults to the PEAR standard): + +`phpcs {{path/to/directory}}` + +- Display a list of installed coding standards: + +`phpcs -i` + +- Specify a coding standard to validate against: + +`phpcs {{path/to/directory}} --standard {{standard}}` + +- Specify file extension(s) to include when sniffing: + +`phpcs {{path/to/directory}} --extensions {{file_extension(s)}}` + +- Specify the format of the output report (e.g. `full`, `xml`, `json`, `summary`): + +`phpcs {{path/to/directory}} --report {{format}}` + +- Set config variables to be used during the process: + +`phpcs {{path/to/directory}} --config-set {{key}} {{value}}` + +- A comma-separated list of files to load before processing: + +`phpcs {{path/to/directory}} --bootstrap {{file(s)}}` + +- Don't recurse into subdirectories: + +`phpcs {{path/to/directory}} -l`