diff --git a/CHANGELOG.md b/CHANGELOG.md index 1ba76ce6..e2010918 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,10 +5,27 @@ Changelog of Git Changelog. ## Unreleased ### No issue +**Formatting code** + + +[86012292c5f70a4](https://github.com/tomasbjerre/git-changelog-lib/commit/86012292c5f70a4) Tomas Bjerre *2016-10-02 12:34:32* + + +## 1.9 +### GitHub [#4](https://github.com/tomasbjerre/violations-lib/issues/4) + +**ESLint** + + +[e9f338ef44d3a45](https://github.com/tomasbjerre/git-changelog-lib/commit/e9f338ef44d3a45) Tomas Bjerre *2016-10-01 11:25:19* + + +### No issue + **Preliminary support for StyleCop** -[82b0da58252b97e](https://github.com/tomasbjerre/git-changelog-lib/commit/82b0da58252b97e) Tomas Bjerre *2016-10-01 10:22:55* +[81e30321fa1619b](https://github.com/tomasbjerre/git-changelog-lib/commit/81e30321fa1619b) Tomas Bjerre *2016-10-01 10:24:14* **Support for FxCop** diff --git a/src/main/java/se/bjurr/violations/lib/parsers/AndroidLintParser.java b/src/main/java/se/bjurr/violations/lib/parsers/AndroidLintParser.java index bc2e70f2..5bd5f89c 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/AndroidLintParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/AndroidLintParser.java @@ -55,7 +55,7 @@ public List parseFile(File file) throws Exception { .setRule(rule)// .setMessage(id + ": " + summary + "\n" + message + "\n" + explanation)// .build()// - ); + ); } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/CPPCheckParser.java b/src/main/java/se/bjurr/violations/lib/parsers/CPPCheckParser.java index 8a3a35c9..2cab084b 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/CPPCheckParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/CPPCheckParser.java @@ -44,7 +44,7 @@ public List parseFile(File file) throws Exception { .setMessage(msg + ". " + verbose)// .setRule(id)// .build()// - ); + ); } } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/CSSLintParser.java b/src/main/java/se/bjurr/violations/lib/parsers/CSSLintParser.java index cd76c3cd..1f3a7b7d 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/CSSLintParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/CSSLintParser.java @@ -47,7 +47,7 @@ public List parseFile(File file) throws Exception { .setSeverity(toSeverity(severity))// .setMessage(message + ": " + evidence)// .build()// - ); + ); } } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/CheckStyleParser.java b/src/main/java/se/bjurr/violations/lib/parsers/CheckStyleParser.java index 4bc7a8ae..00352591 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/CheckStyleParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/CheckStyleParser.java @@ -47,7 +47,7 @@ public List parseFile(File file) throws Exception { .setMessage(message)// .setRule(rule)// .build()// - ); + ); } } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/CppLintParser.java b/src/main/java/se/bjurr/violations/lib/parsers/CppLintParser.java index 37c603d1..dbc5d971 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/CppLintParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/CppLintParser.java @@ -7,9 +7,6 @@ import static se.bjurr.violations.lib.model.SEVERITY.INFO; import static se.bjurr.violations.lib.model.SEVERITY.WARN; import static se.bjurr.violations.lib.model.Violation.violationBuilder; -/** - * PyLint. Format used by Flake8. - */ import static se.bjurr.violations.lib.parsers.ViolationParserUtils.getLines; import static se.bjurr.violations.lib.parsers.ViolationParserUtils.getParts; import static se.bjurr.violations.lib.reports.Reporter.CPPLINT; @@ -17,11 +14,14 @@ import java.io.File; import java.util.List; +import com.google.common.io.Files; + import se.bjurr.violations.lib.model.SEVERITY; import se.bjurr.violations.lib.model.Violation; -import com.google.common.io.Files; - +/** + * PyLint. Format used by Flake8. + */ public class CppLintParser implements ViolationsParser { @Override @@ -48,7 +48,7 @@ public List parseFile(File file) throws Exception { .setSeverity(toSeverity(severity))// .setMessage(message)// .build()// - ); + ); } return violations; } diff --git a/src/main/java/se/bjurr/violations/lib/parsers/FindbugsParser.java b/src/main/java/se/bjurr/violations/lib/parsers/FindbugsParser.java index 9311a689..f5664230 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/FindbugsParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/FindbugsParser.java @@ -120,7 +120,7 @@ private void parseBugInstance(XMLStreamReader xmlr, List violations, .setSource(classname)// .setSpecific(FINDBUGS_SPECIFIC_RANK, rank)// .build()// - ); + ); } } if (eventType == XMLStreamConstants.END_ELEMENT) { diff --git a/src/main/java/se/bjurr/violations/lib/parsers/Flake8Parser.java b/src/main/java/se/bjurr/violations/lib/parsers/Flake8Parser.java index 560bcfe7..1f8d3fe7 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/Flake8Parser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/Flake8Parser.java @@ -52,7 +52,7 @@ public List parseFile(File file) throws Exception { .setSeverity(toSeverity(severity))// .setMessage(message)// .build()// - ); + ); } return violations; } diff --git a/src/main/java/se/bjurr/violations/lib/parsers/JSHintParser.java b/src/main/java/se/bjurr/violations/lib/parsers/JSHintParser.java index 594412ed..1953ad08 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/JSHintParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/JSHintParser.java @@ -46,7 +46,7 @@ public List parseFile(File file) throws Exception { .setSeverity(toSeverity(severity))// .setMessage(message)// .build()// - ); + ); } } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/LintParser.java b/src/main/java/se/bjurr/violations/lib/parsers/LintParser.java index 1cb30709..69736187 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/LintParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/LintParser.java @@ -47,7 +47,7 @@ public List parseFile(File file) throws Exception { .setSeverity(toSeverity(severity))// .setMessage(message + ": " + evidence)// .build()// - ); + ); } } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/PMDParser.java b/src/main/java/se/bjurr/violations/lib/parsers/PMDParser.java index f1f5c175..c82256a3 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/PMDParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/PMDParser.java @@ -50,7 +50,7 @@ public List parseFile(File file) throws Exception { .setRule(rule)// .setMessage(ruleSet + " " + externalInfoUrl)// .build()// - ); + ); } } return violations; diff --git a/src/main/java/se/bjurr/violations/lib/parsers/PerlCriticParser.java b/src/main/java/se/bjurr/violations/lib/parsers/PerlCriticParser.java index a094fbb9..203d13a4 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/PerlCriticParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/PerlCriticParser.java @@ -49,7 +49,7 @@ public List parseFile(File file) throws Exception { .setSeverity(toSeverity(severity))// .setMessage(message)// .build()// - ); + ); } return violations; } diff --git a/src/main/java/se/bjurr/violations/lib/parsers/PiTestParser.java b/src/main/java/se/bjurr/violations/lib/parsers/PiTestParser.java index 75bd5099..916ca450 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/PiTestParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/PiTestParser.java @@ -50,13 +50,13 @@ public List parseFile(File file) throws Exception { .setMessage(message)// .setSpecifics(// of(// - "detected", detected,// - "mutatedMethod", mutatedMethod,// - "mutatedClass", mutatedClass,// - "status", status,// + "detected", detected, // + "mutatedMethod", mutatedMethod, // + "mutatedClass", mutatedClass, // + "status", status, // "methodDescription", methodDescription))// .build()// - ); + ); } return violations; } diff --git a/src/main/java/se/bjurr/violations/lib/parsers/ResharperParser.java b/src/main/java/se/bjurr/violations/lib/parsers/ResharperParser.java index ca2c368c..cda9ae32 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/ResharperParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/ResharperParser.java @@ -55,7 +55,7 @@ public List parseFile(File file) throws Exception { .setMessage(message)// .setRule(typeId)// .build()// - ); + ); } return violations; } diff --git a/src/main/java/se/bjurr/violations/lib/parsers/XMLLintParser.java b/src/main/java/se/bjurr/violations/lib/parsers/XMLLintParser.java index bfde0753..58d3ce94 100644 --- a/src/main/java/se/bjurr/violations/lib/parsers/XMLLintParser.java +++ b/src/main/java/se/bjurr/violations/lib/parsers/XMLLintParser.java @@ -12,10 +12,10 @@ import java.io.File; import java.util.List; -import se.bjurr.violations.lib.model.Violation; - import com.google.common.io.Files; +import se.bjurr.violations.lib.model.Violation; + public class XMLLintParser implements ViolationsParser { @Override @@ -41,7 +41,7 @@ public List parseFile(File file) throws Exception { .setSeverity(ERROR)// .setMessage(message)// .build()// - ); + ); } return violations; } diff --git a/src/test/java/se/bjurr/violations/lib/AccumulatedTest.java b/src/test/java/se/bjurr/violations/lib/AccumulatedTest.java index 0cb48c68..3f1d1cff 100644 --- a/src/test/java/se/bjurr/violations/lib/AccumulatedTest.java +++ b/src/test/java/se/bjurr/violations/lib/AccumulatedTest.java @@ -25,19 +25,19 @@ public void testThatViolationsCanBeFiltered() { .withAtLeastSeverity(ERROR)// .orderedBy(FILE)// .violations())// - .hasSize(1); + .hasSize(1); assertThat(violationsAccumulatedReporterApi// .withAtLeastSeverity(WARN)// .orderedBy(FILE)// .violations())// - .hasSize(8); + .hasSize(8); assertThat(violationsAccumulatedReporterApi// .withAtLeastSeverity(INFO)// .orderedBy(FILE)// .violations())// - .hasSize(10); + .hasSize(10); } @Test @@ -49,28 +49,28 @@ public void testThatViolationsCanBeOrdered() { .orderedBy(FILE)// .violations()// .get(0).getFile())// - .isEqualTo("../../../web/js-file.js"); + .isEqualTo("../../../web/js-file.js"); assertThat(reverse(violationsAccumulatedReporterApi// .withAtLeastSeverity(INFO)// .orderedBy(FILE)// .violations())// - .get(0).getFile())// - .isEqualTo("/src/main/java/se/bjurr/violations/lib/example/OtherClass.java"); + .get(0).getFile())// + .isEqualTo("/src/main/java/se/bjurr/violations/lib/example/OtherClass.java"); assertThat(violationsAccumulatedReporterApi// .withAtLeastSeverity(INFO)// .orderedBy(SEVERITY)// .violations()// .get(0).getSeverity())// - .isEqualTo(INFO); + .isEqualTo(INFO); assertThat(reverse(violationsAccumulatedReporterApi// .withAtLeastSeverity(INFO)// .orderedBy(SEVERITY)// .violations())// - .get(0).getSeverity())// - .isEqualTo(ERROR); + .get(0).getSeverity())// + .isEqualTo(ERROR); } @@ -91,6 +91,6 @@ private ViolationsAccumulatedReporterApi getAccumulatedReporterApi() { .inFolder(rootFolder) // .findAll(JSHINT) // .violations()// - ); + ); } } diff --git a/src/test/java/se/bjurr/violations/lib/AndroidLintTest.java b/src/test/java/se/bjurr/violations/lib/AndroidLintTest.java index 227b5a24..2796b0e8 100644 --- a/src/test/java/se/bjurr/violations/lib/AndroidLintTest.java +++ b/src/test/java/se/bjurr/violations/lib/AndroidLintTest.java @@ -26,27 +26,27 @@ public void testThatViolationsCanBeParsed() { List actual = violationsReporterApi() // .withPattern(".*/androidlint/.*\\.xml$") // - .inFolder(rootFolder).findAll(ANDROIDLINT) // + .inFolder(rootFolder)// + .findAll(ANDROIDLINT) // .violations(); - assertThat(actual) - .containsExactly( - violationBuilder() - .setReporter(ANDROIDLINT) - .setFile("app/src/main/res/layout/fragment_main.xml") - .setSource(null) - .setStartLine(10) - .setEndLine(10) - .setColumn(9) + assertThat(actual)// + .containsExactly(// + violationBuilder()// + .setReporter(ANDROIDLINT)// + .setFile("app/src/main/res/layout/fragment_main.xml")// + .setSource(null)// + .setStartLine(10)// + .setEndLine(10)// + .setColumn(9)// .setRule("Correctness") - .setMessage( - "ScrollViewSize: ScrollView size validation\n" - + "This LinearLayout should use `android:layout_height="wrap_content"`\n" - + "ScrollView children must set their `layout_width` or `layout_height` attributes to `wrap_content` rather than `fill_parent` or `match_parent` in the scrolling dimension") // + .setMessage("ScrollViewSize: ScrollView size validation\n" + + "This LinearLayout should use `android:layout_height="wrap_content"`\n" + + "ScrollView children must set their `layout_width` or `layout_height` attributes to `wrap_content` rather than `fill_parent` or `match_parent` in the scrolling dimension") // .setSeverity(WARN) // .build(), // - violationBuilder() - .setReporter(ANDROIDLINT) + violationBuilder()// + .setReporter(ANDROIDLINT)// .setFile( ".gradle/caches/modules-2/files-2.1/com.squareup.okio/okio/1.4.0/5b72bf48563ea8410e650de14aa33ff69a3e8c35/okio-1.4.0.jar") // .setSource(null) // @@ -54,17 +54,16 @@ public void testThatViolationsCanBeParsed() { .setEndLine(0) // .setColumn(null) // .setRule("Correctness") // - .setMessage( - "InvalidPackage: Package not included in Android\n" - + "Invalid package reference in library; not included in Android: `java.nio.file`. Referenced from `okio.Okio`.\n" - + "This check scans through libraries looking for calls to APIs that are not included in Android.\n" - + " \n" - + " When you create Android projects, the classpath is set up such that you can only access classes in the API packages that are included in Android. However, if you add other projects to your libs/ folder, there is no guarantee that those .jar files were built with an Android specific classpath, and in particular, they could be accessing unsupported APIs such as java.applet.\n" - + " \n" - + " This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.") // + .setMessage("InvalidPackage: Package not included in Android\n" + + "Invalid package reference in library; not included in Android: `java.nio.file`. Referenced from `okio.Okio`.\n" + + "This check scans through libraries looking for calls to APIs that are not included in Android.\n" + + " \n" + + " When you create Android projects, the classpath is set up such that you can only access classes in the API packages that are included in Android. However, if you add other projects to your libs/ folder, there is no guarantee that those .jar files were built with an Android specific classpath, and in particular, they could be accessing unsupported APIs such as java.applet.\n" + + " \n" + + " This check scans through library jars and looks for references to API packages that are not included in Android and flags these. This is only an error if your code calls one of the library classes which wind up referencing the unsupported package.") // .setSeverity(ERROR) // .build() // - ); + ); } } diff --git a/src/test/java/se/bjurr/violations/lib/CSSLintTest.java b/src/test/java/se/bjurr/violations/lib/CSSLintTest.java index 084795f5..21c466c2 100644 --- a/src/test/java/se/bjurr/violations/lib/CSSLintTest.java +++ b/src/test/java/se/bjurr/violations/lib/CSSLintTest.java @@ -60,6 +60,6 @@ public void testThatViolationsCanBeParsed() { .setRule(null)// .setSeverity(WARN)// .build() // - ); + ); } } diff --git a/src/test/java/se/bjurr/violations/lib/CheckstyleTest.java b/src/test/java/se/bjurr/violations/lib/CheckstyleTest.java index fd113628..f3c49b6d 100644 --- a/src/test/java/se/bjurr/violations/lib/CheckstyleTest.java +++ b/src/test/java/se/bjurr/violations/lib/CheckstyleTest.java @@ -73,6 +73,6 @@ public void testThatViolationsCanBeParsed() { .setRule("com.puppycrawl.tools.checkstyle.checks.metrics.BooleanExpressionComplexityCheck")// .setSeverity(WARN)// .build()// - ); + ); } } diff --git a/src/test/java/se/bjurr/violations/lib/FindbugsTest.java b/src/test/java/se/bjurr/violations/lib/FindbugsTest.java index d61cabc5..63b1ebb8 100644 --- a/src/test/java/se/bjurr/violations/lib/FindbugsTest.java +++ b/src/test/java/se/bjurr/violations/lib/FindbugsTest.java @@ -72,12 +72,12 @@ public void testThatViolationsCanBeParsed() { public void testMavenGeneratedFindbugs() { String rootFolder = getRootFolder(); List maven = violationsReporterApi() // - .withPattern(".*/findbugs/fromMaven.xml$") // - .inFolder(rootFolder) // - .findAll(FINDBUGS) // - .violations(); + .withPattern(".*/findbugs/fromMaven.xml$") // + .inFolder(rootFolder) // + .findAll(FINDBUGS) // + .violations(); assertThat(maven)// - .hasSize(1); + .hasSize(1); } } diff --git a/src/test/java/se/bjurr/violations/lib/LintTest.java b/src/test/java/se/bjurr/violations/lib/LintTest.java index 4fd12cf5..aa78af7d 100644 --- a/src/test/java/se/bjurr/violations/lib/LintTest.java +++ b/src/test/java/se/bjurr/violations/lib/LintTest.java @@ -49,6 +49,6 @@ public void testThatViolationsCanBeParsed() { .setRule(null)// .setSeverity(WARN)// .build() // - ); + ); } } diff --git a/src/test/java/se/bjurr/violations/lib/model/ViolationTest.java b/src/test/java/se/bjurr/violations/lib/model/ViolationTest.java index 449df2ae..f5cf634d 100644 --- a/src/test/java/se/bjurr/violations/lib/model/ViolationTest.java +++ b/src/test/java/se/bjurr/violations/lib/model/ViolationTest.java @@ -21,7 +21,7 @@ public void testThatFilePathsAreAlwaysFronSlashes() { .build()// .getFile()// )// - .isEqualTo("c:/path/to/file.xml"); + .isEqualTo("c:/path/to/file.xml"); } }