You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-3Lines changed: 25 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,15 @@ You can also run each command separately on demand:
32
32
-`:Phpmd` - run mess detector (will ask for a rule XML file if not set)
33
33
-`:Phpcc` - show code coverage (will ask for a clover XML file if not set)
34
34
35
-
If you generate clover code coverage reports with your tests, you can toggle markers to show which lines are covered and which aren't. You can run the command once using `Phpcs` as shown above, or you can configure it to load the markers every time you open a new file - see the configuration section for more information.
35
+
### Code Coverage
36
+
37
+
If you generate clover code coverage reports with your tests, you can toggle markers to show which lines are covered and which aren't. You can run the command once using `Phpcc` as shown above, or you can configure it to load the markers every time you open a new file - see the configuration section for more information.
38
+
39
+
You can also toggle code coverage (to stop it automatically running on opening a file) with:
40
+
41
+
```vim
42
+
<Leader>qc
43
+
```
36
44
37
45
### Installation
38
46
@@ -51,7 +59,9 @@ If you aren't using vundle, you will have to extract the files in each folder to
51
59
52
60
Each command has it's own configuration settings, which allow you to get the functionality you want.
53
61
54
-
PHP mess detecotr needs a ruleset XML file (see the [mess detector website][2] for more information) to run, which you will be prompted for the first time the command runs. However, it's much easier to just specify it in your *.vimrc* file:
62
+
#### PHP, Mess Detector and Codesniffer
63
+
64
+
PHP mess detector needs a ruleset XML file (see the [mess detector website][2] for more information) to run, which you will be prompted for the first time the command runs. However, it's much easier to just specify it in your *.vimrc* file:
55
65
56
66
```vim
57
67
let g:phpqa_messdetector_ruleset = "/path/to/phpmd.xml"
@@ -93,10 +103,22 @@ let g:phpqa_codesniffer_autorun = 0
93
103
let g:phpqa_codecoverage_autorun = 1
94
104
```
95
105
96
-
For code coverage, you can specify a clover XML file to stop the prompt:
106
+
By default, the location list window will open when mess detector/codesniffer violations are found. You can stop this happening by setting this option:
107
+
108
+
```vim
109
+
" Stop the location list opening automatically
110
+
let g:phpqa_open_loc = 0
111
+
```
112
+
113
+
#### Code Coverage Configuration
114
+
115
+
For code coverage, you can specify a clover XML file to stop the prompt appearing each time, and choose to only show markers for lines that aren't covered - by default both covered and uncovered code have markers. Not showing covered line markers is likely to speed things up noticeably when moving between files.
97
116
98
117
```vim
118
+
" Clover code coverage XML file
99
119
let g:phpqa_codecoverage_file = "/path/to/clover.xml"
120
+
" Show markers for lines that ARE covered by tests (default = 1)
0 commit comments