Skip to content

Commit d131779

Browse files
authored
Merge pull request #15 from necto/upgrade-sonarlint
Upgrade SonarLint language server and analyzers. Drop Scala and Ruby. Drop Windows.
2 parents 80845ad + 52dc406 commit d131779

28 files changed

+579
-227
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ jobs:
1717
strategy:
1818
fail-fast: false
1919
matrix:
20-
os: [ubuntu-latest, macos-latest, windows-latest]
20+
os: [ubuntu-latest, macos-latest]
2121
emacs-version:
2222
- 27.2
2323
- 28.2
@@ -37,6 +37,17 @@ jobs:
3737
steps:
3838
- uses: actions/checkout@v3
3939

40+
- name: Setup Java # SonarLint runs on Java.
41+
uses: actions/setup-java@v3
42+
with:
43+
distribution: 'temurin'
44+
java-version: 11
45+
46+
- name: Setup NodeJS # for JS and TS analyzer
47+
uses: actions/setup-node@v3
48+
with:
49+
node-version: 16
50+
4051
- uses: jcs090218/setup-emacs@master
4152
with:
4253
version: ${{ matrix.emacs-version }}

Eask

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
(package "lsp-sonarlint"
22
"0.0.1"
3-
"Emacs Sonarlint lsp client")
3+
"Emacs SonarLint lsp client")
44

55
(website-url "https://github.com/emacs-lsp/lsp-sonarlint")
6-
(keywords "languages" "tools" "php" "javascript" "xml" "ruby" "html" "scala" "java" "python")
6+
(keywords "languages" "tools" "php" "javascript" "typescript" "go" "xml" "html" "java" "python")
77

88
(package-file "lsp-sonarlint.el")
99

@@ -19,4 +19,7 @@
1919
(depends-on "lsp-mode" "6.3")
2020
(depends-on "ht" "2.3")
2121

22+
(development
23+
(depends-on "ert"))
24+
2225
(setq network-security-level 'low) ; see https://github.com/jcs090218/setup-emacs-windows/issues/156#issuecomment-932956432

Makefile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ SHELL := /usr/bin/env bash
33
EMACS ?= emacs
44
EASK ?= eask
55

6-
TEST-FILES := $(shell ls test/lsp-sonarlint-*.el)
6+
TEST-FILES := $(shell ls test/*.el)
77

88
.PHONY: clean checkdoc lint package install compile test
99

10-
ci: clean package install compile
10+
ci: clean package install compile test
1111

1212
package:
1313
@echo "Packaging..."
@@ -23,7 +23,7 @@ compile:
2323

2424
test:
2525
@echo "Testing..."
26-
$(EASK) exec ert-runner -L . $(LOAD-TEST-FILES) -t '!no-win' -t '!org'
26+
$(EASK) test ert $(TEST-FILES)
2727

2828
clean:
2929
$(EASK) clean all

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ SonarLint™ is a free IDE extension that lets you fix coding issues before they
88

99
Like a spell checker,it highlights Bugs and Security Vulnerabilities as you write code, with clear remediation guidance so you can fix them before the code is even committed.
1010

11-
In Emacs supports analysis of JavaScript, TypeScript, Python, Java, HTML , PHP, Ruby, Scala and XML out of the box!
11+
In Emacs supports analysis of JavaScript, TypeScript, Python, Java, HTML, PHP, Go, and XML out of the box!
1212

1313
:warning: This is not an official [SonarSource](https://www.sonarsource.com/) extension
1414

@@ -96,9 +96,9 @@ Out of the box, SonarLint automatically checks your code against the following r
9696
- [Java rules](https://rules.sonarsource.com/java)
9797
- [HTML rules](https://rules.sonarsource.com/html)
9898
- [PHP rules](https://rules.sonarsource.com/php)
99-
- [Scala rules](https://rules.sonarsource.com/scala)
100-
- [Ruby rules](https://rules.sonarsource.com/ruby)
10199
- [XML rules](https://rules.sonarsource.com/xml)
100+
- [Go rules](https://rules.sonarsource.com/go)
101+
- [Bidi (bidirectional unicode characters)](https://rules.sonarsource.com/text/) + [Secrets](https://rules.sonarsource.com/secrets/)
102102

103103
## Supported settings
104104

@@ -107,7 +107,9 @@ Out of the box, SonarLint automatically checks your code against the following r
107107
* `lsp-sonarlint-disable-telemetry` - Disable telemetry option (disabled by default).
108108
* `lsp-sonarlint-test-file-pattern` - Regex to find test file, most rules are not evaluated on test files.
109109
* `lsp-sonarlint-show-analyzer-logs` - Show analyzer logs.
110-
* `lsp-sonarlint-server-download-url` - Sonarlint server download URL.
110+
* `lsp-sonarlint-verbose-logs` - Make SonarLint logs verbose.
111+
* `lsp-sonarlint-server-download-url` - SonarLint server download URL.
112+
* `lsp-sonarlint-plugin-autodownload` - Not ask for confirmation and download analyzers if they are missing.
111113

112114
### Plugins supported settings
113115
This settigns are common for all the language plugins.

fixtures/javascript-sample.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
function f1() {
2+
// TODO: FIXME here
3+
return 18;
4+
}

fixtures/sample.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package main
2+
3+
import "fmt"
4+
// TODO: to be done, really
5+
func main() {
6+
fmt.Println("Hello, World!")
7+
}

fixtures/sample.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
<body>
2+
<!-- TODO: complete this document -->
3+
</body>

fixtures/sample.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class HelloWorld {
2+
// TODO: flag this comment
3+
public static void main(String[] args) {
4+
System.out.println("Hello, World!");
5+
}
6+
}

fixtures/sample.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<?php
2+
echo "Hello, World!";
3+
// TODO: something more elaborate
4+
?>

fixtures/sample.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
# TODO: why not do this todo now?
3+
if true or false:
4+
break

0 commit comments

Comments
 (0)