Skip to content

Commit

Permalink
Merge branch 'releasev2.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
artbear committed Nov 29, 2019
2 parents 4d955af + 0370a00 commit a41504c
Show file tree
Hide file tree
Showing 9 changed files with 3,570 additions and 2,273 deletions.
24 changes: 24 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
## 2.1.0

**Implemented enhancements:**

* Support SonarQube servers with enabled Organization mode (like SonarCloud.io)
* Add json-schemas to simplify creating of `sonarlint.json` and `global.json`. See `README.md`

**Bug fixes:**

* Fix extension activation if non-project file is first opened file

## 2.0.0

**Implemented enhancements:**

* Support SonarQube 6.7+

## 1.4.0

**Implemented enhancements:**

* Support multifolder workspaces
* Stability improvements - update dependencies

## 1.3.1

**Bug fixes:**
Expand Down
73 changes: 57 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,12 @@

[![Join the chat at https://gitter.im/silverbulleters/sonarqube-inject-vsc](https://badges.gitter.im/silverbulleters/sonarqube-inject-vsc.svg)](https://gitter.im/silverbulleters/sonarqube-inject-vsc?utm_source=badge&utm_medium=badge&utm_content=badge)
[![GitHub release](https://img.shields.io/github/release/silverbulleters/sonarqube-inject-vsc.svg)](https://github.com/silverbulleters/sonarqube-inject-vsc/blob/master/CHANGELOG.md)
[![Build Status](https://travis-ci.org/silverbulleters/sonarqube-inject-vsc.svg?branch=develop)](https://travis-ci.org/silverbulleters/sonarqube-inject-vsc)
[![Dependency Status](https://gemnasium.com/badges/github.com/silverbulleters/sonarqube-inject-vsc.svg)](https://gemnasium.com/github.com/silverbulleters/sonarqube-inject-vsc)

SonarQube support for Visual Studio Code that provides on-the-fly feedback to developers on new bugs and quality issues injected into their code.
Non-official realization of SonarLint for VS Code.

## Important

`sonarlint` utility will be downloaded (~30MB) on first-time activation of the extension.
If you are working behind a proxy, consider set `http_proxy` or `https_proxy` env variables and/or `http.proxy` and `http.proxyStrictSSL` settings in your Visual Studio Code.

## TLDR: Quick Setup for Standalone mode

* Just open your project dir
Expand All @@ -24,6 +20,62 @@ If you are working behind a proxy, consider set `http_proxy` or `https_proxy` en
* Create project config via `SonarQube Inject: Create local sonarlint config with project binding` and fill the values
* Update project bindings via `SonarQube Inject: Update bindings to SonarQube server` - it can take a lot of time (~1-2 min) on first binding

## Connected mode

You can run analysis with connection to your SonarQube server. To do this you need to create two small config files.

Create and edit first file - global config - via `SonarQube Inject: Create global config with credentials to servers` command. In this file you need to define your SonarQube servers - `id`'s, `url`, credentials (auth `token` or `login` and `password` pair) and `organizationKey`, if your SonarQube server has enabled Organization mode.

Example:

```json
{
"$schema": "https://gist.github.com/nixel2007/18b4e86ef1d98fb60b901ca4fcecb0e9/raw/bca2e6d461143f11aabe825deb596755893efbf9/global.json",
"servers": [
{
"id": "localhost",
"url": "http://localhost:9000",
"token": "fe299234962a304f63386db4ffa0cbdb22367b52"
}
]
}
```

Create and edit second file - project config - via `SonarQube Inject: Create local sonarlint config with project binding` command. In this file you need to define the `serverId` (`id` from `global.json` file) and `projectKey` - key of project at your SonarQube server.

Example:

```json
{
"$schema": "https://raw.githubusercontent.com/silverbulleters/sonarqube-inject-vsc/master/schemas/sonarlint.json",
"serverId": "localhost",
"projectKey": "my-project"
}
```

Don't forget to run `SonarQube Inject: Update bindings to SonarQube server` command in VSCode to update server bindings.

If you have any troubles or questions please start discussion in [Issues page](https://github.com/silverbulleters/sonarqube-inject-vsc/issues) or [Gitter](https://gitter.im/silverbulleters/sonarqube-inject-vsc).

### SonarQube server with enabled Organization mode (eg. SonarCloud.io)

To analyze projects on SonarQube servers with Organizations you need to add `organizationKey` property in your `global.json` configuration file.

```json
{
"servers": [
{
"id": "localhost",
"url": "http://localhost:9000",
"token": "c8ecbc03f615ddbc1d97ad478ee024b45b6784c1",
"organizationKey": "my-organization-key"
}
]
}
```

You need to add new entry to `servers` array for every organization you want to add.

## Extension settings

* `sonarqube-inject.enableLinter`
Expand Down Expand Up @@ -93,17 +145,6 @@ Creates and opens a local config file with current project info
* `SonarQube Inject: Update bindings to SonarQube server`
Reconnects to SonarQube server and updates all links.


## Connected mode

You can run analysis with connection to your SonarQube server.

To do this you need to create two small config files.
Create and edit first file - global config - via `SonarQube Inject: Create global config with credentials to servers` command.
Create and edit second file - procjet config - via `SonarQube Inject: Create local sonarlint config with project binding` command.
If you have any troubles or questions please follow the instructions on [SonarLint website](http://www.sonarlint.org/commandline/index.html), section `Connected mode`, or start discussion in [Issues page](https://github.com/silverbulleters/sonarqube-inject-vsc/issues) or [Gitter](https://gitter.im/silverbulleters/sonarqube-inject-vsc).
Don't forget to run `SonarQube Inject: Update bindings to SonarQube server` command in VSC or `sonarlint -u` in command line at your project workspace to update server bindings.

## Limitations

Currently works only with special `sonarlint-cli` version bundled with the extension. Source code can be found [here](https://github.com/nixel2007/sonarlint-cli/tree/feature/console-analysis).
Expand Down
2 changes: 1 addition & 1 deletion download-sonarlint-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const pathToExtract = path.join(__filename, "./../tools");
const pathToDownload = path.join(pathToExtract, "sonarlint-cli.zip");

const sonarlintCLILocation =
"https://github.com/nixel2007/sonarlint-cli/releases/download/console-report-1.2/sonarlint-cli.zip";
"https://github.com/nixel2007/sonarlint-cli/releases/download/console-report-1.4/sonarlint-cli.zip";

const options = {
url: sonarlintCLILocation,
Expand Down
Loading

0 comments on commit a41504c

Please sign in to comment.