From 9c6d587c289799ebbbcf9caf5a42689d2e4e3d6e Mon Sep 17 00:00:00 2001 From: Antonio Bertucci Date: Tue, 21 May 2019 00:09:25 +0200 Subject: [PATCH 1/9] Update README.md --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index fa05371..5d64386 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ # Gradle static analysis plugin -[![](https://ci.novoda.com/buildStatus/icon?job=gradle-static-analysis-plugin)](https://ci.novoda.com/job/gradle-static-analysis-plugin/lastSuccessfulBuild) [![](https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg)](LICENSE.txt) [![Bintray](https://api.bintray.com/packages/novoda/maven/gradle-static-analysis-plugin/images/download.svg)](https://bintray.com/novoda-oss/maven/gradle-static-analysis-plugin/_latestVersion) +[![](https://ci.novoda.com/buildStatus/icon?job=gradle-static-analysis-plugin)](https://ci.novoda.com/job/gradle-static-analysis-plugin/lastSuccessfulBuild) [![](https://img.shields.io/badge/License-Apache%202.0-lightgrey.svg)](LICENSE.txt) [![Bintray](https://api.bintray.com/packages/novoda-oss/maven/gradle-static-analysis-plugin/images/download.svg)](https://bintray.com/novoda-oss/maven/gradle-static-analysis-plugin/_latestVersion) A Gradle plugin to easily apply the same setup of static analysis tools across different Android, Java or Kotlin projects. @@ -32,7 +32,7 @@ Please note that the tools availability depends on the project the plugin is app ### Tools in-consideration * `Spotbugs` [#142](https://github.com/novoda/gradle-static-analysis-plugin/issues/142) - * `CPD (Duplicate Code Detection) ` [#150](https://github.com/novoda/gradle-static-analysis-plugin/iss (Duplicate Code Detection) ues/150) + * `CPD (Duplicate Code Detection) ` [#150](https://github.com/novoda/gradle-static-analysis-plugin/issues/150) * `error-prone` [#151](https://github.com/novoda/gradle-static-analysis-plugin/issues/151) * `Jetbrains IDEA Inspections` [#152](https://github.com/novoda/gradle-static-analysis-plugin/issues/152) @@ -107,9 +107,8 @@ repositories { You can find the latest snapshot version following this [link](https://bintray.com/novoda-oss/snapshots/gradle-static-analysis-plugin/_latestVersion). ## Roadmap -The plugin is under active development and to be considered in **beta stage**. It is routinely used by many Novoda projects and -by other external projects with no known critical issues. The API is supposed to be relatively stable, but there still may be -breaking changes as we move towards version 1.0. +The plugin is under active development. It is routinely used by many Novoda projects and +by other external projects with no known critical issues. Future improvements can be found on the repository's [issue tracker](https://github.com/novoda/gradle-static-analysis-plugin/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement). From 77e92a153fb48a4bb0e5ab6082a9a0014dad96fd Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Thu, 23 May 2019 00:26:13 +0200 Subject: [PATCH 2/9] Update README.md --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5d64386..6a2c85a 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.novoda:gradle-static-analysis-plugin:0.8' + classpath 'com.novoda:gradle-static-analysis-plugin:1.0' } } @@ -63,7 +63,7 @@ or from the [Gradle Plugins Repository](https://plugins.gradle.org/): ```gradle plugins { - id 'com.novoda.static-analysis' version '0.8' + id 'com.novoda.static-analysis' version '1.0' } ``` From df238b8da5ab0791723a4c027ef64f9ae6684161 Mon Sep 17 00:00:00 2001 From: lgvalle Date: Thu, 30 May 2019 12:44:27 +0200 Subject: [PATCH 3/9] Fix sample code --- docs/incubating/custom-evaluator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/incubating/custom-evaluator.md b/docs/incubating/custom-evaluator.md index 98c261c..03eb473 100644 --- a/docs/incubating/custom-evaluator.md +++ b/docs/incubating/custom-evaluator.md @@ -40,7 +40,7 @@ can be provided as a closure as well: ```gradle staticAnalysis { - evaluator { Set allViolations -> + evaluator { Set allViolations -> // add your evaluation logic here } //... From 190199d6e49d33e2d4b7c857812dac07e70db82b Mon Sep 17 00:00:00 2001 From: lgvalle Date: Thu, 30 May 2019 12:44:41 +0200 Subject: [PATCH 4/9] Fix link to sourcecode --- docs/incubating/custom-evaluator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/incubating/custom-evaluator.md b/docs/incubating/custom-evaluator.md index 03eb473..e1e9bf1 100644 --- a/docs/incubating/custom-evaluator.md +++ b/docs/incubating/custom-evaluator.md @@ -67,4 +67,4 @@ evaluator run its logic and then delegate the thresholds counting to an instance [violationsevaluatorcode]: https://github.com/novoda/gradle-static-analysis-plugin/blob/master/plugin/src/main/groovy/com/novoda/staticanalysis/ViolationsEvaluator.groovy [defaultviolationsevaluatorcode]: https://github.com/novoda/gradle-static-analysis-plugin/blob/master/plugin/src/main/groovy/com/novoda/staticanalysis/DefaultViolationsEvaluator.groovy -[violationscode]: https://github.com/novoda/gradle-static-analysis-plugin/blob/master/plugin/src/main/groovy/com/novoda/staticanalysis/internal/Violations.groovy +[violationscode]: https://github.com/novoda/gradle-static-analysis-plugin/blob/master/plugin/src/main/groovy/com/novoda/staticanalysis/Violations.groovy From 3b3d1617e43909c48249b34109779cbe945938e8 Mon Sep 17 00:00:00 2001 From: lgvalle Date: Thu, 30 May 2019 12:44:55 +0200 Subject: [PATCH 5/9] Add extended code sample --- docs/incubating/custom-evaluator.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/incubating/custom-evaluator.md b/docs/incubating/custom-evaluator.md index e1e9bf1..2734375 100644 --- a/docs/incubating/custom-evaluator.md +++ b/docs/incubating/custom-evaluator.md @@ -61,6 +61,25 @@ Anything that respect such contract is valid. For example, a custom evaluator mi * Only break the build if there are errors or warnings in one specific report * Or anything else that you can think of +For example, this custom evaluator fails the build if PMD errors are greater than five: + +```gradle +evaluator { Set allViolations -> + allViolations.each { violation -> + if (violation.name == "PMD" && (violation.errors > 5)) { + throw new GradleException("PMD Violations exceeded \n") + } + } +} +``` +The properties you can read from a [`Violation`][violationscode] result are: + +* `toolName`: Possible values are: `"PMD"`, `"Checkstyle"`, `"Findbugs"`, `"KTlint"`, `"Detekt"` and `"Lint"`. +* `errors`: Represents the number of errors found during the analysis. +* `warnings`: Represents the number of warnings found during the analysis. +* `reports`: Contains a list of the generated report files. + +--- Please note that the presence of an `evaluator` property will make the plugin ignore the `penalty` closure and its thresholds. If you want to provide behaviour on top of the default [`DefaultViolationsEvaluator`][defaultviolationsevaluatorcode], you can have your own evaluator run its logic and then delegate the thresholds counting to an instance of `DefaultViolationsEvaluator` you create. From 1641f345728fa58cd697a3d98320d69c1c5ba166 Mon Sep 17 00:00:00 2001 From: lgvalle Date: Thu, 30 May 2019 15:37:22 +0200 Subject: [PATCH 6/9] Make sample cleaner --- docs/incubating/custom-evaluator.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/incubating/custom-evaluator.md b/docs/incubating/custom-evaluator.md index 2734375..767b9df 100644 --- a/docs/incubating/custom-evaluator.md +++ b/docs/incubating/custom-evaluator.md @@ -66,8 +66,8 @@ For example, this custom evaluator fails the build if PMD errors are greater tha ```gradle evaluator { Set allViolations -> allViolations.each { violation -> - if (violation.name == "PMD" && (violation.errors > 5)) { - throw new GradleException("PMD Violations exceeded \n") + if (violation.name == "PMD" && violation.errors > 5) { + throw new GradleException("PMD Violations exceeded") } } } From d3da57b7a29e7273ba37c120dde085b407778f16 Mon Sep 17 00:00:00 2001 From: lgvalle Date: Thu, 30 May 2019 15:37:35 +0200 Subject: [PATCH 7/9] Replace toolName with just name --- docs/incubating/custom-evaluator.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/incubating/custom-evaluator.md b/docs/incubating/custom-evaluator.md index 767b9df..18bc3af 100644 --- a/docs/incubating/custom-evaluator.md +++ b/docs/incubating/custom-evaluator.md @@ -74,7 +74,7 @@ evaluator { Set allViolations -> ``` The properties you can read from a [`Violation`][violationscode] result are: -* `toolName`: Possible values are: `"PMD"`, `"Checkstyle"`, `"Findbugs"`, `"KTlint"`, `"Detekt"` and `"Lint"`. +* `name`: Possible values are: `"PMD"`, `"Checkstyle"`, `"Findbugs"`, `"KTlint"`, `"Detekt"` and `"Lint"`. * `errors`: Represents the number of errors found during the analysis. * `warnings`: Represents the number of warnings found during the analysis. * `reports`: Contains a list of the generated report files. From c3153c2b5cf521617a24ef8556f6c4b7d47c1be6 Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Tue, 24 Sep 2019 09:40:26 +0200 Subject: [PATCH 8/9] Put info about the evaluateViolations task --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6a2c85a..934ee40 100644 --- a/README.md +++ b/README.md @@ -85,7 +85,7 @@ staticAnalysis { } ``` -This will enable all the tools with their default settings. For more advanced configurations, please refer to the +This will enable all the tools with their default settings and create `evaluateViolations` task. Running `./gradlew evaluateViolations` task will run all configured tools and print the reports to console. For more advanced configurations, please refer to the [advanced usage](docs/advanced-usage.md) and to the [supported tools](docs/supported-tools.md) pages. ## Sample app From 406327e557cfe993e951e4ba3423a93bb20dbeab Mon Sep 17 00:00:00 2001 From: Said Tahsin Dane Date: Mon, 21 Oct 2019 23:09:54 +0200 Subject: [PATCH 9/9] Prepare for version 1.1 --- CHANGELOG.md | 8 ++++++++ README.md | 10 ++++------ gradle/publish.gradle | 2 +- 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b74ffa6..9baf757 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ Change Log ========== +[Version 1.1](https://github.com/novoda/gradle-static-analysis-plugin/releases/tag/v1.1) +-------------------------- + +- Add support for Ktlint Plugin: `9.0.0`. Thanks [Adam McNeilly](https://github.com/AdamMc331) for the contribution [PR#202](https://github.com/novoda/gradle-static-analysis-plugin/pull/202) +- Update project to use Gradle 5.6.3. [PR#203](https://github.com/novoda/gradle-static-analysis-plugin/pull/203) + - Note: Minimum supported Gradle version is still 4.x (tested with 4.3.1) +- Update docs [PR#194](https://github.com/novoda/gradle-static-analysis-plugin/pull/194) + [Version 1.0](https://github.com/novoda/gradle-static-analysis-plugin/releases/tag/v1.0) -------------------------- diff --git a/README.md b/README.md index fa05371..c0bb0f4 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,7 @@ buildscript { jcenter() } dependencies { - classpath 'com.novoda:gradle-static-analysis-plugin:0.8' + classpath 'com.novoda:gradle-static-analysis-plugin:1.1' } } @@ -63,7 +63,7 @@ or from the [Gradle Plugins Repository](https://plugins.gradle.org/): ```gradle plugins { - id 'com.novoda.static-analysis' version '0.8' + id 'com.novoda.static-analysis' version '1.1' } ``` @@ -107,9 +107,7 @@ repositories { You can find the latest snapshot version following this [link](https://bintray.com/novoda-oss/snapshots/gradle-static-analysis-plugin/_latestVersion). ## Roadmap -The plugin is under active development and to be considered in **beta stage**. It is routinely used by many Novoda projects and -by other external projects with no known critical issues. The API is supposed to be relatively stable, but there still may be -breaking changes as we move towards version 1.0. +This project is routinely used by many Novoda projects and by other external projects with no known critical issues. -Future improvements can be found on the repository's +Future improvements and new tool integrations can be found on the repository's [issue tracker](https://github.com/novoda/gradle-static-analysis-plugin/issues?q=is%3Aopen+is%3Aissue+label%3Aenhancement). diff --git a/gradle/publish.gradle b/gradle/publish.gradle index 23356b9..198cbae 100644 --- a/gradle/publish.gradle +++ b/gradle/publish.gradle @@ -2,7 +2,7 @@ ext { websiteUrl = 'https://github.com/novoda/gradle-static-analysis-plugin' } -version = '1.0' +version = '1.1' groovydoc.docTitle = 'Static Analysis Plugin' apply plugin: 'com.novoda.build-properties'