Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update the readme file. #616

Merged
merged 1 commit into from
Jul 19, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 31 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,22 +67,25 @@ Run the `phpcs` command line tool on a given file or directory, for example:
Will result in following output:

--------------------------------------------------------------------------------
FOUND 13 ERROR(S) AFFECTING 7 LINE(S)
FOUND 8 ERRORS AND 2 WARNINGS AFFECTING 7 LINES
--------------------------------------------------------------------------------
1 | ERROR | End of line character is invalid; expected "\n" but found "\r\n"
22 | ERROR | No space after opening parenthesis of function prohibited
22 | ERROR | No space before closing parenthesis of function prohibited
26 | ERROR | No space before closing parenthesis of function prohibited
31 | ERROR | No space after opening parenthesis of function prohibited
31 | ERROR | No space before closing parenthesis of function prohibited
31 | ERROR | No space after opening parenthesis of function prohibited
31 | ERROR | No space before closing parenthesis of function prohibited
34 | ERROR | No space after opening parenthesis of function prohibited
34 | ERROR | No space before closing parenthesis of function prohibited
55 | ERROR | Detected usage of a non-validated input variable: $_SERVER
55 | ERROR | Detected usage of a non-sanitized input variable: $_SERVER
70 | ERROR | String "Create a Configuration File" does not require double
| | quotes; use single quotes instead
1 | ERROR | [x] End of line character is invalid; expected "\n" but found "\r\n"
36 | ERROR | [x] Expected 1 spaces before closing bracket; 0 found
41 | WARNING | [ ] Silencing errors is discouraged
41 | WARNING | [ ] Silencing errors is discouraged
48 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
| | question marks
48 | ERROR | [x] There must be no blank line following an inline comment
76 | ERROR | [ ] Inline comments must end in full-stops, exclamation marks, or
| | question marks
92 | ERROR | [x] String "Create a Configuration File" does not require double
| | quotes; use single quotes instead
94 | ERROR | [ ] Expected next thing to be an escaping function (see Codex for
| | 'Data Validation'), not '$die'
94 | ERROR | [ ] Expected next thing to be an escaping function (see Codex for
| | 'Data Validation'), not '__'
--------------------------------------------------------------------------------
PHPCBF CAN FIX THE 4 MARKED SNIFF VIOLATIONS AUTOMATICALLY
--------------------------------------------------------------------------------

### PhpStorm
Expand Down Expand Up @@ -135,10 +138,22 @@ You can use the following as standard names when invoking `phpcs` to select snif
- includes `WordPress-Core`


### Using custom ruleset
### Using a custom ruleset

If you need to further customize selection of sniffs for your project — you can create custom `ruleset.xml` standard. See provided [project.ruleset.xml.example](project.ruleset.xml.example) file and [fully annotated example](https://github.com/squizlabs/PHP_CodeSniffer/wiki/Annotated-ruleset.xml) in PHP_CodeSniffer documentation.

### Recommended additional rulesets

The [PHPCompatibility](https://github.com/wimg/PHPCompatibility) ruleset comes highly recommended.
The [PHPCompatibility](https://github.com/wimg/PHPCompatibility) sniffs are designed to analyse your code for cross-PHP version compatibility.
Install it as a separate ruleset and either run it separately against your code or add it to your custom ruleset.


## Fixing errors or whitelisting them

You can find information on how to deal with some of the more frequent issues in the [wiki](https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/wiki).


## Contributing

See [CONTRIBUTING](CONTRIBUTING.md), including information about [unit testing](CONTRIBUTING.md#unit-testing).
Expand Down