Lint some code instantly ;-)
Using the world-renowned analyzers of SonarQube.
Borrowing some code from sonarlint-core.
Using Maven:
mvn clean install
Download latest versions of analyzers:
./scripts/download-analyzers.sh
Optionally, you can download all versions of all analyzers with:
./scripts/download-analyzers.sh --all
In instalint-http-server
, run:
mvn org.mortbay.jetty:jetty-maven-plugin:run
Or, to be able to run simply with mvn jetty:run
,
add this to <settings/>
in your ~/.m2/settings.xml
file:
<pluginGroups>
<pluginGroup>org.mortbay.jetty</pluginGroup>
</pluginGroups>
Open http://localhost:8080 in your browser, or:
curl -X POST localhost:8080/analyze -d language=javascript -d code=yourcode
curl -X POST localhost:8080/analyze -d language=javascript -d code="$(cat yourfile)"
- Select the language
- Copy-paste some code
The analysis results should appear within a second.
Java:
public class Hello {
private int add(int a, int b) {
return a + b;
}
}
JavaScript:
var arr = [1, 2, 3];
for (i in arr) {
console.log(i);
}
Python:
def indexOf:
pass
PHP:
<?php
// var a = [1, 2, 3];
?>