Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate diktat smoke tests to SAVE-cli mechanism #1388

Merged
merged 58 commits into from
Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
3c2a4e4
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 21, 2022
d40ac6b
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 22, 2022
96abde1
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jun 22, 2022
660a7d1
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 23, 2022
4e6f391
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 23, 2022
963c456
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 23, 2022
71a9fd4
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 23, 2022
8287e61
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jun 23, 2022
9a27748
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jun 24, 2022
f045ee9
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 28, 2022
81b11b8
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jun 28, 2022
345bbb4
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jun 29, 2022
2e8f33c
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jun 29, 2022
355fd2b
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jun 30, 2022
e29f5d9
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 4, 2022
1764a4b
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 4, 2022
00628f7
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 5, 2022
e3e410e
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 5, 2022
33c5187
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 5, 2022
143d79e
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 5, 2022
5e610f3
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 5, 2022
ac59eca
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 5, 2022
b3456af
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 6, 2022
394d292
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 6, 2022
98dc4a2
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 6, 2022
c9ee5f4
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 7, 2022
7f5184a
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
703a37d
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 11, 2022
9f23ae5
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
289e135
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
abcdb8f
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
fa10731
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
3785fe8
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
f5127c0
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
756aa5e
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 11, 2022
ea5268c
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
80c375c
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
5ae5676
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
c1fb33a
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
d8a4e25
Fixing execution cmd
orchestr7 Jul 11, 2022
5122d82
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
95ba657
Fixing execution cmd
orchestr7 Jul 11, 2022
2464246
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
bb5a101
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 11, 2022
fe8f8eb
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 12, 2022
dd5e6be
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 12, 2022
18e08ff
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 12, 2022
4c8c223
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 12, 2022
3258081
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 12, 2022
ff780e4
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 12, 2022
f1e3878
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 14, 2022
91f3fd8
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 14, 2022
8e51f1e
Merge branch 'master' into feature/migrate_tests_to_save
Cheshiriks Jul 14, 2022
43a4de9
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 14, 2022
b6c3401
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 14, 2022
7fec3f3
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 14, 2022
04dc7ed
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 14, 2022
23ec13e
Migrate diktat smoke tests to SAVE-cli mechanism
Cheshiriks Jul 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,204 @@
package org.cqfn.diktat.ruleset.smoke

import org.cqfn.diktat.common.config.rules.DIKTAT_COMMON
import org.cqfn.diktat.common.config.rules.RulesConfig
import org.cqfn.diktat.common.config.rules.RulesConfigReader
import org.cqfn.diktat.ruleset.constants.Warnings
import org.cqfn.diktat.ruleset.rules.DiktatRuleSetProvider
import org.cqfn.diktat.util.FixTestBase

import com.charleskorn.kaml.Yaml
import com.charleskorn.kaml.YamlConfiguration
import com.pinterest.ktlint.core.LintError
import org.junit.jupiter.api.Tag
import org.junit.jupiter.api.Test

import java.time.LocalDate

import kotlin.io.path.createTempFile
import kotlinx.serialization.builtins.ListSerializer

class DiktatSaveSmokeTest : FixTestBase("test/smoke/src/main/kotlin",
Cheshiriks marked this conversation as resolved.
Show resolved Hide resolved
{ DiktatRuleSetProvider(configFilePath) },
{ lintError, _ -> unfixedLintErrors.add(lintError) },
) {
/**
* Disable some of the rules.
*/
@Suppress("UnsafeCallOnNullableType")
private fun overrideRulesConfig(rulesToDisable: List<Warnings>, rulesToOverride: RuleToConfig = emptyMap()) {
val rulesConfig = RulesConfigReader(javaClass.classLoader).readResource(DEFAULT_CONFIG_PATH)!!
.toMutableList()
.also { rulesConfig ->
rulesToDisable.forEach { warning ->
rulesConfig.removeIf { it.name == warning.name }
rulesConfig.add(RulesConfig(warning.name, enabled = false, configuration = emptyMap()))
}
rulesToOverride.forEach { (warning, configuration) ->
rulesConfig.removeIf { it.name == warning }
rulesConfig.add(RulesConfig(warning, enabled = true, configuration = configuration))
}
}
.toList()
createTempFile().toFile()
.also {
configFilePath = it.absolutePath
}
.writeText(
Yaml(configuration = YamlConfiguration(strictMode = true))
.encodeToString(ListSerializer(RulesConfig.serializer()), rulesConfig)
)
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #1`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "Bug1Expected.kt", "Bug1Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #2`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "DefaultPackageExpected.kt", "DefaultPackageTest.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #3`() {
overrideRulesConfig(
rulesToDisable = emptyList(),
rulesToOverride = mapOf(
Warnings.WRONG_INDENTATION.name to mapOf(
"extendedIndentAfterOperators" to "true",
"extendedIndentBeforeDot" to "false",
)
)
)
saveSmokeTest(configFilePath, "Example1Expected.kt", "Example1Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #4`() {
overrideRulesConfig(
rulesToDisable = emptyList(),
rulesToOverride = mapOf(
Warnings.WRONG_INDENTATION.name to mapOf(
"extendedIndentAfterOperators" to "true",
"extendedIndentBeforeDot" to "true",
)
)
)
saveSmokeTest(configFilePath, "Example2Expected.kt", "Example2Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #5`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "Example3Expected.kt", "Example3Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #6`() {
overrideRulesConfig(
rulesToDisable = emptyList(),
rulesToOverride = mapOf(
Warnings.WRONG_INDENTATION.name to mapOf(
"extendedIndentAfterOperators" to "true",
"extendedIndentBeforeDot" to "false",
)
)
)
saveSmokeTest(configFilePath, "Example4Expected.kt", "Example4Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #7`() {
overrideRulesConfig(emptyList(),
mapOf(
Warnings.HEADER_MISSING_OR_WRONG_COPYRIGHT.name to mapOf(
"isCopyrightMandatory" to "true",
"copyrightText" to """|Copyright 2018-${LocalDate.now().year} John Doe.
| Licensed under the Apache License, Version 2.0 (the "License");
| you may not use this file except in compliance with the License.
| You may obtain a copy of the License at
|
| http://www.apache.org/licenses/LICENSE-2.0
""".trimMargin()
),
DIKTAT_COMMON to mapOf(
"domainName" to "org.cqfn.diktat",
"kotlinVersion" to "1.3.7"
)
)
)
saveSmokeTest(configFilePath, "Example5Expected.kt", "Example5Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #8`() {
overrideRulesConfig(
rulesToDisable = emptyList(),
rulesToOverride = mapOf(
Warnings.WRONG_INDENTATION.name to mapOf(
"extendedIndentAfterOperators" to "true",
"extendedIndentBeforeDot" to "true",
)
)
)
saveSmokeTest(configFilePath, "Example6Expected.kt", "Example6Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #9`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "Example7Expected.kt", "Example7Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #10`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "Example8Expected.kt", "Example8Test.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #11`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "KdocFormattingMultilineTagsExpected.kt", "KdocFormattingMultilineTagsTest.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #12`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "ManyLineTransformInLongLineExpected.kt", "ManyLineTransformInLongLineTest.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test #13`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "LocalVariableWithOffsetExpected.kt", "LocalVariableWithOffsetTest.kt")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test with kts files #2`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "script/SimpleRunInScriptExpected.kts", "script/SimpleRunInScriptTest.kts")
}

@Test
@Tag("DiktatRuleSetProvider")
fun `save smoke test with kts files with package name`() {
saveSmokeTest(DEFAULT_CONFIG_PATH, "script/PackageInScriptExpected.kts", "script/PackageInScriptTest.kts")
}

companion object {
private const val DEFAULT_CONFIG_PATH = "../diktat-analysis.yml"
private val unfixedLintErrors: MutableList<LintError> = mutableListOf()

// by default using same yml config as for diktat code style check, but allow to override
private var configFilePath = DEFAULT_CONFIG_PATH
}
}
55 changes: 54 additions & 1 deletion diktat-rules/src/test/kotlin/org/cqfn/diktat/util/FixTestBase.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@ import org.cqfn.diktat.test.framework.processing.TestComparatorUnit

import com.pinterest.ktlint.core.Rule
import com.pinterest.ktlint.core.RuleSetProvider
import org.apache.commons.io.FileUtils.copyFile
import org.intellij.lang.annotations.Language
import org.junit.jupiter.api.Assertions
import java.io.File

import java.nio.file.Path
import kotlin.io.path.bufferedWriter
Expand All @@ -19,11 +21,12 @@ import kotlin.io.path.div
open class FixTestBase(protected val resourceFilePath: String,
private val ruleSetProviderRef: (rulesConfigList: List<RulesConfig>?) -> RuleSetProvider,
private val cb: LintErrorCallback = defaultCallback,
private val rulesConfigList: List<RulesConfig>? = null
private val rulesConfigList: List<RulesConfig>? = null,
) {
private val testComparatorUnit = TestComparatorUnit(resourceFilePath) { text, fileName ->
format(ruleSetProviderRef, text, fileName, rulesConfigList, cb = cb)
}
private val diktatVersion = "1.2.1-SNAPSHOT"
Cheshiriks marked this conversation as resolved.
Show resolved Hide resolved

constructor(resourceFilePath: String,
ruleSupplier: (rulesConfigList: List<RulesConfig>) -> Rule,
Expand Down Expand Up @@ -58,6 +61,56 @@ open class FixTestBase(protected val resourceFilePath: String,
)
}

private fun getSaveForCurrentOs() = when {
System.getProperty("os.name").startsWith("Linux", ignoreCase = true) -> "save-linuxX64.kexe"
System.getProperty("os.name").startsWith("Mac", ignoreCase = true) -> "save-macosX64.kexe"
System.getProperty("os.name").startsWith("Windows", ignoreCase = true) -> "save.exe"
else -> ""
}

/**
* @param expectedPath path to file with expected result, relative to [resourceFilePath]
* @param testPath path to file with code that will be transformed by formatter, relative to [resourceFilePath]
* @param configFilePath path of diktat-analysis file
*/
protected fun saveSmokeTest(
petertrr marked this conversation as resolved.
Show resolved Hide resolved
configFilePath: String,
expectedPath: String,
testPath: String
) {
Fixed Show fixed Hide fixed
val processBuilder = ProcessBuilder("src/test/resources/test/smoke/${getSaveForCurrentOs()}", "src/test/resources/test/smoke/src/main/kotlin", expectedPath, testPath,
"--log", "all")

val file = File("tmpSave.txt")
val diktat = File("src/test/resources/test/smoke/diktat.jar")
val configFile = File("src/test/resources/test/smoke/diktat-analysis.yml")
val diktatFrom = File("../diktat-ruleset/target/diktat-$diktatVersion.jar")
val configFileFrom = File(configFilePath)

file.createNewFile()
diktat.createNewFile()
configFile.createNewFile()

copyFile(diktatFrom, diktat)
copyFile(configFileFrom, configFile)

processBuilder.redirectOutput(file)

val process = processBuilder.start()
process.waitFor()

val output = file.readLines()
val saveOutput = output.joinToString("\n")

file.delete()
diktat.delete()
configFile.delete()

Assertions.assertTrue(
saveOutput.contains("SUCCESS")
)
}

/**
* @param expectedPath path to file with expected result, relative to [resourceFilePath]
* @param testPath path to file with code that will be transformed by formatter, relative to [resourceFilePath]
Expand Down
Binary file added diktat-rules/src/test/resources/test/smoke/ktlint
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
11 changes: 8 additions & 3 deletions diktat-rules/src/test/resources/test/smoke/save.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
[general]
execCmd="java -jar ktlint-snap.jar -R diktat-1.0.0-rc.2.jar"
execCmd="java -jar ktlint -R diktat.jar"
tags = ["smokeTest"]
description = "SmokeTest"
suiteName = "SmokeTest"
language = "Kotlin"
expectedWarningsPattern = "// ;warn:?(.*):(\\d*): (.+)"

[fix]
execFlags="--disabled_rules 'standard' -F"
["fix and warn"]
["fix and warn".fix]
execFlags="--disabled_rules=standard -F"
["fix and warn".warn]
actualWarningsPattern = "(\\w+\\..+):(\\d+):(\\d+): (\\[.*\\].*)$"
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
// ;warn:1:1: [FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: Bug1Expected.kt vs D
// ;warn:1:1: [FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: Bug1Expected.kt vs D{{.*}}
package org.cqfn.diktat

// ;warn:4:1: [MISSING_KDOC_TOP_LEVEL] all public and internal top-level classes and functions should have Kdoc: D (cannot be auto-corrected)
// ;warn:7:7: [CLASS_NAME_INCORRECT] class/enum/interface name should be in PascalCase and should contain only latin (ASCII) letters or numbers: D
// ;warn:7:7: [IDENTIFIER_LENGTH] identifier's length is incorrect, it should be in range of [2, 64] symbols: D (cannot be auto-corrected)
// ;warn:4:1: [MISSING_KDOC_TOP_LEVEL] all public and internal top-level classes and functions should have Kdoc: D (cannot be auto-corrected){{.*}}
// ;warn:7:7: [CLASS_NAME_INCORRECT] class/enum/interface name should be in PascalCase and should contain only latin (ASCII) letters or numbers: D{{.*}}
// ;warn:7:7: [IDENTIFIER_LENGTH] identifier's length is incorrect, it should be in range of [2, 64] symbols: D (cannot be auto-corrected){{.*}}
class D {
// ;warn:8:5: [MISSING_KDOC_CLASS_ELEMENTS] all public, internal and protected classes, functions and variables inside the class should have Kdoc: x (cannot be auto-corrected)
// ;warn:8:5: [MISSING_KDOC_CLASS_ELEMENTS] all public, internal and protected classes, functions and variables inside the class should have Kdoc: x (cannot be auto-corrected){{.*}}
val x = 0
// ;warn:13:8: [KDOC_NO_EMPTY_TAGS] no empty descriptions in tag blocks are allowed: @return (cannot be auto-corrected)
// ;warn:13:8: [KDOC_NO_EMPTY_TAGS] no empty descriptions in tag blocks are allowed: @return (cannot be auto-corrected){{.*}}

/**
* @return
*/
fun bar(): Bar {
// ;warn:17:19: [MAGIC_NUMBER] avoid using magic numbers, instead define constants with clear names describing what the magic number means: 42 (cannot be auto-corrected)
// ;warn:17:19: [MAGIC_NUMBER] avoid using magic numbers, instead define constants with clear names describing what the magic number means: 42 (cannot be auto-corrected){{.*}}
val qux = 42
return Bar(qux)
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// ;warn:1:1: [FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: DefaultPackageExpected.kt vs Example{{.*}}
// ;warn:3:1: [FILE_INCORRECT_BLOCKS_ORDER] general structure of kotlin source file is wrong, parts are in incorrect order: @file:Suppress{{.*}}
@file:Suppress(
"PACKAGE_NAME_MISSING",
"PACKAGE_NAME_INCORRECT_PATH",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
// ;warn:1:1: [FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: Example1Expected.kt vs Example{{.*}}
package org.cqfn.diktat

// ;warn:4:1: [MISSING_KDOC_TOP_LEVEL] all public and internal top-level classes and functions should have Kdoc: Example (cannot be auto-corrected){{.*}}
class Example {
// ;warn:6:5: [MISSING_KDOC_CLASS_ELEMENTS] all public, internal and protected classes, functions and variables inside the class should have Kdoc: isValid (cannot be auto-corrected){{.*}}
// ;warn:10:5: [MISSING_KDOC_CLASS_ELEMENTS] all public, internal and protected classes, functions and variables inside the class should have Kdoc: foo (cannot be auto-corrected){{.*}}
@get:JvmName("getIsValid")
val isValid = true
val foo: Int = 1

// ;warn:12:5: [MISSING_KDOC_CLASS_ELEMENTS] all public, internal and protected classes, functions and variables inside the class should have Kdoc: foo (cannot be auto-corrected){{.*}}
// ;warn:12:5: [MISSING_KDOC_ON_FUNCTION] all public, internal and protected functions should have Kdoc with proper tags: foo (cannot be auto-corrected){{.*}}
// ;warn:19:19: [EMPTY_BLOCK_STRUCTURE_ERROR] incorrect format of empty block: empty blocks are forbidden unless it is function with override keyword (cannot be auto-corrected){{.*}}
// ;warn:24:8: [KDOC_NO_EMPTY_TAGS] no empty descriptions in tag blocks are allowed: @return (cannot be auto-corrected){{.*}}
// ;warn:30:8: [KDOC_NO_EMPTY_TAGS] no empty descriptions in tag blocks are allowed: @return (cannot be auto-corrected){{.*}}
// ;warn:38:8: [KDOC_NO_EMPTY_TAGS] no empty descriptions in tag blocks are allowed: @return (cannot be auto-corrected){{.*}}
// ;warn:47:8: [KDOC_NO_EMPTY_TAGS] no empty descriptions in tag blocks are allowed: @return (cannot be auto-corrected){{.*}}
fun Foo.foo() { }

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
// ;warn:1:1: [HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE] files that contain multiple or no classes should contain description of what is inside of this file: there are 2 declared classes and/or objects (cannot be auto-corrected){{.*}}
package org.cqfn.diktat

import org.slf4j.LoggerFactory
Expand All @@ -11,6 +12,7 @@ import java.util.Properties
*/
@ExperimentalStdlibApi public data class Example(val foo: Int, val bar: Double) : SuperExample("lorem ipsum")

// ;warn:36:3: [EMPTY_BLOCK_STRUCTURE_ERROR] incorrect format of empty block: empty blocks are forbidden unless it is function with override keyword (cannot be auto-corrected){{.*}}
private class TestException : Exception()
/* this class is unused */
// private class Test : RuntimeException()
Expand Down
Loading