Repository: cqfn/diKTat
Pull request #827 (2021-04-08 16:54:25)

Update versions in pom.xml and documentation after 0.5.0 release
* Versions are updated in pom.xml, README.md and in examples
* Current project version is incremented to the next snapshot

codecov[bot]: # [Codecov](https://codecov.io/gh/cqfn/diKTat/pull/827?src=pr&el=h1) Report
> Merging [#827](https://codecov.io/gh/cqfn/diKTat/pull/827?src=pr&el=desc) (a820f96) into [master](https://codecov.io/gh/cqfn/diKTat/commit/a2c7c24df30a92febac85890c4cfe6a3ebc8da95?el=desc) (a2c7c24) will **not change** coverage.
> The diff coverage is `n/a`.

[![Impacted file tree graph](https://codecov.io/gh/cqfn/diKTat/pull/827/graphs/tree.svg?width=650&height=150&src=pr&token=P2quRDffpt)](https://codecov.io/gh/cqfn/diKTat/pull/827?src=pr&el=tree)

```diff
@@            Coverage Diff            @@
##             master     #827   +/-   ##
=========================================
  Coverage     80.91%   80.91%           
  Complexity     2272     2272           
=========================================
  Files           100      100           
  Lines          5801     5801           
  Branches       1798     1798           
=========================================
  Hits           4694     4694           
  Misses          286      286           
  Partials        821      821           
```

| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| unittests | `80.91% <ø> (ø)` | `0.00 <ø> (ø)` | |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags#carryforward-flags-in-the-pull-request-comment) to find out more.


------

[Continue to review full report at Codecov](https://codecov.io/gh/cqfn/diKTat/pull/827?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/cqfn/diKTat/pull/827?src=pr&el=footer). Last update [a2c7c24...a820f96](https://codecov.io/gh/cqfn/diKTat/pull/827?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/README.md b/README.md
index 6cdd05fe..a4a6b645 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
 <diktat>
-  <version>0.4.2</version> <!-- optional -->
+  <version>0.5.0</version> <!-- optional -->
   <configFile>full/path/to/diktat-analysis.yml</configFile> <!-- optional, configuration file path -->
 </diktat>
 ```
diff --git a/diktat-common/pom.xml b/diktat-common/pom.xml
index 53a0d88b..26622cd3 100644
--- a/diktat-common/pom.xml
+++ b/diktat-common/pom.xml
@@ -9,7 +9,7 @@
     <parent>
         <groupId>org.cqfn.diktat</groupId>
         <artifactId>diktat-parent</artifactId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/diktat-gradle-plugin/gradle-plugin-marker/pom.xml b/diktat-gradle-plugin/gradle-plugin-marker/pom.xml
index b0d110d9..7c14eb19 100644
--- a/diktat-gradle-plugin/gradle-plugin-marker/pom.xml
+++ b/diktat-gradle-plugin/gradle-plugin-marker/pom.xml
@@ -4,7 +4,7 @@
     <parent>
         <artifactId>diktat-gradle-plugin</artifactId>
         <groupId>org.cqfn.diktat</groupId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/diktat-gradle-plugin/pom.xml b/diktat-gradle-plugin/pom.xml
index 1ea55943..396d39d1 100644
--- a/diktat-gradle-plugin/pom.xml
+++ b/diktat-gradle-plugin/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>diktat-parent</artifactId>
         <groupId>org.cqfn.diktat</groupId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/diktat-maven-plugin/pom.xml b/diktat-maven-plugin/pom.xml
index c82f1c8a..999b015a 100644
--- a/diktat-maven-plugin/pom.xml
+++ b/diktat-maven-plugin/pom.xml
@@ -5,7 +5,7 @@
     <parent>
         <artifactId>diktat-parent</artifactId>
         <groupId>org.cqfn.diktat</groupId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/diktat-rules/pom.xml b/diktat-rules/pom.xml
index bb753aa0..2fdfe361 100644
--- a/diktat-rules/pom.xml
+++ b/diktat-rules/pom.xml
@@ -9,7 +9,7 @@
     <parent>
         <groupId>org.cqfn.diktat</groupId>
         <artifactId>diktat-parent</artifactId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
 
     <properties>
diff --git a/diktat-ruleset/pom.xml b/diktat-ruleset/pom.xml
index 9753f6a9..c9a46c28 100644
--- a/diktat-ruleset/pom.xml
+++ b/diktat-ruleset/pom.xml
@@ -8,7 +8,7 @@
     <parent>
         <groupId>org.cqfn.diktat</groupId>
         <artifactId>diktat-parent</artifactId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/examples/gradle-groovy-dsl/build.gradle b/examples/gradle-groovy-dsl/build.gradle
index cee0ef24..aca5707c 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 ad1ed749..ea78879e 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 84145a14..2b4b048a 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 ad1ed749..ea78879e 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 ad1ed749..ea78879e 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 ffaa28dc..a8a9c6fd 100644
--- a/examples/maven/pom.xml
+++ b/examples/maven/pom.xml
@@ -8,7 +8,7 @@
     <version>1.0.0-SNAPSHOT</version>
 
     <properties>
-        <diktat.version>0.4.2</diktat.version>
+        <diktat.version>0.5.0</diktat.version>
     </properties>
 
     <build>
diff --git a/info/buildSrc/gradle.properties b/info/buildSrc/gradle.properties
index 0ef5b949..1b124d87 100644
--- a/info/buildSrc/gradle.properties
+++ b/info/buildSrc/gradle.properties
@@ -1,1 +1,1 @@
-version=0.4.3-SNAPSHOT
+version=0.5.1-SNAPSHOT
diff --git a/pom.xml b/pom.xml
index 6179734f..79f56b10 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 
     <groupId>org.cqfn.diktat</groupId>
     <artifactId>diktat-parent</artifactId>
-    <version>0.4.3-SNAPSHOT</version>
+    <version>0.5.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>diktat</name>
@@ -50,7 +50,7 @@
         <guava.version>30.1.1-jre</guava.version>
         <slf4j.version>1.7.30</slf4j.version>
         <commons-cli.version>1.4</commons-cli.version>
-        <diktat-check.version>0.4.2</diktat-check.version>
+        <diktat-check.version>0.5.0</diktat-check.version>
         <kotlinpoet.version>1.8.0</kotlinpoet.version>
         <detekt.version>1.16.0</detekt.version>
         <dokka.version>1.4.30</dokka.version>


Test patch:
diff --git a/diktat-test-framework/pom.xml b/diktat-test-framework/pom.xml
index 51912b50..5aba2ead 100644
--- a/diktat-test-framework/pom.xml
+++ b/diktat-test-framework/pom.xml
@@ -9,7 +9,7 @@
     <parent>
         <groupId>org.cqfn.diktat</groupId>
         <artifactId>diktat-parent</artifactId>
-        <version>0.4.3-SNAPSHOT</version>
+        <version>0.5.1-SNAPSHOT</version>
     </parent>
 
     <dependencies>