Skip to content

Commit 1ec6748

Browse files
authored
Update name and example link (#12)
1 parent fa73f44 commit 1ec6748

File tree

3 files changed

+25
-25
lines changed

3 files changed

+25
-25
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
# [Sonarqube](https://www.sonarqube.org/) Sourcegraph extension
1+
# [SonarQube](https://www.sonarqube.org/) Sourcegraph extension
22

3-
Show Sonarqube issues when browsing files on Sourcegraph.
3+
Show SonarQube issues when browsing files on Sourcegraph.
44

55
<p>
66
<picture>
@@ -10,41 +10,41 @@ Show Sonarqube issues when browsing files on Sourcegraph.
1010
</picture>
1111
</p>
1212

13-
➡️ Try it out on [github.com/apache/struts](https://sourcegraph.com/github.com/apache/struts/-/blob/core/src/main/java/org/apache/struts2/action/CspReportAction.java#L60)
13+
➡️ Try it out on [github.com/apache/struts](https://sourcegraph.com/github.com/apache/struts/-/blob/bundles/admin/src/main/java/org/apache/struts2/osgi/admin/actions/BundlesAction.java#L41)
1414

15-
You can toggle decorations with the Sonarqube button in the action toolbar.
16-
Each decoration links to the issue on Sonarqube.
15+
You can toggle decorations with the SonarQube button in the action toolbar.
16+
Each decoration links to the issue on SonarQube.
1717

1818
## Configuration
1919

2020
The extension can be configured through JSON in user, organization or global settings.
2121

2222
```jsonc
2323
{
24-
// Configure the extension to use a private Sonarqube instance.
24+
// Configure the extension to use a private SonarQube instance.
2525
// By default, Sonarcloud is used.
2626
"sonarqube.instanceUrl": "https://sonarcloud.io/",
27-
// An API token to the Sonarqube instance, if needed.
27+
// An API token to the SonarQube instance, if needed.
2828
"sonarqube.apiToken": "...",
2929

30-
// The Sonarqube extension needs to map the repository on Sourcegraph to a project inside an organization on
31-
// Sonarqube. The default settings work for most projects on Sonarcloud, but if you have a custom setup, you
30+
// The SonarQube extension needs to map the repository on Sourcegraph to a project inside an organization on
31+
// SonarQube. The default settings work for most projects on SonarCloud, but if you have a custom setup, you
3232
// can configure the following settings.
3333

3434
// This regular expression is matched on the repository name. The values from the capture groups are
3535
// available in the templates below.
3636
"sonarqube.repositoryNamePattern": "(?:^|/)([^/]+)/([^/]+)$",
37-
// This template is used to form the Sonarqube organization key.
37+
// This template is used to form the SonarQube organization key.
3838
// By default, the second-last part of the repository name (first capture group above) is used as-is.
3939
// E.g. "apache" from "github.com/apache/struts".
4040
"sonarqube.organizationKeyTemplate": "$1",
41-
// This template is used to form the Sonarqube project key.
41+
// This template is used to form the SonarQube project key.
4242
// By default, the second-last and last part of the repository name (first and second capture groups above)
4343
// are joined by an underscore.
4444
// E.g. "apache_struts" from "github.com/apache/struts".
4545
"sonarqube.projectKeyTemplate": "$1_$2",
4646

47-
// CORS headers are necessary for the extension to fetch data, but Sonarqube does not send them by default.
47+
// CORS headers are necessary for the extension to fetch data, but SonarQube does not send them by default.
4848
// Here you can customize the URL to an HTTP proxy that adds CORS headers.
4949
// By default Sourcegraph's CORS proxy is used.
5050
// Set this to `null` to opt out of using a CORS proxy.
@@ -54,9 +54,9 @@ The extension can be configured through JSON in user, organization or global set
5454

5555
## Limitations
5656

57-
The current commit viewed on Sourcegraph may not be analyzed on Sonarqube.
58-
If that is the case, the extension will fallback to the latest analysis available on Sonarqube on the default branch.
59-
This may result in decorations being off in some files if those files differ between the commit being viewed and the one analyzed on Sonarqube.
57+
The current commit viewed on Sourcegraph may not be analyzed on SonarQube.
58+
If that is the case, the extension will fallback to the latest analysis available on SonarQube on the default branch.
59+
This may result in decorations being off in some files if those files differ between the commit being viewed and the one analyzed on SonarQube.
6060

6161
---
6262

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"$schema": "https://raw.githubusercontent.com/sourcegraph/sourcegraph/main/client/shared/src/schema/extension.schema.json",
33
"name": "sonarqube",
4-
"description": "Show Sonarqube issues when browsing files on Sourcegraph",
4+
"description": "Show SonarQube issues when browsing files on Sourcegraph",
55
"publisher": "sourcegraph",
66
"icon": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512'%3E%3Cdefs/%3E%3Crect width='512' height='512' fill='%23549dd0'/%3E%3Cdefs%3E%3Crect id='a' y='0' width='512' height='512'/%3E%3C/defs%3E%3CclipPath id='b'%3E%3Cuse xlink:href='%23a' overflow='visible'/%3E%3C/clipPath%3E%3Cpath d='M409 448h-22c0-179-148-325-330-325v-22c194 0 352 155 352 347' clip-path='url(%23b)' fill='%23fff'/%3E%3Cg%3E%3Cdefs%3E%3Crect id='c' y='0' width='512' height='512'/%3E%3C/defs%3E%3CclipPath id='d'%3E%3Cuse xlink:href='%23c' overflow='visible'/%3E%3C/clipPath%3E%3Cpath d='M424 329A335 335 0 00192 89l5-18a354 354 0 01245 253l-18 5z' clip-path='url(%23d)' fill='%23fff'/%3E%3C/g%3E%3Cg%3E%3Cdefs%3E%3Crect id='e' y='0' width='512' height='512'/%3E%3C/defs%3E%3CclipPath id='f'%3E%3Cuse xlink:href='%23e' overflow='visible'/%3E%3C/clipPath%3E%3Cpath d='M441 223c-27-60-74-113-132-148l8-12c60 36 109 91 138 154l-14 6z' clip-path='url(%23f)' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E",
77
"activationEvents": [
@@ -12,7 +12,7 @@
1212
"External services"
1313
],
1414
"tags": [
15-
"Sonarqube"
15+
"SonarQube"
1616
],
1717
"contributes": {
1818
"actions": [
@@ -28,7 +28,7 @@
2828
"json"
2929
],
3030
"title": "${get(context, 'sonarqube.errorMessage') || (config.sonarqube.showIssuesOnCodeViews && \"Hide inline Sonarqube issues\" || \"Show inline Sonarqube issues\")}",
31-
"category": "Sonarqube",
31+
"category": "SonarQube",
3232
"actionItem": {
3333
"description": "${get(context, 'sonarqube.errorMessage') || (config.sonarqube.showIssuesOnCodeViews && \"Hide inline Sonarqube issues\" || \"Show inline Sonarqube issues\")}",
3434
"iconURL": "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 512 512'%3E%3Cdefs/%3E%3Crect width='512' height='512' fill='%23${get(context, 'sonarqube.errorMessage') && \"999\" || \"549dd0\"}'/%3E%3Cdefs%3E%3Crect id='a' y='0' width='512' height='512'/%3E%3C/defs%3E%3CclipPath id='b'%3E%3Cuse xlink:href='%23a' overflow='visible'/%3E%3C/clipPath%3E%3Cpath d='M409 448h-22c0-179-148-325-330-325v-22c194 0 352 155 352 347' clip-path='url(%23b)' fill='%23fff'/%3E%3Cg%3E%3Cdefs%3E%3Crect id='c' y='0' width='512' height='512'/%3E%3C/defs%3E%3CclipPath id='d'%3E%3Cuse xlink:href='%23c' overflow='visible'/%3E%3C/clipPath%3E%3Cpath d='M424 329A335 335 0 00192 89l5-18a354 354 0 01245 253l-18 5z' clip-path='url(%23d)' fill='%23fff'/%3E%3C/g%3E%3Cg%3E%3Cdefs%3E%3Crect id='e' y='0' width='512' height='512'/%3E%3C/defs%3E%3CclipPath id='f'%3E%3Cuse xlink:href='%23e' overflow='visible'/%3E%3C/clipPath%3E%3Cpath d='M441 223c-27-60-74-113-132-148l8-12c60 36 109 91 138 154l-14 6z' clip-path='url(%23f)' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E",
@@ -49,17 +49,17 @@
4949
"type": "object",
5050
"properties": {
5151
"sonarqube.showIssuesOnCodeViews": {
52-
"description": "Whether to show Sonarqube issues inline on code views.",
52+
"description": "Whether to show SonarQube issues inline on code views.",
5353
"type": "boolean",
5454
"default": true
5555
},
5656
"sonarqube.instanceUrl": {
57-
"description": "The URL to the Sonarqube instance.",
57+
"description": "The URL to the SonarQube instance.",
5858
"type": "string",
5959
"default": "https://sonarcloud.io/"
6060
},
6161
"sonarqube.apiToken": {
62-
"description": "The API authentication token for the Sonarqube instance, if needed.",
62+
"description": "The API authentication token for the SonarQube instance, if needed.",
6363
"type": "string"
6464
},
6565
"sonarqube.corsAnywhereUrl": {

src/sonarqube.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ export function activate(context: sourcegraph.ExtensionContext): void {
8787
/\$(\d)/g,
8888
(substring, number: string) => repositoryNameMatch[+number]
8989
)
90-
console.log('Mapped repository name to Sonarqube according to templates', {
90+
console.log('Mapped repository name to SonarQube according to templates', {
9191
organization,
9292
project,
9393
})
@@ -106,15 +106,15 @@ export function activate(context: sourcegraph.ExtensionContext): void {
106106

107107
if (!component) {
108108
throw new Error(
109-
`Could not find Sonarqube component for this file in Sonarqube project "${project}"`
109+
`Could not find SonarQube component for this file in SonarQube project "${project}"`
110110
)
111111
}
112112

113113
const branches = await listBranches({ project, ...apiOptions })
114114
const branch = branches.find(branch => branch?.commit?.sha === commitID)
115115
if (!branch) {
116116
console.warn(
117-
`No Sonarqube branch found for commit ID ${commitID}, falling back to default branch`
117+
`No SonarQube branch found for commit ID ${commitID}, falling back to default branch`
118118
)
119119
}
120120

@@ -127,7 +127,7 @@ export function activate(context: sourcegraph.ExtensionContext): void {
127127

128128
return { editor, issues, errorMessage: null as string | null, sonarqubeUrl }
129129
} catch (error) {
130-
console.error('Error fetching Sonarqube data:', error)
130+
console.error('Error fetching SonarQube data:', error)
131131
return { editor, issues: [] as Issue[], errorMessage: String(error?.message) }
132132
}
133133
})

0 commit comments

Comments
 (0)