Skip to content

Commit f2e742a

Browse files
author
Aurélien Baudet
committed
[DOC] update documentation + rename "unit" keys into "ut"
1 parent 7bfc498 commit f2e742a

File tree

3 files changed

+40
-20
lines changed

3 files changed

+40
-20
lines changed

README.md

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
1-
Sonar plugin for JS/CSS/HTML/SASS/AngularJS
2-
===========================================
1+
Sonar plugin for JS/CSS/HTML/SASS/AngularJS/TypeScript
2+
======================================================
33

44
# Introduction
55

6-
Sonarqube plugin for the Web world with various technologies and languages (JavaScript, CSS, SASS, HTML, AngularJS...).
6+
Sonarqube plugin for the Web world with various technologies and languages (JavaScript, CSS, SASS, HTML, AngularJS, TypeScript...).
77
This plugin consumes reports generated by tools that are heavily used by the Web community:
88

99
- Linters:
1010
- [JSHint](http://jshint.com/)
1111
- [CSS Lint](http://csslint.net/)
1212
- [SCSS Lint](https://github.com/brigade/scss-lint)
1313
- [HTMLHint](http://htmlhint.com/)
14+
- [ESLint](http://eslint.org/)
1415
- [ESLint plugin for AngularJS](https://github.com/Gillespie59/eslint-plugin-angular)
15-
- Test results (unit tests and integration tests)
16+
- [TSLint](https://palantir.github.io/tslint/)
17+
- Test results (unit tests and integration tests for JavaScript and TypeScript)
1618
- [Jasmine](http://jasmine.github.io/)
1719
- Code coverage:
1820
- [Istanbul](https://gotwarlost.github.io/istanbul/)
@@ -27,7 +29,7 @@ The reports are either directly produced by the tools or by our [gulp tasks](htt
2729

2830
## Build your Web project
2931

30-
When developping Web applications, you can use gulp to build, run tests, minimify and package your project. Some tasks will already generate reports like Istanbul that generates a LCOV file.
32+
When developing Web applications, you can use gulp to build, run tests, minify and package your project. Some tasks will already generate reports like Istanbul that generates a LCOV file.
3133
You can also add additional tasks to run linters and produce reports. Theses tasks are already available [here](https://github.com/groupe-sii/front-end-continuous-integration).
3234

3335
## Configure your project for Sonar
@@ -76,7 +78,7 @@ sonar.sourceEncoding=UTF-8
7678

7779
#### Download the JAR
7880

79-
You can download the v2.0.0 release for Sonar 4.5.x directly [on Sonatype](https://oss.sonatype.org/content/groups/public/fr/sii/sonar/sonar-web-frontend-plugin/2.0.0/sonar-web-frontend-plugin-2.0.0.jar).
81+
You can download the v2.1.0 release for Sonar 4.5.x directly [on Sonatype](https://oss.sonatype.org/content/groups/public/fr/sii/sonar/sonar-web-frontend-plugin/2.1.0/sonar-web-frontend-plugin-2.1.0.jar).
8082

8183

8284
#### Generate from sources
@@ -114,7 +116,7 @@ The plugin provides many metrics specialized for Web and store them into Sonar.
114116

115117
## Code quality
116118

117-
The linters (JSHint, HTMLHint, CSSLint, SCSSLint) provide many information about code violations (issues) for every language or framework (JavaScript, CSS, HTML, SASS/Compass, AngularJS). These issues are integrated in Sonar and are usable in the different views of Sonar. We also provide a [dashboard widget for issues](#issueswidget).
119+
The linters (JSHint, ESLint, HTMLHint, CSSLint, SCSSLint, TSLint) provide many information about code violations (issues) for every language or framework (JavaScript, CSS, HTML, SASS/Compass, AngularJS and TypeScript). These issues are integrated in Sonar and are usable in the different views of Sonar. We also provide a [dashboard widget for issues](#issueswidget).
118120

119121
## Test results
120122

@@ -161,26 +163,33 @@ You can change the path to every generated report directly in your sonar.propert
161163
```ini
162164
# issues reports with default paths
163165
sonar.sii.quality.js.report.path=/reports/sonar/jshint.json
166+
sonar.sii.quality.js.eslint.report.path=/reports/sonar/eslint.json
164167
sonar.sii.quality.css.report.path=/reports/sonar/csslint.json
165168
sonar.sii.quality.html.report.path=/reports/sonar/htmlhint.json
166169
sonar.sii.quality.scss.report.path=/reports/sonar/scsslint.json
167170
sonar.sii.quality.angular.eslint.report.path=/reports/sonar/eslint-angular.json
171+
sonar.sii.quality.ts.report.path=/reports/sonar/tslint.json
168172

169-
# unit test results with default paths
170-
sonar.sii.test.unit.js.report.path=/reports/sonar/js-ut.xml
173+
# JavaScript/TypeScript unit test results with default paths
174+
sonar.sii.test.ut.js.report.path=/reports/sonar/js-ut.xml
171175
sonar.sii.test.it.js.report.path=/reports/sonar/js-it.xml
176+
sonar.sii.test.ut.ts.report.path=/reports/sonar/ts-ut.xml
177+
sonar.sii.test.it.ts.report.path=/reports/sonar/ts-it.xml
172178

173-
# code coverage with default paths
179+
# JavaScript/TypeScript code coverage with default paths
174180
sonar.sii.coverage.ut.js.report.path=/reports/sonar/js-ut.lcov
175181
sonar.sii.coverage.it.js.report.path=/reports/sonar/js-it.lcov
176182
sonar.sii.coverage.overall.js.report.path=/reports/sonar/js-overall.lcov
183+
sonar.sii.coverage.ut.ts.report.path=/reports/sonar/ts-ut.lcov
184+
sonar.sii.coverage.it.ts.report.path=/reports/sonar/ts-it.lcov
185+
sonar.sii.coverage.overall.ts.report.path=/reports/sonar/ts-overall.lcov
177186

178187
# code duplication with default paths
179188
sonar.sii.duplication.js.report.path=/reports/sonar/js-duplication.xml
180189
sonar.sii.duplication.css.report.path=/reports/sonar/css-duplication.xml
181190
sonar.sii.duplication.html.report.path=/reports/sonar/html-duplication.xml
182191
sonar.sii.duplication.scss.report.path=/reports/sonar/scss-duplication.xml
183-
192+
sonar.sii.duplication.ts.report.path=/reports/sonar/ts-duplication.xml
184193
```
185194

186195
### Other options
@@ -195,6 +204,7 @@ sonar.sii.js.suffixes=.js
195204
sonar.sii.html.suffixes=.html
196205
sonar.sii.css.suffixes=.css
197206
sonar.sii.scss.suffixes=.scss
207+
sonar.sii.ts.suffixes=.ts
198208
```
199209

200210

@@ -213,25 +223,32 @@ By default, in order to keep coherence, the analysis done by the plugin will fai
213223
```ini
214224
# set to false to disable missing source file while analyzing code quality
215225
sonar.sii.quality.js.file.missing.fail=false
226+
sonar.sii.quality.js.eslint.file.missing.fail=false
216227
sonar.sii.quality.scss.file.missing.fail=false
217228
sonar.sii.quality.css.file.missing.fail=false
218229
sonar.sii.quality.html.file.missing.fail=false
219230
sonar.sii.quality.eslint.angular.file.missing.fail=false
220231

221232
# set to false to disable missing source file while analyzing test results
222-
sonar.sii.test.unit.js.file.missing.fail=false
233+
sonar.sii.test.ut.js.file.missing.fail=false
223234
sonar.sii.test.it.js.file.missing.fail=false
235+
sonar.sii.test.ut.ts.file.missing.fail=false
236+
sonar.sii.test.it.ts.file.missing.fail=false
224237

225238
# set to false to disable missing source file while analyzing code coverage
226239
sonar.sii.coverage.ut.js.file.missing.fail=false
227240
sonar.sii.coverage.it.js.file.missing.fail=false
228241
sonar.sii.coverage.overall.js.file.missing.fail=false
242+
sonar.sii.coverage.ut.ts.file.missing.fail=false
243+
sonar.sii.coverage.it.ts.file.missing.fail=false
244+
sonar.sii.coverage.overall.ts.file.missing.fail=false
229245

230246
# set to false to disable missing source file while analyzing code duplication
231247
sonar.sii.duplication.js.file.missing.fail=false
232248
sonar.sii.duplication.html.file.missing.fail=false
233249
sonar.sii.duplication.css.file.missing.fail=false
234250
sonar.sii.duplication.scss.file.missing.fail=false
251+
sonar.sii.duplication.ts.file.missing.fail=false
235252
```
236253

237254
#### Skip analysis
@@ -242,10 +259,12 @@ Sonar doesn't allow two plugins to store the same information. So if you are usi
242259

243260
```ini
244261
sonar.sii.quality.js.file.metrics.skip=true
262+
sonar.sii.quality.js.eslint.file.metrics.skip=true
245263
sonar.sii.quality.html.file.metrics.skip=true
246264
sonar.sii.quality.css.file.metrics.skip=true
247265
sonar.sii.quality.scss.file.metrics.skip=true
248266
sonar.sii.quality.eslint.angular.file.metrics.skip=true
267+
sonar.sii.quality.ts.file.metrics.skip=true
249268
```
250269

251270
Sonar also provide CPD analysis. Like described above, code duplication analysis can fail if two plugins are doing it.
@@ -257,25 +276,26 @@ sonar.sii.duplication.js.skip=true
257276
sonar.sii.duplication.html.skip=true
258277
sonar.sii.duplication.css.skip=true
259278
sonar.sii.duplication.scss.skip=true
279+
sonar.sii.duplication.ts.skip=true
260280

261281
# disable Sonar CPD analysis
262282
sonar.cpd.exclusions=**
263283
```
264284

265285
# Supported Sonar versions
266286

267-
As Sonar team makes big changes on plugin APIs between two versions, it takes really long time to update the plugin for each version. So we decided to only support the LTS version (currently 4.5.x). We also try to make the last release version (currently 5.4) but some APIs have totally disappeared while other are no more working. When Sonar 5.5 will be released, we will try to make adjustments to make our plugin working on it. No effort is made for Sonar versions between 4.5.x and latest version. The plugin may work or not depending on what you are using and the version of Sonar.
287+
As Sonar team makes big changes on plugin APIs between two versions, it takes really long time to update the plugin for each version. So we decided to only support the LTS version (currently 4.5.x). We also try to make the last release version (currently 5.5) but some APIs have totally disappeared while other are no more working. When Sonar 5.6 will be released, we will try to make adjustments to make our plugin working on it. No effort is made for Sonar versions between 4.5.x and latest version. The plugin may work or not depending on what you are using and the version of Sonar.
268288

269289
# Roadmap
270290

271291
## Main features
272292

273293
- Code complexity ([Plato](https://github.com/es-analysis/plato) ...)
274-
- Support new languages (TypeScript, Less, ...)
294+
- Support new languages (Less, ...)
275295
- Support Sonar 5.x (LTS version) when it will be available
276296
- Add new widgets for better user experience
277297

278-
See https://github.com/groupe-sii/sonar-web-frontend-plugin/labels/feature for full list of features
298+
See [full list of features](https://github.com/groupe-sii/sonar-web-frontend-plugin/labels/feature)
279299

280-
See https://github.com/groupe-sii/sonar-web-frontend-plugin/milestones for future versions
300+
See [milestones](https://github.com/groupe-sii/sonar-web-frontend-plugin/milestones) for future versions
281301

sonar-web-frontend-js/src/main/java/fr/sii/sonar/web/frontend/js/test/JUnitConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import fr.sii.sonar.web.frontend.js.JsLanguageConstants;
66

77
public class JUnitConstants extends JsLanguageConstants implements TestConstants {
8-
public static final String REPORT_PATH_KEY = "sonar.sii.test.unit.js.report.path";
9-
public static final String FAIL_MISSING_FILE_KEY = "sonar.sii.test.unit.js.file.missing.fail";
8+
public static final String REPORT_PATH_KEY = "sonar.sii.test.ut.js.report.path";
9+
public static final String FAIL_MISSING_FILE_KEY = "sonar.sii.test.ut.js.file.missing.fail";
1010
public static final String REPORT_PATH_DEFVALUE = "/reports/sonar/js-ut.xml";
1111
public static final String FAIL_MISSING_FILE_DEFVALUE = "true";
1212
public static final String SUB_CATEGORY = "Unit testing";

sonar-web-frontend-typescript/src/main/java/fr/sii/sonar/web/frontend/typescript/test/JUnitConstants.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
import fr.sii.sonar.web.frontend.typescript.TypeScriptLanguageConstants;
66

77
public class JUnitConstants extends TypeScriptLanguageConstants implements TestConstants {
8-
public static final String REPORT_PATH_KEY = "sonar.sii.test.unit.ts.report.path";
9-
public static final String FAIL_MISSING_FILE_KEY = "sonar.sii.test.unit.ts.file.missing.fail";
8+
public static final String REPORT_PATH_KEY = "sonar.sii.test.ut.ts.report.path";
9+
public static final String FAIL_MISSING_FILE_KEY = "sonar.sii.test.ut.ts.file.missing.fail";
1010
public static final String REPORT_PATH_DEFVALUE = "/reports/sonar/ts-ut.xml";
1111
public static final String FAIL_MISSING_FILE_DEFVALUE = "true";
1212
public static final String SUB_CATEGORY = "Unit testing";

0 commit comments

Comments
 (0)