diff --git a/.codeclimate.yml b/.codeclimate.yml new file mode 100644 index 0000000..5cd0b53 --- /dev/null +++ b/.codeclimate.yml @@ -0,0 +1,11 @@ +--- +engines: + fixme: + enabled: true + pmd: + enabled: true + channel: beta +ratings: + paths: [] +exclude_paths: + - "test/" diff --git a/Makefile b/Makefile index ab780c2..cb211c2 100644 --- a/Makefile +++ b/Makefile @@ -6,5 +6,4 @@ image: docker build --rm -t $(IMAGE_NAME) . test: image - docker run --rm $(IMAGE_NAME) sh -c "echo Nothing to do yet!" - + docker run --rm -v $(PWD):/code $(IMAGE_NAME) /code/test.groovy diff --git a/test.groovy b/test.groovy new file mode 100755 index 0000000..79cce29 --- /dev/null +++ b/test.groovy @@ -0,0 +1,13 @@ +#!/usr/bin/env groovy + +def command = "/usr/src/app/pmd.groovy --codeFolder=/code/test --configFile=/code/test/config.json" + +def proc = command.execute() +def out = new StringBuffer() +def err = new StringBuffer() + +proc.waitForProcessOutput(out, err) + +assert proc.exitValue() == 0 +assert !out.toString().isEmpty() +assert err.toString().isEmpty() diff --git a/test/Main.java b/test/Main.java new file mode 100644 index 0000000..30ad68b --- /dev/null +++ b/test/Main.java @@ -0,0 +1,17 @@ +public class Main { + public boolean someLibraryMethod() {} + + public void foo() { + for (int i = 0; i < 10; i++) { + for (int k = 0; k < 20; k++) { + System.out.println("Hello"); + } + } + + for (int i = 0; i < 10; i++) { + for (int k = 0; k < 20; i++) { + System.out.println("Hello"); + } + } + } +} diff --git a/test/config.json b/test/config.json new file mode 100644 index 0000000..b85841e --- /dev/null +++ b/test/config.json @@ -0,0 +1,7 @@ +{ + "enabled": true, + "channel": "beta", + "include_paths": [ + "Main.java" + ] +} pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy