diff --git a/.gitignore b/.gitignore index b8260e0..b0499e8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,8 @@ -node_modules -coverage -dist -/common -generators -debug -!src/generators .vscode/settings.json +/node_modules +/coverage +/dist +/common +/generators +/debug +/test_results \ No newline at end of file diff --git a/package.json b/package.json index bb67dec..bf7df09 100644 --- a/package.json +++ b/package.json @@ -80,6 +80,6 @@ "copy-data-template": "xcopy \"src\\generators\\data\\templates\" \"generators\\data\\templates\" /I /S /y", "copy-powerbi-template": "xcopy \"src\\generators\\powerbi\\templates\" \"generators\\powerbi\\templates\" /I /S /y", "clean-debug": "del /S /q debug\\*", - "lint": "eslint .eslintrc.js ./src" + "lint": "eslint .eslintrc.js ./src --fix -o test_results/analysis/eslint.json -f json" } } diff --git a/pipelines/templates/build-and-test-job.yml b/pipelines/templates/build-and-test-job.yml index 8493b95..2f35bfc 100644 --- a/pipelines/templates/build-and-test-job.yml +++ b/pipelines/templates/build-and-test-job.yml @@ -33,11 +33,22 @@ jobs: inputs: verbose: true + - task: SonarCloudPrepare@1 + displayName: Prepare SonarCloud + inputs: + SonarCloud: "SonarCloud" + organization: "capgemini-1" + scannerMode: "CLI" + configMode: "file" + extraProperties: | + soner.projectVersion=$(GitVersion.SemVer) + - task: Npm@1 displayName: Lint Package inputs: command: custom customCommand: run lint + continueOnError: true - task: Npm@1 displayName: Build Package @@ -45,6 +56,14 @@ jobs: command: custom customCommand: run build + - task: SonarCloudAnalyze@1 + displayName: Analyse with SonarCloud + + - task: SonarCloudPublish@1 + displayName: Publish SonarCloud results + inputs: + pollingTimeoutSec: "300" + - task: WhiteSource Bolt@20 displayName: Detect security and licence issues inputs: diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..acd33bb --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,7 @@ +sonar.organization=capgemini-1 +sonar.projectKey=Capgemini_powerapps-project-template +sonar.projectName=powerapps-project-template +sonar.sources=src/ +sonar.tests=_tests_/ +sonar.typescript.tsconfigPath=tsconfig.json +sonar.eslint.reportPaths=test_results/analysis/eslint.json \ No newline at end of file