Skip to content

Commit

Permalink
Enable stricter qodana rules (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
I-Al-Istannen authored Oct 22, 2021
1 parent 7e36638 commit ab6ab41
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
8 changes: 8 additions & 0 deletions .github/workflows/analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,25 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up JDK
uses: actions/setup-java@v1
with:
java-version: 17
- uses: actions/cache@v2
with:
path: ~/work/_temp/_github_home/qodana-cache
key: ${{ runner.os }}-qodana-${{ github.ref }}
restore-keys: |
${{ runner.os }}-qodana-${{ github.ref }}
${{ runner.os }}-qodana-
- run: ./gradlew build
- uses: JetBrains/qodana-action@v3.1.1
with:
linter: qodana-jvm-community
fail-threshold: 1
- uses: actions/upload-artifact@v2
with:
path: ${{ github.workspace }}/qodana
- name: Print problems
run: cat qodana/report/results/result-allProblems.json | jq
- name: Fail on problems
Expand Down
4 changes: 1 addition & 3 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ repositories {

application {
mainClass.set("com.github.firmwehr.gentle.GentleCompiler")
applicationDefaultJvmArgs = listOf("--enable-preview");
applicationDefaultJvmArgs = listOf("--enable-preview")
}

buildDir = File("_build")
Expand Down Expand Up @@ -55,8 +55,6 @@ val integrationTest = task<Test>("integrationTest") {
shouldRunAfter("test")
}

tasks.check { dependsOn(integrationTest) }

dependencies {

// logging
Expand Down
5 changes: 5 additions & 0 deletions qodana.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1.0
profile:
name: qodana.recommended
exclude:
- name: JavaAnnotator # Counter - Hours wasted: 4
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public static void main(String[] args) {

private static void echoCommand(Path path) {
try (Stream<String> stream = Files.lines(path)) {
//noinspection UseOfSystemOutOrSystemErr
stream.forEach(System.out::println);
} catch (IOException e) {
LOGGER.error("Could not echo file '{}': {}", path, e.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class BuildGentle implements BeforeAllCallback, ExtensionContext.Store.Cl
@Override
public void beforeAll(ExtensionContext context) throws IOException, InterruptedException {
if (!started) {
//noinspection AssignmentToStaticFieldFromInstanceMethod
started = true;
context.getRoot().getStore(GLOBAL).put(getClass().getSimpleName(), this);
int exitCode = new ProcessBuilder("sh", "-c", "./build").inheritIO().start().waitFor();
Expand Down

0 comments on commit ab6ab41

Please sign in to comment.