Repository: cqfn/diKTat
Pull request #741 (2021-02-02 09:37:17)

Update versions in pom.xml and documentation after 0.4.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/741?src=pr&el=h1) Report
> Merging [#741](https://codecov.io/gh/cqfn/diKTat/pull/741?src=pr&el=desc) (3a1698d) into [master](https://codecov.io/gh/cqfn/diKTat/commit/ed935c58c72da42e7274af87be2b576b2ff881be?el=desc) (ed935c5) will **not change** coverage.
> The diff coverage is `n/a`.

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

```diff
@@            Coverage Diff            @@
##             master     #741   +/-   ##
=========================================
  Coverage     79.94%   79.94%           
  Complexity     1971     1971           
=========================================
  Files            94       94           
  Lines          5075     5075           
  Branches       1627     1627           
=========================================
  Hits           4057     4057           
  Misses          241      241           
  Partials        777      777           
```

| Flag | Coverage Δ | Complexity Δ | |
|---|---|---|---|
| unittests | `79.94% <ø> (ø)` | `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/741?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/741?src=pr&el=footer). Last update [ed935c5...3a1698d](https://codecov.io/gh/cqfn/diKTat/pull/741?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 a307c25d..8ee180a6 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.3.0/diktat.jar)
+2. Load diKTat manually: [here](https://github.com/cqfn/diKTat/releases/download/v0.4.0/diktat.jar)
 
    **OR** use curl:
    ```bash
-   $ curl -sSLO https://github.com/cqfn/diKTat/releases/download/v0.3.0/diktat-0.3.0.jar
+   $ curl -sSLO https://github.com/cqfn/diKTat/releases/download/v0.4.0/diktat-0.4.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.3.0"
+    id("org.cqfn.diktat.diktat-gradle-plugin") version "0.4.0"
 }
 ```
 
@@ -121,7 +121,7 @@ buildscript {
         mavenCentral()
     }
     dependencies {
-        classpath("org.cqfn.diktat:diktat-gradle-plugin:0.3.0")
+        classpath("org.cqfn.diktat:diktat-gradle-plugin:0.4.0")
     }
 }
 
diff --git a/diktat-common/pom.xml b/diktat-common/pom.xml
index 1638bf6a..f17f979e 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/diktat-gradle-plugin/build.gradle.kts b/diktat-gradle-plugin/build.gradle.kts
index fa1dc954..467346eb 100644
--- a/diktat-gradle-plugin/build.gradle.kts
+++ b/diktat-gradle-plugin/build.gradle.kts
@@ -20,7 +20,7 @@ repositories {
 
 // default value is needed for correct gradle loading in IDEA; actual value from maven is used during build
 val ktlintVersion = project.properties.getOrDefault("ktlintVersion", "0.39.0") as String
-val diktatVersion = project.version.takeIf { it.toString() != Project.DEFAULT_VERSION } ?: "0.3.0"
+val diktatVersion = project.version.takeIf { it.toString() != Project.DEFAULT_VERSION } ?: "0.4.0"
 val junitVersion = project.properties.getOrDefault("junitVersion", "5.7.0") as String
 val jacocoVersion = project.properties.getOrDefault("jacocoVersion", "0.8.6") as String
 dependencies {
@@ -53,7 +53,7 @@ val generateVersionsFile by tasks.registering {
         )
     }
 }
-sourceSets.main.get().java.srcDir("$buildDir/generated/src")
+kotlin.sourceSets["main"].kotlin.srcDir("$buildDir/generated/src")
 
 tasks.withType<KotlinCompile> {
     kotlinOptions {
diff --git a/diktat-gradle-plugin/gradle-plugin-marker/pom.xml b/diktat-gradle-plugin/gradle-plugin-marker/pom.xml
index 58f011ad..15d3e323 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/diktat-gradle-plugin/pom.xml b/diktat-gradle-plugin/pom.xml
index e31b8792..d49c4baf 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/diktat-maven-plugin/pom.xml b/diktat-maven-plugin/pom.xml
index ba90da0a..e9793787 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
     <modelVersion>4.0.0</modelVersion>
 
diff --git a/diktat-rules/pom.xml b/diktat-rules/pom.xml
index 280f6d6c..92df63b1 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
 
     <properties>
diff --git a/diktat-ruleset/pom.xml b/diktat-ruleset/pom.xml
index 221b034e..8371dab3 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
 
     <dependencies>
diff --git a/examples/gradle-groovy-dsl/build.gradle b/examples/gradle-groovy-dsl/build.gradle
index 87131749..21aac07a 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.3.0"
+    id "org.cqfn.diktat.diktat-gradle-plugin" version "0.4.0"
 }
 
 repositories {
diff --git a/examples/gradle-groovy-dsl/diktat-analysis.yml b/examples/gradle-groovy-dsl/diktat-analysis.yml
index e3fcb8b4..e950b054 100644
--- a/examples/gradle-groovy-dsl/diktat-analysis.yml
+++ b/examples/gradle-groovy-dsl/diktat-analysis.yml
@@ -4,6 +4,8 @@
     # put your package name here - it will be autofixed and checked
     domainName: your.name.here
     testDirs: test
+    disabledChapters: ""
+    kotlinVersion: "1.4.21"
 # Checks that the Class/Enum/Interface name does not match Pascal case
 - name: CLASS_NAME_INCORRECT
   enabled: true
@@ -114,6 +116,8 @@
 # Checks that kdoc does not contain @author tag or date
 - name: KDOC_CONTAINS_DATE_OR_AUTHOR
   enabled: true
+  configuration:
+    versionRegex: \d+\.\d+\.\d+[-.\w\d]*
 # Checks that KDoc does not contain single line with words 'return', 'get' or 'set'
 - name: KDOC_TRIVIAL_KDOC_ON_FUNCTION
   enabled: true
@@ -127,7 +131,7 @@
 - name: HEADER_MISSING_OR_WRONG_COPYRIGHT
   enabled: true
   configuration:
-    isCopyrightMandatory: true
+    isCopyrightMandatory: false
     copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
 # Checks that header kdoc is located before package directive
 - name: HEADER_NOT_BEFORE_PACKAGE
@@ -163,6 +167,11 @@
   configuration:
     allowedWildcards: "" # Allowed wildcards for imports (e.g. "import org.cqfn.diktat.*, import org.jetbrains.kotlin.*")
     useRecommendedImportsOrder: true
+# Checks unused imports
+- name: UNUSED_IMPORT
+  enabled: true
+  configuration:
+    deleteUnusedImport: true
 # Checks that braces are used in if, else, when, for, do, and while statements. Exception: single line if statement
 - name: NO_BRACES_IN_CONDITIONALS_AND_LOOPS
   enabled: true
@@ -227,6 +236,9 @@
     maxSpaces: '1'
     # Whether formatting for enums should be kept without checking
     saveInitialFormattingForEnums: false
+# Inspection that checks if a long dot qualified expression is used in condition or as an argument
+- name: COMPLEX_EXPRESSION
+  enabled: true
 # Checks that blank lines are used correctly.
 # For example: triggers when there are too many blank lines between function declaration
 - name: TOO_MANY_BLANK_LINES
@@ -345,9 +357,20 @@
 # Checks that function use default values, instead overloading
 - name: WRONG_OVERLOADING_FUNCTION_ARGUMENTS
   enabled: true
+# Checks that using runBlocking inside async block code
+- name: RUN_BLOCKING_INSIDE_ASYNC
+  enabled: true
 # Checks that property in constructor doesn't contain comment
 - name: KDOC_NO_CONSTRUCTOR_PROPERTY
   enabled: true
+# Checks that the long lambda has parameters
+- name: TOO_MANY_LINES_IN_LAMBDA
+  enabled: true
+  configuration:
+    maxLambdaLength: 10 # max length of lambda without parameters
+# Checks that using unnecessary, custom label
+- name: CUSTOM_LABEL
+  enabled: true
 # Checks that property in KDoc present in class
 - name: KDOC_EXTRA_PROPERTY
   enabled: true
@@ -408,4 +431,13 @@
   enabled: true
 # If there is stateless class it is preferred to use object
 - name: OBJECT_IS_PREFERRED
+  enabled: true
+# If there exists negated version of function you should prefer it instead of !functionCall
+- name: INVERSE_FUNCTION_PREFERRED
+  enabled: true
+# Checks if class can be converted to inline class
+- name: INLINE_CLASS_CAN_BE_USED
+  enabled: true
+# If file contains class, then it can't contain extension functions for the same class
+- name: EXTENSION_FUNCTION_WITH_CLASS
   enabled: true
\ No newline at end of file
diff --git a/examples/gradle-kotlin-dsl/build.gradle.kts b/examples/gradle-kotlin-dsl/build.gradle.kts
index fbbdfaed..cc06a19b 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.3.0"
+    id("org.cqfn.diktat.diktat-gradle-plugin") version "0.4.0"
 }
 
 repositories {
diff --git a/examples/gradle-kotlin-dsl/diktat-analysis.yml b/examples/gradle-kotlin-dsl/diktat-analysis.yml
index e3fcb8b4..e950b054 100644
--- a/examples/gradle-kotlin-dsl/diktat-analysis.yml
+++ b/examples/gradle-kotlin-dsl/diktat-analysis.yml
@@ -4,6 +4,8 @@
     # put your package name here - it will be autofixed and checked
     domainName: your.name.here
     testDirs: test
+    disabledChapters: ""
+    kotlinVersion: "1.4.21"
 # Checks that the Class/Enum/Interface name does not match Pascal case
 - name: CLASS_NAME_INCORRECT
   enabled: true
@@ -114,6 +116,8 @@
 # Checks that kdoc does not contain @author tag or date
 - name: KDOC_CONTAINS_DATE_OR_AUTHOR
   enabled: true
+  configuration:
+    versionRegex: \d+\.\d+\.\d+[-.\w\d]*
 # Checks that KDoc does not contain single line with words 'return', 'get' or 'set'
 - name: KDOC_TRIVIAL_KDOC_ON_FUNCTION
   enabled: true
@@ -127,7 +131,7 @@
 - name: HEADER_MISSING_OR_WRONG_COPYRIGHT
   enabled: true
   configuration:
-    isCopyrightMandatory: true
+    isCopyrightMandatory: false
     copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
 # Checks that header kdoc is located before package directive
 - name: HEADER_NOT_BEFORE_PACKAGE
@@ -163,6 +167,11 @@
   configuration:
     allowedWildcards: "" # Allowed wildcards for imports (e.g. "import org.cqfn.diktat.*, import org.jetbrains.kotlin.*")
     useRecommendedImportsOrder: true
+# Checks unused imports
+- name: UNUSED_IMPORT
+  enabled: true
+  configuration:
+    deleteUnusedImport: true
 # Checks that braces are used in if, else, when, for, do, and while statements. Exception: single line if statement
 - name: NO_BRACES_IN_CONDITIONALS_AND_LOOPS
   enabled: true
@@ -227,6 +236,9 @@
     maxSpaces: '1'
     # Whether formatting for enums should be kept without checking
     saveInitialFormattingForEnums: false
+# Inspection that checks if a long dot qualified expression is used in condition or as an argument
+- name: COMPLEX_EXPRESSION
+  enabled: true
 # Checks that blank lines are used correctly.
 # For example: triggers when there are too many blank lines between function declaration
 - name: TOO_MANY_BLANK_LINES
@@ -345,9 +357,20 @@
 # Checks that function use default values, instead overloading
 - name: WRONG_OVERLOADING_FUNCTION_ARGUMENTS
   enabled: true
+# Checks that using runBlocking inside async block code
+- name: RUN_BLOCKING_INSIDE_ASYNC
+  enabled: true
 # Checks that property in constructor doesn't contain comment
 - name: KDOC_NO_CONSTRUCTOR_PROPERTY
   enabled: true
+# Checks that the long lambda has parameters
+- name: TOO_MANY_LINES_IN_LAMBDA
+  enabled: true
+  configuration:
+    maxLambdaLength: 10 # max length of lambda without parameters
+# Checks that using unnecessary, custom label
+- name: CUSTOM_LABEL
+  enabled: true
 # Checks that property in KDoc present in class
 - name: KDOC_EXTRA_PROPERTY
   enabled: true
@@ -408,4 +431,13 @@
   enabled: true
 # If there is stateless class it is preferred to use object
 - name: OBJECT_IS_PREFERRED
+  enabled: true
+# If there exists negated version of function you should prefer it instead of !functionCall
+- name: INVERSE_FUNCTION_PREFERRED
+  enabled: true
+# Checks if class can be converted to inline class
+- name: INLINE_CLASS_CAN_BE_USED
+  enabled: true
+# If file contains class, then it can't contain extension functions for the same class
+- name: EXTENSION_FUNCTION_WITH_CLASS
   enabled: true
\ No newline at end of file
diff --git a/examples/maven/diktat-analysis.yml b/examples/maven/diktat-analysis.yml
index e3fcb8b4..e950b054 100644
--- a/examples/maven/diktat-analysis.yml
+++ b/examples/maven/diktat-analysis.yml
@@ -4,6 +4,8 @@
     # put your package name here - it will be autofixed and checked
     domainName: your.name.here
     testDirs: test
+    disabledChapters: ""
+    kotlinVersion: "1.4.21"
 # Checks that the Class/Enum/Interface name does not match Pascal case
 - name: CLASS_NAME_INCORRECT
   enabled: true
@@ -114,6 +116,8 @@
 # Checks that kdoc does not contain @author tag or date
 - name: KDOC_CONTAINS_DATE_OR_AUTHOR
   enabled: true
+  configuration:
+    versionRegex: \d+\.\d+\.\d+[-.\w\d]*
 # Checks that KDoc does not contain single line with words 'return', 'get' or 'set'
 - name: KDOC_TRIVIAL_KDOC_ON_FUNCTION
   enabled: true
@@ -127,7 +131,7 @@
 - name: HEADER_MISSING_OR_WRONG_COPYRIGHT
   enabled: true
   configuration:
-    isCopyrightMandatory: true
+    isCopyrightMandatory: false
     copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021'
 # Checks that header kdoc is located before package directive
 - name: HEADER_NOT_BEFORE_PACKAGE
@@ -163,6 +167,11 @@
   configuration:
     allowedWildcards: "" # Allowed wildcards for imports (e.g. "import org.cqfn.diktat.*, import org.jetbrains.kotlin.*")
     useRecommendedImportsOrder: true
+# Checks unused imports
+- name: UNUSED_IMPORT
+  enabled: true
+  configuration:
+    deleteUnusedImport: true
 # Checks that braces are used in if, else, when, for, do, and while statements. Exception: single line if statement
 - name: NO_BRACES_IN_CONDITIONALS_AND_LOOPS
   enabled: true
@@ -227,6 +236,9 @@
     maxSpaces: '1'
     # Whether formatting for enums should be kept without checking
     saveInitialFormattingForEnums: false
+# Inspection that checks if a long dot qualified expression is used in condition or as an argument
+- name: COMPLEX_EXPRESSION
+  enabled: true
 # Checks that blank lines are used correctly.
 # For example: triggers when there are too many blank lines between function declaration
 - name: TOO_MANY_BLANK_LINES
@@ -345,9 +357,20 @@
 # Checks that function use default values, instead overloading
 - name: WRONG_OVERLOADING_FUNCTION_ARGUMENTS
   enabled: true
+# Checks that using runBlocking inside async block code
+- name: RUN_BLOCKING_INSIDE_ASYNC
+  enabled: true
 # Checks that property in constructor doesn't contain comment
 - name: KDOC_NO_CONSTRUCTOR_PROPERTY
   enabled: true
+# Checks that the long lambda has parameters
+- name: TOO_MANY_LINES_IN_LAMBDA
+  enabled: true
+  configuration:
+    maxLambdaLength: 10 # max length of lambda without parameters
+# Checks that using unnecessary, custom label
+- name: CUSTOM_LABEL
+  enabled: true
 # Checks that property in KDoc present in class
 - name: KDOC_EXTRA_PROPERTY
   enabled: true
@@ -408,4 +431,13 @@
   enabled: true
 # If there is stateless class it is preferred to use object
 - name: OBJECT_IS_PREFERRED
+  enabled: true
+# If there exists negated version of function you should prefer it instead of !functionCall
+- name: INVERSE_FUNCTION_PREFERRED
+  enabled: true
+# Checks if class can be converted to inline class
+- name: INLINE_CLASS_CAN_BE_USED
+  enabled: true
+# If file contains class, then it can't contain extension functions for the same class
+- name: EXTENSION_FUNCTION_WITH_CLASS
   enabled: true
\ No newline at end of file
diff --git a/examples/maven/pom.xml b/examples/maven/pom.xml
index 20a27796..0d11061f 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.3.0</diktat.version>
+        <diktat.version>0.4.0</diktat.version>
     </properties>
 
     <build>
diff --git a/info/buildSrc/gradle.properties b/info/buildSrc/gradle.properties
index f9343f17..1fc89377 100644
--- a/info/buildSrc/gradle.properties
+++ b/info/buildSrc/gradle.properties
@@ -1,1 +1,1 @@
-version=0.3.1-SNAPSHOT
\ No newline at end of file
+version=0.4.1-SNAPSHOT
diff --git a/pom.xml b/pom.xml
index d2f7ffb4..1272e4ee 100644
--- a/pom.xml
+++ b/pom.xml
@@ -5,7 +5,7 @@
 
     <groupId>org.cqfn.diktat</groupId>
     <artifactId>diktat-parent</artifactId>
-    <version>0.3.1-SNAPSHOT</version>
+    <version>0.4.1-SNAPSHOT</version>
     <packaging>pom</packaging>
 
     <name>diktat</name>
@@ -50,7 +50,7 @@
         <guava.version>30.0-jre</guava.version>
         <slf4j.version>1.7.30</slf4j.version>
         <commons-cli.version>1.4</commons-cli.version>
-        <diktat-check.version>0.3.0</diktat-check.version>
+        <diktat-check.version>0.4.0</diktat-check.version>
         <kotlinpoet.version>1.7.1</kotlinpoet.version>
         <detekt.version>1.15.0</detekt.version>
         <dokka.version>1.4.20</dokka.version>


Test patch:
diff --git a/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt b/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt
index cb9125b0..05d20ee9 100644
--- a/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt
+++ b/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginFunctionalTest.kt
@@ -36,7 +36,7 @@ class DiktatGradlePluginFunctionalTest {
         requireNotNull(diktatCheckBuildResult)
         Assertions.assertEquals(TaskOutcome.FAILED, diktatCheckBuildResult.outcome)
         Assertions.assertTrue(
-            result.output.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            result.output.contains("[FILE_NAME_MATCH_CLASS]")
         )
     }
 
@@ -58,7 +58,7 @@ class DiktatGradlePluginFunctionalTest {
         Assertions.assertEquals(TaskOutcome.FAILED, diktatCheckBuildResult.outcome)
         val file = assertNotNull(testProjectDir.root.walkTopDown().filter { it.name == "test.txt" }.first())
         Assertions.assertTrue(
-                file.readLines().any { it.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]") }
+                file.readLines().any { it.contains("[FILE_NAME_MATCH_CLASS]") }
         )
     }
 
@@ -77,7 +77,7 @@ class DiktatGradlePluginFunctionalTest {
         requireNotNull(diktatCheckBuildResult)
         Assertions.assertEquals(TaskOutcome.FAILED, diktatCheckBuildResult.outcome)
         Assertions.assertTrue(
-            result.output.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            result.output.contains("[FILE_NAME_MATCH_CLASS]")
         )
     }
 
@@ -162,7 +162,7 @@ class DiktatGradlePluginFunctionalTest {
         requireNotNull(diktatCheckBuildResult)
         Assertions.assertEquals(TaskOutcome.FAILED, diktatCheckBuildResult.outcome)
         Assertions.assertTrue(
-            result.output.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            result.output.contains("[FILE_NAME_MATCH_CLASS]")
         )
     }
 
@@ -176,7 +176,7 @@ class DiktatGradlePluginFunctionalTest {
         requireNotNull(diktatCheckBuildResult)
         Assertions.assertEquals(TaskOutcome.FAILED, diktatCheckBuildResult.outcome)
         Assertions.assertTrue(
-            result.output.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            result.output.contains("[FILE_NAME_MATCH_CLASS]")
         )
     }
 
@@ -195,7 +195,7 @@ class DiktatGradlePluginFunctionalTest {
         requireNotNull(diktatCheckBuildResult)
         Assertions.assertEquals(TaskOutcome.SUCCESS, diktatCheckBuildResult.outcome)
         Assertions.assertTrue(
-            result.output.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            result.output.contains("[FILE_NAME_MATCH_CLASS]")
         )
     }
 }
diff --git a/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginGroovyFunctionalTest.kt b/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginGroovyFunctionalTest.kt
index 2d23556f..27200776 100644
--- a/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginGroovyFunctionalTest.kt
+++ b/diktat-gradle-plugin/src/functionalTest/kotlin/org/cqfn/diktat/plugin/gradle/DiktatGradlePluginGroovyFunctionalTest.kt
@@ -34,7 +34,7 @@ class DiktatGradlePluginGroovyFunctionalTest {
         requireNotNull(diktatCheckBuildResult)
         Assertions.assertEquals(TaskOutcome.FAILED, diktatCheckBuildResult.outcome)
         Assertions.assertTrue(
-            result.output.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            result.output.contains("[FILE_NAME_MATCH_CLASS]")
         )
     }
 }
diff --git a/diktat-maven-plugin/src/test/kotlin/org/cqfn/diktat/plugin/maven/DiktatMavenPluginIntegrationTest.kt b/diktat-maven-plugin/src/test/kotlin/org/cqfn/diktat/plugin/maven/DiktatMavenPluginIntegrationTest.kt
index e0d04e0b..19cad487 100644
--- a/diktat-maven-plugin/src/test/kotlin/org/cqfn/diktat/plugin/maven/DiktatMavenPluginIntegrationTest.kt
+++ b/diktat-maven-plugin/src/test/kotlin/org/cqfn/diktat/plugin/maven/DiktatMavenPluginIntegrationTest.kt
@@ -31,7 +31,7 @@ class DiktatMavenPluginIntegrationTest {
 
         val mavenLog = result.mavenLog.stdout.readText()
         Assertions.assertTrue(
-            mavenLog.contains("[HEADER_MISSING_OR_WRONG_COPYRIGHT]")
+            mavenLog.contains("[FILE_NAME_MATCH_CLASS]")
         )
 
         File(result.mavenProjectResult.baseDir, "target/jacoco-it.exec").copyTo(
diff --git a/diktat-test-framework/pom.xml b/diktat-test-framework/pom.xml
index 99b8aba2..db08a168 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.3.1-SNAPSHOT</version>
+        <version>0.4.1-SNAPSHOT</version>
     </parent>
 
     <dependencies>