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

Updating installation instructions in README.md #6

Merged
merged 2 commits into from
Dec 9, 2015
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
22 changes: 16 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,10 @@ INSTALLATION
1. Install [PHP_CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer#installation)

2. Install your editor plugin.
- For Sublime Text, this is `Phpcs` in Package Control.
- For Sublime Text, install `Phpcs` under Package Control
- For Atom, install `linter` and `linter-phpcs`
- For vim, install `scrooloose/syntastic`
- For PhpStorm, you do not need to install anything extra

SETUP
-----
Expand All @@ -19,14 +21,17 @@ When running `phpcs` or `phpcbf` point it to the location where you cloned this

Below are some sample configurations for various editors:

### Sublime Text 2 & 3
There is an example .sublime-project file for Sublime Text in the config directory. You'll need to rename it to .sublime-project and place it in your repo directories.
### Sublime Text 3

*Note*: Sublime Text 2 is unsupported.

After installing the `Phpcs` package, go to Sublime Text > Preferences > Package Settings > PHP Code Sniffer > Settings - User. Then paste the following configuration, updating the paths as necessary.

{
"phpcs_additional_args": {

// self-explanatory
"--standard": "/absolute/path/to/commonstandards/Barracuda/ruleset.xml",
"--standard": "/absolute/path/to/commonstandards/PHP_CodeSniffer/Barracuda/ruleset.xml",

// this allows us to continue to use tabs (part of our standard)
"--tab-width": "4",
Expand All @@ -40,6 +45,7 @@ There is an example .sublime-project file for Sublime Text in the config directo
}

### Atom

For Atom, the following configuration should be added to ~/.atom/Config.cson. It can also be configured in the `linter-phpcs` settings page.

"linter-phpcs":
Expand All @@ -49,9 +55,12 @@ For Atom, the following configuration should be added to ~/.atom/Config.cson. It
warningSeverity: 0

### vim

It is suggested to use [Syntastic](https://github.com/scrooloose/syntastic) for vim.
This supports phpcs for php checking as well as many other languages
The following config should do php linting as well as code sniffing

This supports many syntax and coding style checkers, including phpcs for PHP.

Add the following to your .vimrc, updating paths as necessary:

" Use the following for checking php files
let g:syntastic_php_checkers = ['php', 'phpcs']
Expand All @@ -61,6 +70,7 @@ The following config should do php linting as well as code sniffing
let g:syntastic_php_phpcs_args="--standard=/path/to/common-standards/Barracuda"

### PhpStorm

To get set up just follow the instructions at (https://confluence.jetbrains.com/display/PhpStorm/PHP+Code+Sniffer+in+PhpStorm)

In summary the steps are:
Expand Down