@launchfort/sonar-cli
v0.2.3
Published
A command line tool for synchronizing project properties with the SonarCloud Web API
Downloads
16
Readme
Sonar CLI
A command line tool for communicating with the SonarCloud Web API.
Installation
npm install --global launchfort/sonar-cli
sonar
Usage
Create a .sonar-project.json
in the root of your git repository.
{
"$schema": "https://raw.githubusercontent.com/launchfort/sonar-cli/master/schemas/project.json",
"sonar.projectKey": "some_project",
"sonar.inclusions": [ "src" ]
}
Then store the settings to SonarCloud
NOTE: All settings will be stored in SonarCloud except sonar.projectKey
.
SONAR_CLOUD_ACCESS_TOKEN=dsdfsdf sonar project store
OR
sonar project store --accessToken dsdfsdf
To view help:
sonar --help
sonar project --help
sonar project store --help
... etc.
Settings Supported
The settings are supported. As found on the SonarCloud Administration > General Settings
page: Analysis Scope, General, Pull Requests, SCM, JavaScript and TypeScript.
To see descriptions of all settings supported see the JSON schema.
Resetting settings to their defaults
To reset any setting to the default value provided by SonarCloud, then set it
to null
.
{
"$schema": "https://raw.githubusercontent.com/launchfort/sonar-cli/master/schemas/project.json",
"sonar.projectKey": "some_project",
"sonar.inclusions": [ "src" ],
"sonar.typescript.file.suffixes": null
}
Debugging
To see dubug messages set the env var DEBUG
to sonar-cli
. See the debug
module for further details.