瀏覽代碼

phpcs: add page (#1970)

* phpcs: add page

* phpcs: mention the default coding standard (PEAR)

* Fix teensy grammatical mistake

* Fix teensy grammatical mistake
Owen Voke 7 年之前
父節點
當前提交
32c8746ede
共有 1 個文件被更改,包括 35 次插入0 次删除
  1. 35 0
      pages/common/phpcs.md

+ 35 - 0
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`