|
1 | 1 | // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html |
2 | 2 |
|
3 | | -exports[`PLUGIN collect report with eslint-plugin NPM package > should run ESLint plugin for flat config and create report.json 1`] = ` |
| 3 | +exports[`PLUGIN collect report with doc-coverage-plugin NPM package > should run Doc Coverage plugin for Angular example dir and create report.json 1`] = ` |
4 | 4 | { |
5 | 5 | "packageName": "@code-pushup/core", |
6 | 6 | "plugins": [ |
7 | 7 | { |
8 | 8 | "audits": [ |
9 | 9 | { |
10 | | - "description": "ESLint rule **eqeqeq**.", |
| 10 | + "description": "Documentation coverage of enums", |
| 11 | + "details": { |
| 12 | + "issues": [], |
| 13 | + }, |
| 14 | + "displayValue": "0 undocumented enums", |
| 15 | + "score": 1, |
| 16 | + "slug": "enums-coverage", |
| 17 | + "title": "Enums coverage", |
| 18 | + "value": 0, |
| 19 | + }, |
| 20 | + { |
| 21 | + "description": "Documentation coverage of interfaces", |
| 22 | + "details": { |
| 23 | + "issues": [], |
| 24 | + }, |
| 25 | + "displayValue": "0 undocumented interfaces", |
| 26 | + "score": 1, |
| 27 | + "slug": "interfaces-coverage", |
| 28 | + "title": "Interfaces coverage", |
| 29 | + "value": 0, |
| 30 | + }, |
| 31 | + { |
| 32 | + "description": "Documentation coverage of types", |
| 33 | + "details": { |
| 34 | + "issues": [], |
| 35 | + }, |
| 36 | + "displayValue": "0 undocumented types", |
| 37 | + "score": 1, |
| 38 | + "slug": "types-coverage", |
| 39 | + "title": "Types coverage", |
| 40 | + "value": 0, |
| 41 | + }, |
| 42 | + { |
| 43 | + "description": "Documentation coverage of functions", |
11 | 44 | "details": { |
12 | 45 | "issues": [ |
13 | 46 | { |
14 | | - "message": "Expected '===' and instead saw '=='.", |
15 | | - "severity": "error", |
| 47 | + "message": "Missing documentation", |
| 48 | + "severity": "warning", |
| 49 | + "source": { |
| 50 | + "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/angular/src/app.component.spec.ts", |
| 51 | + "position": { |
| 52 | + "startLine": 1, |
| 53 | + }, |
| 54 | + }, |
| 55 | + }, |
| 56 | + { |
| 57 | + "message": "Missing documentation", |
| 58 | + "severity": "warning", |
16 | 59 | "source": { |
17 | | - "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/flat-config/src/index.js", |
| 60 | + "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/angular/src/map-event.function.ts", |
18 | 61 | "position": { |
19 | | - "endColumn": 15, |
20 | | - "endLine": 6, |
21 | | - "startColumn": 13, |
22 | | - "startLine": 6, |
| 62 | + "startLine": 3, |
23 | 63 | }, |
24 | 64 | }, |
25 | 65 | }, |
26 | 66 | ], |
27 | 67 | }, |
28 | | - "displayValue": "1 error", |
29 | | - "docsUrl": "https://eslint.org/docs/latest/rules/eqeqeq", |
30 | | - "score": 0, |
31 | | - "slug": "eqeqeq", |
32 | | - "title": "Require the use of \`===\` and \`!==\`", |
33 | | - "value": 1, |
| 68 | + "displayValue": "2 undocumented functions", |
| 69 | + "score": 0.3333, |
| 70 | + "slug": "functions-coverage", |
| 71 | + "title": "Functions coverage", |
| 72 | + "value": 2, |
34 | 73 | }, |
35 | 74 | { |
36 | | - "description": "ESLint rule **max-lines**. |
37 | | -
|
38 | | -Custom options: |
39 | | -
|
40 | | -\`\`\`json |
41 | | -100 |
42 | | -\`\`\`", |
43 | | - "details": { |
44 | | - "issues": [], |
45 | | - }, |
46 | | - "displayValue": "passed", |
47 | | - "docsUrl": "https://eslint.org/docs/latest/rules/max-lines", |
48 | | - "score": 1, |
49 | | - "slug": "max-lines-71b54366cb01f77b", |
50 | | - "title": "Enforce a maximum number of lines per file", |
51 | | - "value": 0, |
52 | | - }, |
53 | | - { |
54 | | - "description": "ESLint rule **no-unused-vars**.", |
| 75 | + "description": "Documentation coverage of variables", |
55 | 76 | "details": { |
56 | 77 | "issues": [ |
57 | 78 | { |
58 | | - "message": "'unusedFn' is defined but never used.", |
| 79 | + "message": "Missing documentation", |
59 | 80 | "severity": "warning", |
60 | 81 | "source": { |
61 | | - "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/flat-config/src/index.js", |
| 82 | + "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/angular/src/map-event.function.ts", |
62 | 83 | "position": { |
63 | | - "endColumn": 18, |
64 | | - "endLine": 1, |
65 | | - "startColumn": 10, |
66 | 84 | "startLine": 1, |
67 | 85 | }, |
68 | 86 | }, |
69 | 87 | }, |
70 | 88 | ], |
71 | 89 | }, |
72 | | - "displayValue": "1 warning", |
73 | | - "docsUrl": "https://eslint.org/docs/latest/rules/no-unused-vars", |
| 90 | + "displayValue": "1 undocumented variables", |
74 | 91 | "score": 0, |
75 | | - "slug": "no-unused-vars", |
76 | | - "title": "Disallow unused variables", |
| 92 | + "slug": "variables-coverage", |
| 93 | + "title": "Variables coverage", |
77 | 94 | "value": 1, |
78 | 95 | }, |
79 | | - ], |
80 | | - "description": "Official Code PushUp ESLint plugin", |
81 | | - "docsUrl": "https://www.npmjs.com/package/@code-pushup/eslint-plugin", |
82 | | - "groups": [ |
83 | | - { |
84 | | - "description": "Code that either will cause an error or may cause confusing behavior. Developers should consider this a high priority to resolve.", |
85 | | - "refs": [ |
86 | | - { |
87 | | - "slug": "no-unused-vars", |
88 | | - "weight": 1, |
89 | | - }, |
90 | | - ], |
91 | | - "slug": "problems", |
92 | | - "title": "Problems", |
93 | | - }, |
94 | 96 | { |
95 | | - "description": "Something that could be done in a better way but no errors will occur if the code isn't changed.", |
96 | | - "refs": [ |
97 | | - { |
98 | | - "slug": "eqeqeq", |
99 | | - "weight": 1, |
100 | | - }, |
101 | | - { |
102 | | - "slug": "max-lines-71b54366cb01f77b", |
103 | | - "weight": 1, |
104 | | - }, |
105 | | - ], |
106 | | - "slug": "suggestions", |
107 | | - "title": "Suggestions", |
| 97 | + "description": "Documentation coverage of classes", |
| 98 | + "details": { |
| 99 | + "issues": [], |
| 100 | + }, |
| 101 | + "displayValue": "0 undocumented classes", |
| 102 | + "score": 1, |
| 103 | + "slug": "classes-coverage", |
| 104 | + "title": "Classes coverage", |
| 105 | + "value": 0, |
108 | 106 | }, |
109 | | - ], |
110 | | - "icon": "eslint", |
111 | | - "packageName": "@code-pushup/eslint-plugin", |
112 | | - "slug": "eslint", |
113 | | - "title": "ESLint", |
114 | | - }, |
115 | | - ], |
116 | | -} |
117 | | -`; |
118 | | -
|
119 | | -exports[`PLUGIN collect report with eslint-plugin NPM package > should run ESLint plugin for legacy config and create report.json 1`] = ` |
120 | | -{ |
121 | | - "packageName": "@code-pushup/core", |
122 | | - "plugins": [ |
123 | | - { |
124 | | - "audits": [ |
125 | 107 | { |
126 | | - "description": "ESLint rule **no-unused-vars**.", |
| 108 | + "description": "Documentation coverage of methods", |
127 | 109 | "details": { |
128 | 110 | "issues": [ |
129 | 111 | { |
130 | | - "message": "'unusedFn' is defined but never used.", |
131 | | - "severity": "error", |
| 112 | + "message": "Missing documentation", |
| 113 | + "severity": "warning", |
132 | 114 | "source": { |
133 | | - "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/legacy-config/src/index.js", |
| 115 | + "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/angular/src/app.component.ts", |
134 | 116 | "position": { |
135 | | - "endColumn": 18, |
136 | | - "endLine": 1, |
137 | | - "startColumn": 10, |
138 | | - "startLine": 1, |
| 117 | + "startLine": 15, |
139 | 118 | }, |
140 | 119 | }, |
141 | 120 | }, |
142 | 121 | ], |
143 | 122 | }, |
144 | | - "displayValue": "1 error", |
145 | | - "docsUrl": "https://eslint.org/docs/latest/rules/no-unused-vars", |
146 | | - "score": 0, |
147 | | - "slug": "no-unused-vars", |
148 | | - "title": "Disallow unused variables", |
| 123 | + "displayValue": "1 undocumented methods", |
| 124 | + "score": 0.5, |
| 125 | + "slug": "methods-coverage", |
| 126 | + "title": "Methods coverage", |
149 | 127 | "value": 1, |
150 | 128 | }, |
151 | 129 | { |
152 | | - "description": "ESLint rule **no-console**.", |
| 130 | + "description": "Documentation coverage of properties", |
153 | 131 | "details": { |
154 | 132 | "issues": [ |
155 | 133 | { |
156 | | - "message": "Unexpected console statement.", |
| 134 | + "message": "Missing documentation", |
157 | 135 | "severity": "warning", |
158 | 136 | "source": { |
159 | | - "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/legacy-config/src/index.js", |
| 137 | + "file": "tmp/e2e/plugin-doc-coverage-e2e/__test__/angular/src/app.component.ts", |
160 | 138 | "position": { |
161 | | - "endColumn": 14, |
162 | | - "endLine": 5, |
163 | | - "startColumn": 3, |
164 | 139 | "startLine": 5, |
165 | 140 | }, |
166 | 141 | }, |
167 | 142 | }, |
168 | 143 | ], |
169 | 144 | }, |
170 | | - "displayValue": "1 warning", |
171 | | - "docsUrl": "https://eslint.org/docs/latest/rules/no-console", |
| 145 | + "displayValue": "1 undocumented properties", |
172 | 146 | "score": 0, |
173 | | - "slug": "no-console", |
174 | | - "title": "Disallow the use of \`console\`", |
| 147 | + "slug": "properties-coverage", |
| 148 | + "title": "Properties coverage", |
175 | 149 | "value": 1, |
176 | 150 | }, |
177 | | - { |
178 | | - "description": "ESLint rule **no-undef**.", |
179 | | - "details": { |
180 | | - "issues": [], |
181 | | - }, |
182 | | - "displayValue": "passed", |
183 | | - "docsUrl": "https://eslint.org/docs/latest/rules/no-undef", |
184 | | - "score": 1, |
185 | | - "slug": "no-undef", |
186 | | - "title": "Disallow the use of undeclared variables unless mentioned in \`/*global */\` comments", |
187 | | - "value": 0, |
188 | | - }, |
189 | 151 | ], |
190 | | - "description": "Official Code PushUp ESLint plugin", |
191 | | - "docsUrl": "https://www.npmjs.com/package/@code-pushup/eslint-plugin", |
| 152 | + "description": "Official Code PushUp documentation coverage plugin.", |
| 153 | + "docsUrl": "https://www.npmjs.com/package/@code-pushup/doc-coverage-plugin/", |
192 | 154 | "groups": [ |
193 | 155 | { |
194 | | - "description": "Code that either will cause an error or may cause confusing behavior. Developers should consider this a high priority to resolve.", |
| 156 | + "description": "Documentation coverage", |
195 | 157 | "refs": [ |
196 | 158 | { |
197 | | - "slug": "no-unused-vars", |
| 159 | + "slug": "classes-coverage", |
| 160 | + "weight": 2, |
| 161 | + }, |
| 162 | + { |
| 163 | + "slug": "methods-coverage", |
| 164 | + "weight": 2, |
| 165 | + }, |
| 166 | + { |
| 167 | + "slug": "functions-coverage", |
| 168 | + "weight": 2, |
| 169 | + }, |
| 170 | + { |
| 171 | + "slug": "interfaces-coverage", |
198 | 172 | "weight": 1, |
199 | 173 | }, |
200 | 174 | { |
201 | | - "slug": "no-undef", |
| 175 | + "slug": "variables-coverage", |
| 176 | + "weight": 1, |
| 177 | + }, |
| 178 | + { |
| 179 | + "slug": "properties-coverage", |
| 180 | + "weight": 1, |
| 181 | + }, |
| 182 | + { |
| 183 | + "slug": "types-coverage", |
202 | 184 | "weight": 1, |
203 | 185 | }, |
204 | | - ], |
205 | | - "slug": "problems", |
206 | | - "title": "Problems", |
207 | | - }, |
208 | | - { |
209 | | - "description": "Something that could be done in a better way but no errors will occur if the code isn't changed.", |
210 | | - "refs": [ |
211 | 186 | { |
212 | | - "slug": "no-console", |
| 187 | + "slug": "enums-coverage", |
213 | 188 | "weight": 1, |
214 | 189 | }, |
215 | 190 | ], |
216 | | - "slug": "suggestions", |
217 | | - "title": "Suggestions", |
| 191 | + "slug": "documentation-coverage", |
| 192 | + "title": "Documentation coverage", |
218 | 193 | }, |
219 | 194 | ], |
220 | | - "icon": "eslint", |
221 | | - "packageName": "@code-pushup/eslint-plugin", |
222 | | - "slug": "eslint", |
223 | | - "title": "ESLint", |
| 195 | + "icon": "folder-src", |
| 196 | + "slug": "doc-coverage", |
| 197 | + "title": "Documentation coverage", |
224 | 198 | }, |
225 | 199 | ], |
226 | 200 | } |
|
0 commit comments