diff --git a/CHANGELOG.md b/CHANGELOG.md index e7f0017..78d84bb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,4 @@ +### 4.8.0 (2022-07-02) * Update checkstyle 9.1 -> 10.3.1 IMPORTANT: Checkstyle 10 requires java 11, but plugin will automatically switch to [backports](https://checkstyle.org/#Backport) for lower jre. diff --git a/LICENSE b/LICENSE index 04c168b..c107fdf 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2020 Vyacheslav Rusakov +Copyright (c) 2015-2022 Vyacheslav Rusakov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/README.md b/README.md index d9c56cf..5a2558b 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ NOTE: when updating plugin version in your project don't forget to call `clean` ```groovy plugins { - id 'ru.vyarus.quality' version '4.7.0' + id 'ru.vyarus.quality' version '4.8.0' } ``` @@ -59,7 +59,7 @@ buildscript { gradlePluginPortal() } dependencies { - classpath 'ru.vyarus:gradle-quality-plugin:4.7.0' + classpath 'ru.vyarus:gradle-quality-plugin:4.8.0' } } apply plugin: 'ru.vyarus.quality' @@ -73,7 +73,7 @@ Plugin compiled for java 8, compatible with java 11 Gradle | Version --------|------- -5.6 | 4.7.0 +5.6 | 4.8.0 5.1 | [4.2.2](http://xvik.github.io/gradle-quality-plugin/4.2.2) 4.1 | [3.4.0](http://xvik.github.io/gradle-quality-plugin/3.4.0) older | [2.4.0](http://xvik.github.io/gradle-quality-plugin/2.4.0) diff --git a/build.gradle b/build.gradle index ebb6219..44d2f19 100644 --- a/build.gradle +++ b/build.gradle @@ -24,7 +24,7 @@ ext { animalsnifferVersion = '1.5.4' cpdVersion = '3.3' spotbugsPluginVersion = '4.8.0' - docVersion = '4.7.0' + docVersion = '4.8.0' } repositories { mavenLocal(); mavenCentral(); gradlePluginPortal() } diff --git a/src/doc/docs/about/compatibility.md b/src/doc/docs/about/compatibility.md index 99dfb9b..46c8116 100644 --- a/src/doc/docs/about/compatibility.md +++ b/src/doc/docs/about/compatibility.md @@ -4,7 +4,7 @@ Plugin compiled for java 8, compatible with java 11 Gradle | Version --------|------- -5.6 | 4.7.0 +5.6 | 4.8.0 5.1 | [4.2.2](http://xvik.github.io/gradle-quality-plugin/4.2.2) 4.1 | [3.4.0](http://xvik.github.io/gradle-quality-plugin/3.4.0) older | [2.4.0](http://xvik.github.io/gradle-quality-plugin/2.4.0) diff --git a/src/doc/docs/about/history.md b/src/doc/docs/about/history.md index 48222f7..3351f0f 100644 --- a/src/doc/docs/about/history.md +++ b/src/doc/docs/about/history.md @@ -1,3 +1,29 @@ +### [4.8.0](http://xvik.github.io/gradle-quality-plugin/4.8.0) (2022-07-02) +* Update checkstyle 9.1 -> 10.3.1 + IMPORTANT: Checkstyle 10 requires java 11, but plugin will automatically switch to + [backports](https://checkstyle.org/#Backport) for lower jre. + Additional maven repository would be registered if required (LIMITED to checkstyle only) + Warning in log would clearly indicate when backport is used +* New option: quality.checkstyleBackport (by default true for jre < 11) + Option might be used to force backport for java >=11 or to disable backport at all +* Update checkstyle config: + - Add [UnusedLocalVariable](https://checkstyle.sourceforge.io/config_coding.html#UnusedLocalVariable) + - Change [MultipleStringLiterals](https://checkstyle.org/config_coding.html#MultipleStringLiterals) + to react on strings more than 2 chars only and allow 2 duplicates (to avoid warning in trivial cases) +* Update pmd 6.34 -> 6.47 (java 17-18 support) +* Update pmd config: + - Disable [AvoidAccessibilityAlteration](https://pmd.github.io/pmd-6.47.0/pmd_rules_java_errorprone.html#avoidaccessibilityalteration) + - Change [CognitiveComplexity](https://pmd.github.io/pmd-6.47.0/pmd_rules_java_design.html#cognitivecomplexity) reportLevel to 21 (default 15) + - Disable [ReturnEmptyArrayRatherThanNull](https://pmd.github.io/pmd-6.47.0/pmd_rules_java_errorprone.html#returnemptyarrayratherthannull) as deprecated +* Update codenarc 2.2.0 -> 3.1.0 (groovy 4 support) +* New option: quality.codenarcGroovy4 (by default, true) + Since codenarc 3.1 separate groovy4-based codenarc jar produced (codenarc-groovy4) + It would be used by default because groovy 4 has better adoption for newer JDKs + (codenarc task started with its own groovy so it does not restrict gradle version) + If you need to use older codenarc version then switch this option off manually +* Update spotbugs 4.4.2 -> 4.7.1 +* Update spotbugs plugin 4.7.9 -> 4.8.0 + ### [4.7.0](http://xvik.github.io/gradle-quality-plugin/4.7.0) (2021-11-10) * Fix gradle 7 deprecation warnings (#30) * Update spotbugs plugin 4.7.1 -> 4.7.9 diff --git a/src/doc/docs/about/license.md b/src/doc/docs/about/license.md index 45226d9..c107fdf 100644 --- a/src/doc/docs/about/license.md +++ b/src/doc/docs/about/license.md @@ -1,6 +1,6 @@ The MIT License (MIT) -Copyright (c) 2015-2021 Vyacheslav Rusakov +Copyright (c) 2015-2022 Vyacheslav Rusakov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/src/doc/docs/guide/config.md b/src/doc/docs/guide/config.md index 0346825..62f1b8d 100644 --- a/src/doc/docs/guide/config.md +++ b/src/doc/docs/guide/config.md @@ -38,6 +38,28 @@ quality { * disable it (property is useful only for enabling it in gradle 5.6 - 6.3). */ pmdIncremental = false + + /** + * Since checkstyle 10, minimum required java is 11. Community (not checkstyle core team!) started a + * backport (https://checkstyle.org/#Backport) project - maintaining java 8 compatibility. + * Backport releases would be delayed relative to main checkstyle releases (see + * https://rnveach.github.io/checkstyle-backport-jre8) + * + * NOTE: additional repository would be configured to download backport (only when backport required). But the + * repository would be limited to checkstyle group only! + * + * This property switches between backport and normal checkstyle versions. By default backport would be enabled + * on java 8-10, but you can manually enable it for all java versions if required. Or you can use false value + * to prevent backport behaviour and preventing new repository registration. + */ + checkstyleBackport = !JavaVersion.current().java11Compatible + + /** + * Since codenarc 3.1.0 there is a separate artifact for groovy 4 (CodeNarc-Groovy4). Gradle runs codenarc + * task with it's own groovy so by default groovy4 artifact is active. If you need to use earlier codenarc version + * then switch this option to false. + */ + codenarcGroovy4 = true /** * By default, cpd looks in all sources (cpd gradle plugin behaviour). When option enabled, quality plugin will diff --git a/src/doc/docs/tool/checkstyle.md b/src/doc/docs/tool/checkstyle.md index 4287b60..6f1ed97 100644 --- a/src/doc/docs/tool/checkstyle.md +++ b/src/doc/docs/tool/checkstyle.md @@ -12,6 +12,13 @@ By default, plugin activates if java sources available (`src/main/java`). contains all possible checks, but some of them are disabled (note that some checkstyle rules are opposite and never intended to be used together). Uncomment check to enable it. +!!! warning + Checkstyle 10 requires java 11 or above. In order to preserve java 8 compatibility, + plugin would automatically switch to [backport](https://checkstyle.org/#Backport). + Such backport is loaded from *custom repository* (limited to checkstyle only!). + You'll see a warning in logs about backport activation. + If required, this behaviour could be disabled with `quality.checkstyleBackport` configuration option. + !!! note "" In case you will use a custom config: checkstyle config must describe all used rules. So when new version release with new rules, config must be manually updated to add new rules (otherwise they would not be used). @@ -36,6 +43,8 @@ Tool config options with defaults: quality { checkstyleVersion = '{{ gradle.checkstyle }}' checkstyle = true // false to disable automatic plugin activation + // true for java 8-10 by default, set to false to disable fallback to backport + checkstyleBackport = !JavaVersion.current().java11Compatible } ``` diff --git a/src/doc/docs/tool/codenarc.md b/src/doc/docs/tool/codenarc.md index 2077b4d..7a2b1a6 100644 --- a/src/doc/docs/tool/codenarc.md +++ b/src/doc/docs/tool/codenarc.md @@ -8,6 +8,12 @@ By default, plugin activates if groovy sources available (`src/main/groovy`). +!!! warning + Since codenarc 3.1 there is a separate jar for groovy4 (codenarc-groovy4) and + plugin use it by default. If you need to use lower codenarc version set + `quality.codenarcGroovy4 = false` in order to switch to usual codenarc jar (groovy 3 based). + Note that it does not relate to your project's groovy version - codenarc will use its own + groovy version. ## Output @@ -33,6 +39,8 @@ Tool config options with defaults: quality { codenarcVersion = '{{ gradle.codenarc }}' codenarc = true // false to disable automatic plugin activation + // use groovy4-based codenarc version; set to false to use groovy3-based version + codenarcGroovy4 = true } ```