saveourtool / diktat

Strict coding standard for Kotlin and a custom set of rules for detecting code smells, code style issues and bugs
https://diktat.saveourtool.com
MIT License
540 stars 39 forks source link

Config file is not found by the diktat #467

Closed orchestr7 closed 4 years ago

orchestr7 commented 4 years ago

As @Animeshz mentioned - diktat-analysis.yml is not found on the root by the diktat with a gradle plugin

Animeshz commented 4 years ago

diktat-analysis.yml when placed under root of project is not being read, while when config.yml is placed in same directory it is being read. More over diktat-analysis.yml when put inside the src/main/resources folder it is being read.

Edit: The file with name config.yml and when the file which put into resources were just ignored

The following is a simple config for reproducing:

 - name: DIKTAT_COMMON
  configuration:
    domainName: com.github.animeshz.observable_collections
    testDirs: test

Reproducible build.gradle.kts:

object Versions {
    // ...
    const val ktlint = "0.39.0"
    const val diktat = "0.1.2"
}
// ...
val ktlint: Configuration by configurations.creating
tasks.create<JavaExec>("diktatCheck") {
    group = "diktat"
    inputs.files(project.fileTree(mapOf("dir" to "src", "include" to "**/*.kt")))
    outputs.dir("${project.buildDir}/reports/diktat/")
    description = "Check Kotlin code style."
    classpath = ktlint
    main = "com.pinterest.ktlint.Main"
    args = listOf("src/*/kotlin/**/*.kt")
    outputs.upToDateWhen { false }
    isIgnoreExitValue = true
    dependencies {
        ktlint("com.pinterest:ktlint:${Versions.ktlint}") {
            exclude("com.pinterest.ktlint", "ktlint-ruleset-standard")
        }
        ktlint("org.cqfn.diktat:diktat-rules:${Versions.diktat}")
    }
}

Here's the exception message with all the outputs offered in the console:

5:21:11 PM: Executing task 'diktatCheck'...

Starting Gradle Daemon...
Gradle Daemon started in 3 s 255 ms

> Task :diktatCheck
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.loadRulesets(Main.kt:550)
    at com.pinterest.ktlint.KtlintCommandLine.run(Main.kt:222)
    at com.pinterest.ktlint.Main.main(Main.kt:62)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:23 Cannot read config file diktat-analysis.yml due to: 
com.fasterxml.jackson.module.kotlin.MissingKotlinParameterException: Instantiation of [simple type, class org.cqfn.diktat.common.config.rules.RulesConfig] value failed for JSON property configuration due to missing (therefore NULL) value for creator parameter configuration which is a non-nullable type
 at [Source: (BufferedReader); line: 2, column: 3] (through reference chain: java.util.ArrayList[0]->org.cqfn.diktat.common.config.rules.RulesConfig["configuration"])
    at com.fasterxml.jackson.module.kotlin.KotlinValueInstantiator.createFromObjectWith(KotlinValueInstantiator.kt:112)
    at com.fasterxml.jackson.databind.deser.impl.PropertyBasedCreator.build(PropertyBasedCreator.java:202)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer._deserializeUsingPropertyBased(BeanDeserializer.java:490)
    at com.fasterxml.jackson.databind.deser.BeanDeserializerBase.deserializeFromObjectUsingNonDefault(BeanDeserializerBase.java:1322)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserializeFromObject(BeanDeserializer.java:331)
    at com.fasterxml.jackson.databind.deser.BeanDeserializer.deserialize(BeanDeserializer.java:164)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:290)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:249)
    at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:26)
    at com.fasterxml.jackson.databind.ObjectMapper._readMapAndClose(ObjectMapper.java:4526)
    at com.fasterxml.jackson.databind.ObjectMapper.readValue(ObjectMapper.java:3489)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:140)
    at org.cqfn.diktat.common.config.rules.RulesConfigReader.parseResource(RulesConfigReader.kt:49)
    at org.cqfn.diktat.common.config.reader.JsonResourceConfigReader.readResource(JsonResourceConfigReader.kt:34)
    at org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider.get(DiktatRuleSetProvider.kt:29)
    at com.pinterest.ktlint.KtlintCommandLine.process(Main.kt:361)
    at com.pinterest.ktlint.KtlintCommandLine.access$process(Main.kt:116)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:257)
    at com.pinterest.ktlint.KtlintCommandLine$lintFiles$2$1.call(Main.kt:116)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    at java.base/java.lang.Thread.run(Thread.java:834)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc after IMPORT_LIST
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type BLOCK_COMMENT before PACKAGE_DIRECTIVE
[WARN ] 2020-10-31 17:21:24 Not able to find a node with type KDoc before PACKAGE_DIRECTIVE
[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)

// Millions of this outputs (I've cut them)
// ...

[ERROR] 2020-10-31 17:21:24 Not able to find an external configuration for domain name in the common configuration (is it missing in yml config?)
D:\Projects\KotlinProjects\observable-collections-kt\src\main\kotlin\com\github\animeshz\observable_collections\ObservableList.kt:1:9: [PACKAGE_NAME_INCORRECT_PREFIX] package name should start from company's domain: 

// Lint outputs

D:\Projects\KotlinProjects\observable-collections-kt\src\test\kotlin\com\github\animeshz\observable_collections\ObservableListTest.kt:94:77: [WRONG_NEWLINES] incorrect line breaking: should follow functional style at .

BUILD SUCCESSFUL in 12s
1 actionable task: 1 executed
5:21:25 PM: Task execution finished 'diktatCheck'.
orchestr7 commented 4 years ago

@Animeshz it was reproduced with

 - name: DIKTAT_COMMON
  configuration:
    domainName: com.github.animeshz.observable_collections
    testDirs: test

the problem is here with level of identing, it should be:

- name: DIKTAT_COMMON
  configuration:
    domainName: com.github.animeshz.observable_collections
    testDirs: test

after doing that - you will be able to add your diktat-analysis.yml to the root folder and everything will work

Animeshz commented 4 years ago

I don't think so, it causes the following exception:

Yeah, that was just a typo in the yaml file, thanks for the attention and solving the issue. We can close the issue as it has been resolved :)

orchestr7 commented 4 years ago

@Animeshz thank you, I guess it's time to have a gradle plugin. If you will have some time one day - welcome to contribute :)