diff --git a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/KotlinGradleExtensionTest.java b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/KotlinGradleExtensionTest.java index 566454527e..c68de0d7e7 100644 --- a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/KotlinGradleExtensionTest.java +++ b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/KotlinGradleExtensionTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2016-2021 DiffPlug + * Copyright 2016-2022 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,8 +90,7 @@ void integration_default_diktat() throws IOException { "}"); setFile("configuration.gradle.kts").toResource("kotlin/diktat/basic.dirty"); BuildResult result = gradleRunner().withArguments("spotlessApply").buildAndFail(); - assertThat(result.getOutput()).contains("[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 0 declared classes and/or objects"); + assertThat(result.getOutput()).contains("[AVOID_NESTED_FUNCTIONS] try to avoid using nested functions"); } @Test diff --git a/plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin/DiktatTest.java b/plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin/DiktatTest.java index a79cff3f8d..bd37c5c82e 100644 --- a/plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin/DiktatTest.java +++ b/plugin-maven/src/test/java/com/diffplug/spotless/maven/kotlin/DiktatTest.java @@ -1,5 +1,5 @@ /* - * Copyright 2021 DiffPlug + * Copyright 2021-2022 DiffPlug * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -38,7 +38,10 @@ void testDiktat() throws Exception { @Test void testDiktatWithVersion() throws Exception { - writePomWithKotlinSteps("0.4.0"); + writePomWithKotlinSteps( + "", + " 1.0.1", + ""); String path = "src/main/kotlin/Main.kt"; setFile(path).toResource("kotlin/diktat/main.dirty"); @@ -51,7 +54,11 @@ void testDiktatConfig() throws Exception { String configPath = "src/main/kotlin/diktat-analysis.yml"; File conf = setFile(configPath).toResource("kotlin/diktat/diktat-analysis.yml"); - writePomWithKotlinSteps("0.4.0" + conf.getAbsolutePath() + ""); + writePomWithKotlinSteps( + "", + " 1.0.1", + " " + conf.getAbsolutePath() + "", + ""); String path = "src/main/kotlin/Main.kt"; setFile(path).toResource("kotlin/diktat/main.dirty"); diff --git a/testlib/src/main/resources/kotlin/diktat/diktat-analysis.yml b/testlib/src/main/resources/kotlin/diktat/diktat-analysis.yml index 8c88553907..550de716ef 100644 --- a/testlib/src/main/resources/kotlin/diktat/diktat-analysis.yml +++ b/testlib/src/main/resources/kotlin/diktat/diktat-analysis.yml @@ -75,13 +75,6 @@ enabled: 'true' - name: HEADER_WRONG_FORMAT enabled: true -- name: HEADER_MISSING_IN_NON_SINGLE_CLASS_FILE - enabled: true -- name: HEADER_MISSING_OR_WRONG_COPYRIGHT - enabled: true - configuration: - isCopyrightMandatory: false - copyrightText: 'Copyright (c) Your Company Name Here. 2010-2021' - name: HEADER_NOT_BEFORE_PACKAGE enabled: true - name: FILE_IS_TOO_LONG @@ -182,7 +175,7 @@ - name: WRONG_NEWLINES_AROUND_KDOC enabled: true # Inspection that checks if there is no blank lines before first comment -- name: FIRST_COMMENT_NO_SPACES +- name: FIRST_COMMENT_NO_BLANK_LINE enabled: true # Inspection that checks if there are blank lines between code and comment and between code start token and comment's text - name: COMMENT_WHITE_SPACE