From 958864d1f3089421de05dd551cdf8fb117e7ae33 Mon Sep 17 00:00:00 2001 From: Benoit Lacelle Date: Mon, 20 Feb 2023 11:10:04 +0400 Subject: [PATCH 1/2] Add cleanthat to spotless config --- gradle/spotless.gradle | 1 + 1 file changed, 1 insertion(+) diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle index 677630ac69..67d0c65ceb 100644 --- a/gradle/spotless.gradle +++ b/gradle/spotless.gradle @@ -17,6 +17,7 @@ spotless { java { ratchetFrom 'origin/main' bumpThisNumberIfACustomStepChanges(1) + cleanthat().version("2.4").sourceCompatibility("11").clearMutators().addMutators(['RSPEC-6212']) licenseHeaderFile rootProject.file('gradle/spotless.license') importOrderFile rootProject.file('gradle/spotless.importorder') eclipse().configFile rootProject.file('gradle/spotless.eclipseformat.xml') From 53f3fcfbef89e12294be8b1210426294654c6790 Mon Sep 17 00:00:00 2001 From: Benoit Lacelle Date: Tue, 7 Mar 2023 10:41:24 +0400 Subject: [PATCH 2/2] Improve gradle configuration --- gradle/spotless.gradle | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/gradle/spotless.gradle b/gradle/spotless.gradle index 67d0c65ceb..587a0b40a7 100644 --- a/gradle/spotless.gradle +++ b/gradle/spotless.gradle @@ -17,7 +17,10 @@ spotless { java { ratchetFrom 'origin/main' bumpThisNumberIfACustomStepChanges(1) - cleanthat().version("2.4").sourceCompatibility("11").clearMutators().addMutators(['RSPEC-6212']) + // `setMutators` will discard default mutators + // https://sonarsource.atlassian.net/browse/RSPEC-6212 + cleanthat().version("2.9").sourceCompatibility(project.sourceCompatibility.toString()).clearMutators() + .addMutator('RSPEC-6212') licenseHeaderFile rootProject.file('gradle/spotless.license') importOrderFile rootProject.file('gradle/spotless.importorder') eclipse().configFile rootProject.file('gradle/spotless.eclipseformat.xml')