From a820f968a97ae3048dc909f53977ceb7b3ed0220 Mon Sep 17 00:00:00 2001 From: GitHub Date: Thu, 8 Apr 2021 16:54:21 +0000 Subject: [PATCH] Prepare next development iteration after release 0.5.0 --- README.md | 12 ++++----- diktat-common/pom.xml | 2 +- .../gradle-plugin-marker/pom.xml | 2 +- diktat-gradle-plugin/pom.xml | 2 +- diktat-maven-plugin/pom.xml | 2 +- diktat-rules/pom.xml | 2 +- diktat-ruleset/pom.xml | 2 +- diktat-test-framework/pom.xml | 2 +- examples/gradle-groovy-dsl/build.gradle | 2 +- .../gradle-groovy-dsl/diktat-analysis.yml | 27 +++++++++++++++++++ examples/gradle-kotlin-dsl/build.gradle.kts | 2 +- .../gradle-kotlin-dsl/diktat-analysis.yml | 27 +++++++++++++++++++ examples/maven/diktat-analysis.yml | 27 +++++++++++++++++++ examples/maven/pom.xml | 2 +- info/buildSrc/gradle.properties | 2 +- pom.xml | 4 +-- 16 files changed, 100 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 6cdd05fe59..a4a6b645b5 100644 --- a/README.md +++ b/README.md @@ -55,11 +55,11 @@ Main features of diktat are the following: # another option is "brew install ktlint" ``` -2. Load diKTat manually: [here](https://github.com/cqfn/diKTat/releases/download/v0.4.2/diktat.jar) +2. Load diKTat manually: [here](https://github.com/cqfn/diKTat/releases/download/v0.5.0/diktat.jar) **OR** use curl: ```bash - $ curl -sSLO https://github.com/cqfn/diKTat/releases/download/v0.4.2/diktat-0.4.2.jar + $ curl -sSLO https://github.com/cqfn/diKTat/releases/download/v0.5.0/diktat-0.5.0.jar ``` 3. Finally, run KTlint (with diKTat injected) to check your `*.kt` files in `dir/your/dir`: @@ -110,7 +110,7 @@ This plugin is available since version 0.1.5. You can see how the plugin is conf Add this plugin to your `build.gradle.kts`: ```kotlin plugins { - id("org.cqfn.diktat.diktat-gradle-plugin") version "0.4.2" + id("org.cqfn.diktat.diktat-gradle-plugin") version "0.5.0" } ``` @@ -121,7 +121,7 @@ buildscript { mavenCentral() } dependencies { - classpath("org.cqfn.diktat:diktat-gradle-plugin:0.4.2") + classpath("org.cqfn.diktat:diktat-gradle-plugin:0.5.0") } } @@ -194,7 +194,7 @@ spotless { ```kotlin spotless { kotlin { - diktat("0.4.2").configFile("full/path/to/diktat-analysis.yml") + diktat("0.5.0").configFile("full/path/to/diktat-analysis.yml") } } ``` @@ -225,7 +225,7 @@ Diktat can be run via spotless-maven-plugin since version 2.8.0 ```xml - 0.4.2 + 0.5.0 full/path/to/diktat-analysis.yml ``` diff --git a/diktat-common/pom.xml b/diktat-common/pom.xml index 53a0d88bcc..26622cd379 100644 --- a/diktat-common/pom.xml +++ b/diktat-common/pom.xml @@ -9,7 +9,7 @@ org.cqfn.diktat diktat-parent - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT diff --git a/diktat-gradle-plugin/gradle-plugin-marker/pom.xml b/diktat-gradle-plugin/gradle-plugin-marker/pom.xml index b0d110d91d..7c14eb1991 100644 --- a/diktat-gradle-plugin/gradle-plugin-marker/pom.xml +++ b/diktat-gradle-plugin/gradle-plugin-marker/pom.xml @@ -4,7 +4,7 @@ diktat-gradle-plugin org.cqfn.diktat - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT 4.0.0 diff --git a/diktat-gradle-plugin/pom.xml b/diktat-gradle-plugin/pom.xml index 1ea559437c..396d39d174 100644 --- a/diktat-gradle-plugin/pom.xml +++ b/diktat-gradle-plugin/pom.xml @@ -5,7 +5,7 @@ diktat-parent org.cqfn.diktat - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT 4.0.0 diff --git a/diktat-maven-plugin/pom.xml b/diktat-maven-plugin/pom.xml index c82f1c8ab0..999b015a48 100644 --- a/diktat-maven-plugin/pom.xml +++ b/diktat-maven-plugin/pom.xml @@ -5,7 +5,7 @@ diktat-parent org.cqfn.diktat - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT 4.0.0 diff --git a/diktat-rules/pom.xml b/diktat-rules/pom.xml index bb753aa0e7..2fdfe361dd 100644 --- a/diktat-rules/pom.xml +++ b/diktat-rules/pom.xml @@ -9,7 +9,7 @@ org.cqfn.diktat diktat-parent - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT diff --git a/diktat-ruleset/pom.xml b/diktat-ruleset/pom.xml index 9753f6a91d..c9a46c2840 100644 --- a/diktat-ruleset/pom.xml +++ b/diktat-ruleset/pom.xml @@ -8,7 +8,7 @@ org.cqfn.diktat diktat-parent - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT diff --git a/diktat-test-framework/pom.xml b/diktat-test-framework/pom.xml index 51912b50a9..5aba2eadc7 100644 --- a/diktat-test-framework/pom.xml +++ b/diktat-test-framework/pom.xml @@ -9,7 +9,7 @@ org.cqfn.diktat diktat-parent - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT diff --git a/examples/gradle-groovy-dsl/build.gradle b/examples/gradle-groovy-dsl/build.gradle index cee0ef24fd..aca5707cef 100644 --- a/examples/gradle-groovy-dsl/build.gradle +++ b/examples/gradle-groovy-dsl/build.gradle @@ -1,5 +1,5 @@ plugins { - id "org.cqfn.diktat.diktat-gradle-plugin" version "0.4.2" + id "org.cqfn.diktat.diktat-gradle-plugin" version "0.5.0" } repositories { diff --git a/examples/gradle-groovy-dsl/diktat-analysis.yml b/examples/gradle-groovy-dsl/diktat-analysis.yml index ad1ed749f5..ea78879e62 100644 --- a/examples/gradle-groovy-dsl/diktat-analysis.yml +++ b/examples/gradle-groovy-dsl/diktat-analysis.yml @@ -293,6 +293,28 @@ maxNumberLength: '5' # Maximum number of digits between separators maxBlockLength: '3' +# Checks magic number +- name: MAGIC_NUMBER + enabled: true + configuration: + # Ignore numbers + ignoreNumbers: "-1, 1, 0, 2" + # Is ignore override hashCode function + ignoreHashCodeFunction: "true" + # Is ignore property + ignorePropertyDeclaration: "false" + # Is ignore local variable + ignoreLocalVariableDeclaration: "false" + # Is ignore constant + ignoreConstantDeclaration: "true" + # Is ignore property in companion object + ignoreCompanionObjectPropertyDeclaration: "true" + # Is ignore numbers in enum + ignoreEnums: "false" + # Is ignore number in ranges + ignoreRanges: "false" + # Is ignore number in extension function + ignoreExtensionFunctions: "false" # Checks that order of enum values or constant property inside companion is correct - name: WRONG_DECLARATIONS_ORDER enabled: true @@ -353,6 +375,11 @@ # Inspection that checks if string template has redundant quotes - name: STRING_TEMPLATE_QUOTES enabled: true +# Check if there are redundant nested if-statements, which could be collapsed into a single one by concatenating their conditions +- name: COLLAPSE_IF_STATEMENTS + enabled: true + configuration: + startCollapseFromNestedLevel: 2 # Checks that floating-point values are not used in arithmetic expressions - name: FLOAT_IN_ACCURATE_CALCULATIONS enabled: true diff --git a/examples/gradle-kotlin-dsl/build.gradle.kts b/examples/gradle-kotlin-dsl/build.gradle.kts index 84145a14c0..2b4b048aa7 100644 --- a/examples/gradle-kotlin-dsl/build.gradle.kts +++ b/examples/gradle-kotlin-dsl/build.gradle.kts @@ -1,5 +1,5 @@ plugins { - id("org.cqfn.diktat.diktat-gradle-plugin") version "0.4.2" + id("org.cqfn.diktat.diktat-gradle-plugin") version "0.5.0" } repositories { diff --git a/examples/gradle-kotlin-dsl/diktat-analysis.yml b/examples/gradle-kotlin-dsl/diktat-analysis.yml index ad1ed749f5..ea78879e62 100644 --- a/examples/gradle-kotlin-dsl/diktat-analysis.yml +++ b/examples/gradle-kotlin-dsl/diktat-analysis.yml @@ -293,6 +293,28 @@ maxNumberLength: '5' # Maximum number of digits between separators maxBlockLength: '3' +# Checks magic number +- name: MAGIC_NUMBER + enabled: true + configuration: + # Ignore numbers + ignoreNumbers: "-1, 1, 0, 2" + # Is ignore override hashCode function + ignoreHashCodeFunction: "true" + # Is ignore property + ignorePropertyDeclaration: "false" + # Is ignore local variable + ignoreLocalVariableDeclaration: "false" + # Is ignore constant + ignoreConstantDeclaration: "true" + # Is ignore property in companion object + ignoreCompanionObjectPropertyDeclaration: "true" + # Is ignore numbers in enum + ignoreEnums: "false" + # Is ignore number in ranges + ignoreRanges: "false" + # Is ignore number in extension function + ignoreExtensionFunctions: "false" # Checks that order of enum values or constant property inside companion is correct - name: WRONG_DECLARATIONS_ORDER enabled: true @@ -353,6 +375,11 @@ # Inspection that checks if string template has redundant quotes - name: STRING_TEMPLATE_QUOTES enabled: true +# Check if there are redundant nested if-statements, which could be collapsed into a single one by concatenating their conditions +- name: COLLAPSE_IF_STATEMENTS + enabled: true + configuration: + startCollapseFromNestedLevel: 2 # Checks that floating-point values are not used in arithmetic expressions - name: FLOAT_IN_ACCURATE_CALCULATIONS enabled: true diff --git a/examples/maven/diktat-analysis.yml b/examples/maven/diktat-analysis.yml index ad1ed749f5..ea78879e62 100644 --- a/examples/maven/diktat-analysis.yml +++ b/examples/maven/diktat-analysis.yml @@ -293,6 +293,28 @@ maxNumberLength: '5' # Maximum number of digits between separators maxBlockLength: '3' +# Checks magic number +- name: MAGIC_NUMBER + enabled: true + configuration: + # Ignore numbers + ignoreNumbers: "-1, 1, 0, 2" + # Is ignore override hashCode function + ignoreHashCodeFunction: "true" + # Is ignore property + ignorePropertyDeclaration: "false" + # Is ignore local variable + ignoreLocalVariableDeclaration: "false" + # Is ignore constant + ignoreConstantDeclaration: "true" + # Is ignore property in companion object + ignoreCompanionObjectPropertyDeclaration: "true" + # Is ignore numbers in enum + ignoreEnums: "false" + # Is ignore number in ranges + ignoreRanges: "false" + # Is ignore number in extension function + ignoreExtensionFunctions: "false" # Checks that order of enum values or constant property inside companion is correct - name: WRONG_DECLARATIONS_ORDER enabled: true @@ -353,6 +375,11 @@ # Inspection that checks if string template has redundant quotes - name: STRING_TEMPLATE_QUOTES enabled: true +# Check if there are redundant nested if-statements, which could be collapsed into a single one by concatenating their conditions +- name: COLLAPSE_IF_STATEMENTS + enabled: true + configuration: + startCollapseFromNestedLevel: 2 # Checks that floating-point values are not used in arithmetic expressions - name: FLOAT_IN_ACCURATE_CALCULATIONS enabled: true diff --git a/examples/maven/pom.xml b/examples/maven/pom.xml index ffaa28dc55..a8a9c6fddc 100644 --- a/examples/maven/pom.xml +++ b/examples/maven/pom.xml @@ -8,7 +8,7 @@ 1.0.0-SNAPSHOT - 0.4.2 + 0.5.0 diff --git a/info/buildSrc/gradle.properties b/info/buildSrc/gradle.properties index 0ef5b9495e..1b124d874e 100644 --- a/info/buildSrc/gradle.properties +++ b/info/buildSrc/gradle.properties @@ -1 +1 @@ -version=0.4.3-SNAPSHOT +version=0.5.1-SNAPSHOT diff --git a/pom.xml b/pom.xml index 6179734f57..79f56b10da 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ org.cqfn.diktat diktat-parent - 0.4.3-SNAPSHOT + 0.5.1-SNAPSHOT pom diktat @@ -50,7 +50,7 @@ 30.1.1-jre 1.7.30 1.4 - 0.4.2 + 0.5.0 1.8.0 1.16.0 1.4.30