Skip to content

Commit

Permalink
Merge pull request #6 from barracudanetworks/update-readme
Browse files Browse the repository at this point in the history
Updating installation instructions in README.md
  • Loading branch information
Meowvalent committed Dec 9, 2015
2 parents 0abff8b + 2bba4ef commit d308509
Showing 1 changed file with 16 additions and 6 deletions.
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

0 comments on commit d308509

Please sign in to comment.