|
1 | | -flymake-phpcs.el |
2 | | -================ |
| 1 | +# Note |
| 2 | + |
| 3 | +##### I recommend that you use the [flycheck](https://github.com/flycheck/flycheck). |
| 4 | + |
| 5 | +##### Because, you can run the checker more than one. Of course, including `phpcs`. |
| 6 | + |
| 7 | +# flymake-phpcs.el |
3 | 8 |
|
4 | 9 | PHP CodeSniffer for Emacs with flymake-mode. |
5 | 10 |
|
6 | 11 | To use [PHP CodeSniffer](https://github.com/squizlabs/PHP_CodeSniffer) with Emacs, you will need PHP CodeSniffer installed. |
7 | 12 |
|
8 | 13 | You should be able to run |
9 | 14 |
|
10 | | - $ phpcs |
| 15 | +```sh |
| 16 | +$ phpcs |
| 17 | +``` |
11 | 18 |
|
12 | 19 | and, you'll also need to install [flymake-easy](https://github.com/purcell/flymake-easy). |
13 | 20 |
|
14 | | -Usage |
15 | | -===== |
| 21 | +# Usage |
16 | 22 |
|
17 | 23 | You'll need to add the directory containing `flymake-phpcs.el` to your `load-path`. |
18 | 24 |
|
19 | 25 | If not, also add to your config |
20 | 26 |
|
21 | | - (add-to-list 'load-path "~/.emacs.d/path/to/flymake-phpcs.el") |
| 27 | +```lisp |
| 28 | +(add-to-list 'load-path "~/.emacs.d/path/to/flymake-phpcs.el") |
| 29 | +``` |
22 | 30 |
|
23 | | -Add to your Emacs config |
24 | | ------------------------- |
| 31 | +## Add to your Emacs config |
25 | 32 |
|
26 | | - (require 'flymake-phpcs) |
27 | | - (add-hook 'php-mode-hook 'flymake-phpcs-load) |
| 33 | +```lisp |
| 34 | +(require 'flymake-phpcs) |
| 35 | +(add-hook 'php-mode-hook 'flymake-phpcs-load) |
| 36 | +``` |
28 | 37 |
|
29 | | -How to customize the Coding Standard |
30 | | ------------------------------------- |
| 38 | +## How to customize the Coding Standard |
31 | 39 |
|
32 | | - (custom-set-variables |
33 | | - '(flymake-phpcs-standard "PSR2")) |
| 40 | +```lisp |
| 41 | +(custom-set-variables |
| 42 | + '(flymake-phpcs-standard "PSR2")) |
| 43 | +``` |
34 | 44 |
|
35 | 45 | or |
36 | 46 |
|
37 | | - (custom-set-variables |
38 | | - '(flymake-phpcs-standard "/path/to/MyStandard")) |
| 47 | +```lisp |
| 48 | +(custom-set-variables |
| 49 | + '(flymake-phpcs-standard "/path/to/MyStandard")) |
| 50 | +``` |
39 | 51 |
|
40 | | -phpcs command location |
41 | | ----------------------- |
| 52 | +## phpcs command location |
42 | 53 |
|
43 | 54 | By default, the location of the `phpcs` command is searched. |
44 | 55 |
|
45 | | - (custom-set-variables |
46 | | - '(flymake-phpcs-command "/path/to/phpcs")) |
| 56 | +```lisp |
| 57 | +(custom-set-variables |
| 58 | + '(flymake-phpcs-command "/path/to/phpcs")) |
| 59 | +``` |
47 | 60 |
|
48 | | -Where to create temporary copy |
49 | | ------------------------------- |
| 61 | +## Where to create temporary copy |
50 | 62 |
|
51 | 63 | one of 'tempdir or 'inplace (default). |
52 | 64 |
|
53 | | - (custom-set-variables |
54 | | - '(flymake-phpcs-location 'tempdir)) |
| 65 | +```lisp |
| 66 | +(custom-set-variables |
| 67 | + '(flymake-phpcs-location 'tempdir)) |
| 68 | +``` |
0 commit comments