Skip to content

Commit

Permalink
[DOC] update documentation + rename "unit" keys into "ut"
Browse files Browse the repository at this point in the history
  • Loading branch information
Aurélien Baudet committed Jun 6, 2016
1 parent 7bfc498 commit f2e742a
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 20 deletions.
52 changes: 36 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,20 @@
Sonar plugin for JS/CSS/HTML/SASS/AngularJS
===========================================
Sonar plugin for JS/CSS/HTML/SASS/AngularJS/TypeScript
======================================================

# Introduction

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

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

## Build your Web project

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.
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.
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).

## Configure your project for Sonar
Expand Down Expand Up @@ -76,7 +78,7 @@ sonar.sourceEncoding=UTF-8

#### Download the JAR

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).
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).


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

## Code quality

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).
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).

## Test results

Expand Down Expand Up @@ -161,26 +163,33 @@ You can change the path to every generated report directly in your sonar.propert
```ini
# issues reports with default paths
sonar.sii.quality.js.report.path=/reports/sonar/jshint.json
sonar.sii.quality.js.eslint.report.path=/reports/sonar/eslint.json
sonar.sii.quality.css.report.path=/reports/sonar/csslint.json
sonar.sii.quality.html.report.path=/reports/sonar/htmlhint.json
sonar.sii.quality.scss.report.path=/reports/sonar/scsslint.json
sonar.sii.quality.angular.eslint.report.path=/reports/sonar/eslint-angular.json
sonar.sii.quality.ts.report.path=/reports/sonar/tslint.json

# unit test results with default paths
sonar.sii.test.unit.js.report.path=/reports/sonar/js-ut.xml
# JavaScript/TypeScript unit test results with default paths
sonar.sii.test.ut.js.report.path=/reports/sonar/js-ut.xml
sonar.sii.test.it.js.report.path=/reports/sonar/js-it.xml
sonar.sii.test.ut.ts.report.path=/reports/sonar/ts-ut.xml
sonar.sii.test.it.ts.report.path=/reports/sonar/ts-it.xml

# code coverage with default paths
# JavaScript/TypeScript code coverage with default paths
sonar.sii.coverage.ut.js.report.path=/reports/sonar/js-ut.lcov
sonar.sii.coverage.it.js.report.path=/reports/sonar/js-it.lcov
sonar.sii.coverage.overall.js.report.path=/reports/sonar/js-overall.lcov
sonar.sii.coverage.ut.ts.report.path=/reports/sonar/ts-ut.lcov
sonar.sii.coverage.it.ts.report.path=/reports/sonar/ts-it.lcov
sonar.sii.coverage.overall.ts.report.path=/reports/sonar/ts-overall.lcov

# code duplication with default paths
sonar.sii.duplication.js.report.path=/reports/sonar/js-duplication.xml
sonar.sii.duplication.css.report.path=/reports/sonar/css-duplication.xml
sonar.sii.duplication.html.report.path=/reports/sonar/html-duplication.xml
sonar.sii.duplication.scss.report.path=/reports/sonar/scss-duplication.xml

sonar.sii.duplication.ts.report.path=/reports/sonar/ts-duplication.xml
```

### Other options
Expand All @@ -195,6 +204,7 @@ sonar.sii.js.suffixes=.js
sonar.sii.html.suffixes=.html
sonar.sii.css.suffixes=.css
sonar.sii.scss.suffixes=.scss
sonar.sii.ts.suffixes=.ts
```


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

# set to false to disable missing source file while analyzing test results
sonar.sii.test.unit.js.file.missing.fail=false
sonar.sii.test.ut.js.file.missing.fail=false
sonar.sii.test.it.js.file.missing.fail=false
sonar.sii.test.ut.ts.file.missing.fail=false
sonar.sii.test.it.ts.file.missing.fail=false

# set to false to disable missing source file while analyzing code coverage
sonar.sii.coverage.ut.js.file.missing.fail=false
sonar.sii.coverage.it.js.file.missing.fail=false
sonar.sii.coverage.overall.js.file.missing.fail=false
sonar.sii.coverage.ut.ts.file.missing.fail=false
sonar.sii.coverage.it.ts.file.missing.fail=false
sonar.sii.coverage.overall.ts.file.missing.fail=false

# set to false to disable missing source file while analyzing code duplication
sonar.sii.duplication.js.file.missing.fail=false
sonar.sii.duplication.html.file.missing.fail=false
sonar.sii.duplication.css.file.missing.fail=false
sonar.sii.duplication.scss.file.missing.fail=false
sonar.sii.duplication.ts.file.missing.fail=false
```

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

```ini
sonar.sii.quality.js.file.metrics.skip=true
sonar.sii.quality.js.eslint.file.metrics.skip=true
sonar.sii.quality.html.file.metrics.skip=true
sonar.sii.quality.css.file.metrics.skip=true
sonar.sii.quality.scss.file.metrics.skip=true
sonar.sii.quality.eslint.angular.file.metrics.skip=true
sonar.sii.quality.ts.file.metrics.skip=true
```

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

# disable Sonar CPD analysis
sonar.cpd.exclusions=**
```

# Supported Sonar versions

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.
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.

# Roadmap

## Main features

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

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

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

Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import fr.sii.sonar.web.frontend.js.JsLanguageConstants;

public class JUnitConstants extends JsLanguageConstants implements TestConstants {
public static final String REPORT_PATH_KEY = "sonar.sii.test.unit.js.report.path";
public static final String FAIL_MISSING_FILE_KEY = "sonar.sii.test.unit.js.file.missing.fail";
public static final String REPORT_PATH_KEY = "sonar.sii.test.ut.js.report.path";
public static final String FAIL_MISSING_FILE_KEY = "sonar.sii.test.ut.js.file.missing.fail";
public static final String REPORT_PATH_DEFVALUE = "/reports/sonar/js-ut.xml";
public static final String FAIL_MISSING_FILE_DEFVALUE = "true";
public static final String SUB_CATEGORY = "Unit testing";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import fr.sii.sonar.web.frontend.typescript.TypeScriptLanguageConstants;

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

0 comments on commit f2e742a

Please sign in to comment.