lathonez / clicker

Ionic 2 + @angular/cli Seed Project : Angular2 + Typescript + Karma + Protractor + Travis
http://lathonez.com/2018/ionic-2-unit-testing/
MIT License
430 stars 137 forks source link

Add SonarQube analysis #181

Closed FJLopezGarcia closed 7 years ago

FJLopezGarcia commented 7 years ago

What do you think about analyze your code with SonarQube? it would be great to have a "sonar-project.properties" file with the configuration to analyse your typescripts, display the code coverage...

lathonez commented 7 years ago

Yes sounds good. How about a PR?

On 26 Nov 2016 03:14, "Javi" notifications@github.com wrote:

What do you think about analyze your code with SonarQube? it would be great to have a "sonar-project.properties" file with the configuration to analyse your typescripts, display the code coverage...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/lathonez/clicker/issues/181, or mute the thread https://github.com/notifications/unsubscribe-auth/AG5tSFFaZ9r22HVh5O9eGfgry77rCfTpks5rBzOLgaJpZM4K8q14 .

FJLopezGarcia commented 7 years ago

You just need to add a "sonar-project.properties" file in your root folder and download/setups SonarQube and Runner following the "Get Started in Two Minutes" instructions: http://docs.sonarqube.org/display/SONAR/Get+Started+in+Two+Minutes

You also need to add the TS plugin from https://github.com/Pablissimo/SonarTsPlugin in your sonar plugins folder (C:\sonarqube\sonarqube-6.1\extensions\plugins)

sonar.projectKey=Clicker sonar.projectName=licker sonar.projectVersion=0.0.1 sonar.projectDescription=licker app build with Ionic2 framework.

sonar.sourceEncoding=UTF-8

------------- Sonar + DB connection ----------

sonar.host.url=http://localhost:9000

sonar.host.url=http://10.64.4.153:443/

sonar.jdbc.driverClassName=com.microsoft.sqlserver.jdbc.SQLServerDriver

sonar.jdbc.validationQuery=select 1

sonar.jdbc.dialect=mssql

sonar.ws.timeout=60

sonar.javascript.jstest.reportsPath=reports/junit

sonar.modules=html_module,js_module,ts_module,json_module,css_module

------------- HTML ----------------------------

html_module.sonar.projectName=HTML Module html_module.sonar.language=web html_module.sonar.sources=src/ html_module.sonar.exclusions= html_module.sonar.projectBaseDir=.

------------- typeScript ----------------------

ts_module.sonar.projectName=TypeScript Module ts_module.sonar.language=ts ts_module.sonar.sources=src/ ts_module.sonar.exclusions= ts_module.sonar.projectBaseDir=.

ts_module.sonar.ts.tslintconfigpath=tslint.json ts_module.sonar.ts.tslintpath=node_modules/tslint/bin/tslint

ts_module.sonar.ts.lcov.reportpath=coverage/coverage.lcov

ts_module.sonar.tests=src/ ts_module.sonar.test.inclusions=*/spec.ts ts_module.sonar.test.exclusions=

------------- CSS ----------------------------

css_module.sonar.projectName=CSS Module css_module.sonar.language=css css_module.sonar.sources=www/build/main.css css_module.sonar.exclusions= css_module.sonar.projectBaseDir=.

------------- JS ----------------------------

js_module.sonar.projectName=JavaScript Module js_module.sonar.language=js js_module.sonar.sources=www/build/main.js js_module.sonar.exclusions= js_module.sonar.projectBaseDir=.

sonar.javascript.lcov.reportpath=coverage/coverage.lcov

sonar.javascript.lcov.itReportPath=

lathonez commented 7 years ago

OK, thanks for the info. Will leave this open for reference / in case anyone wants to make a PR.

lathonez commented 7 years ago

Should be raised with / integrated into @angular/cli