1
0
mirror of https://github.com/vbondarevsky/Connector.git synced 2024-11-21 17:36:49 +02:00

sonar for en version

This commit is contained in:
Vladimir Bondarevskiy 2021-10-09 22:47:54 +03:00
parent 1782467e66
commit d8fb7579c6
5 changed files with 70 additions and 1 deletions

View File

@ -5,7 +5,10 @@
"Typo": {
"userWordsToIgnore": "Редирект,Редиректа,Распарсить,Сериализации,Многостатусный"
},
"LatinAndCyrillicSymbolInWord": false
"LatinAndCyrillicSymbolInWord": false,
"MagicNumber": {
"authorizedNumbers": "-1,0,1,2"
}
}
}
}

47
.github/workflows/sonar-scanner_en.yml vendored Normal file
View File

@ -0,0 +1,47 @@
name: sonar-scanner
on:
push:
branches:
- master
pull_request:
types: [opened, synchronize, reopened]
jobs:
SonarScanner:
if: github.repository == 'vbondarevsky/Connector'
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
with:
fetch-depth: 0
- name: Setup SonarQube scanner
uses: warchant/setup-sonar-scanner@v3
- name: Extract version
shell: bash
run: echo "##[set-output name=version;]` cat ./src/ru/CommonModules/HTTPConnector/Ext/Module.bsl | grep -oP '(?<=Version:.)[\d|.]*'`"
id: extract_version
- name: Run SonarQube on push
if: github.event_name == 'push'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.branch.name=${GITHUB_REF#refs/heads/}
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
-Dproject.settings=../myproject.properties
-Dproject.settings=sonar-project.properties_en
- name: Run SonarQube on pull request
if: github.event_name == 'pull_request'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: sonar-scanner
-Dsonar.login=${{ secrets.SONAR_TOKEN }}
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.pullrequest.key=${{ github.event.pull_request.number }}
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
-Dproject.settings=sonar-project.properties_en

View File

@ -31,6 +31,7 @@ jobs:
-Dsonar.host.url=https://sonar.openbsl.ru
-Dsonar.branch.name=${GITHUB_REF#refs/heads/}
-Dsonar.projectVersion=${{ steps.extract_version.outputs.version }}
-Dproject.settings=sonar-project.properties_ru
- name: Run SonarQube on pull request
if: github.event_name == 'pull_request'
env:
@ -42,3 +43,4 @@ jobs:
-Dsonar.pullrequest.branch=${{ github.event.pull_request.head.ref }}
-Dsonar.pullrequest.base=${{ github.event.pull_request.base.ref }}
-Dsonar.scm.revision=${{ github.event.pull_request.head.sha }}
-Dproject.settings=sonar-project.properties_ru

View File

@ -0,0 +1,17 @@
# must be unique in a given SonarQube instance
sonar.projectKey=connector_en
# this is the name displayed in the SonarQube UI
sonar.projectName=connector_en
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.
# Since SonarQube 4.2, this property is optional if sonar.modules is set.
# If not set, SonarQube starts looking for source code from the directory containing
# the sonar-project.properties file.
sonar.sources=./src/en
# Encoding of the source code. Default is default system encoding
sonar.sourceEncoding=UTF-8
sonar.bsl.languageserver.configurationPath = .bsl-language-server.json