From 171d07c3e276de7cc9ffef60a950787df36bf571 Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Fri, 8 Sep 2017 14:11:19 -0300 Subject: [PATCH 1/3] Sanity check test --- test.groovy | 13 +++++++++++++ test/Main.java | 17 +++++++++++++++++ test/config.json | 7 +++++++ 3 files changed, 37 insertions(+) create mode 100755 test.groovy create mode 100644 test/Main.java create mode 100644 test/config.json 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" + ] +} From b04682955ac1dd56d0c36b9ee7e26693f01fec96 Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Fri, 8 Sep 2017 14:11:47 -0300 Subject: [PATCH 2/3] Ensure test run --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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 From 0a909009482c2047ad857c14c86347d35f269fd7 Mon Sep 17 00:00:00 2001 From: Filipe Esperandio Date: Fri, 8 Sep 2017 14:11:58 -0300 Subject: [PATCH 3/3] Integrate with CC --- .codeclimate.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 .codeclimate.yml 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/" 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