From 12350478f32020d676b11bb647c5f2194052c6ed Mon Sep 17 00:00:00 2001 From: Wolfgang Steiner Date: Wed, 6 Jul 2016 12:43:11 +0200 Subject: [PATCH] - updated README --- README.md | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 59c368a..1124850 100644 --- a/README.md +++ b/README.md @@ -85,25 +85,32 @@ The plugin has so far *only been tested on Windows* and it'll be no surprise if sonar.ts.forceZeroCoverageOptionalForces code coverage percentage to zero when no report is supplied, defaults to false sonar.ts.tslinttimeoutOptionalMax time to wait for TsLint to finish processing a single file (in milliseconds), defaults to 60 seconds sonar.ts.tslintrulesdirOptionalPath to a folder containing custom TsLint rules referenced in tslint.json -sonar.ts.tslint.customrulesOptionalConfiguration to map custom TSLint rules to SonarQube rules & settings sonar.ts.lcov.reportpathOptionalPath to an LCOV code-coverage report to be included in analysis +sonar.ts.ruleconfigsOptionalA list of configurations to map custom TSLint rules to dedicated SonarQube rules & settings ## TSLint Custom Rules -To present custom TSLint rules in SonarQube analysis, you can provide a configuration that maps the TSLint rules from your `sonar.ts.tslintrulesdir` +To present custom TSLint rules in SonarQube analysis, you can provide a configuration that maps the TSLint rules from your `sonar.ts.tslintrulesdir` directory to dedicated Sonar rules for analysis. -The configuration for a TSLint Sonar rule consists of a line declaring the TSLint rule id, a boolean switch to enable or disable the rule if needed +The configuration for a TSLint Sonar rule consists of a line declaring the TSLint rule id, a boolean switch to enable or disable the rule if needed and some attached properties that are used by Sonar for analysis and reporting. -For example taking the `no-constant-condition` rule from the [tslint-eslint-rules](https://github.com/buzinas/tslint-eslint-rules) package, -a configuration in Sonar could look as follows: +For example taking the `export-name` rule from the [tslint-microsoft-contrib](https://github.com/Microsoft/tslint-microsoft-contrib) package, +a configuration for that rule in SonarTsPlugin could look as follows: + + export-name=true + export-name.name=The name of the exported module must match the filename of the source file. + export-name.severity=MAJOR + export-name.description=This is case-sensitive but ignores file extension. Since version 1.0, this rule takes a list of regular expressions as a parameter. Any export name matching that regular expression will be ignored. + export-name.debtFunc=LINEAR_OFFSET + export-name.debtScalar=15min + export-name.debtOffset=1h + export-name.debtType=HARDWARE_RELATED_PORTABILITY - no-constant-condition=true - no-constant-condition.name=disallow use of constant expressions in conditions - no-constant-condition.severity=MAJOR - no-constant-condition.description=Comparing a literal expression in a condition is usually a typo or development trigger for a specific behavior. +* for documentation about the `technical debt` parameters look [here](http://docs.sonarqube.org/display/PLUG/Rule+Remediation+Costs) and [here](http://javadocs.sonarsource.org/5.2/apidocs/org/sonar/api/server/debt/DebtRemediationFunction.html) +* for possible values for `debtType` go [here](http://javadocs.sonarsource.org/5.2/apidocs/org/sonar/api/server/rule/RulesDefinition.SubCharacteristics.html) ##Licence MIT