Unable to disable ktlint rule
See original GitHub issueI’m new to spotless and I might miss something. However, I’m not able to disable a specific ktlint rule.
// id("com.diffplug.gradle.spotless") version "3.24.2"
spotless {
kotlin {
ktlint().userData(mapOf("disabled_rules" to "comment-spacing"))
}
}
regarding to this and that, “comment-spacing” should be disabled globally. However, I still as the following error:
$ gw spotlessCheck
> Task :spotlessKotlin FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':spotlessKotlin'.
> The following files had format violations:
src/compatTest/kotlin/io/github/gradlenexus/publishplugin/NexusPublishPluginTests.kt
@@ -48,7 +48,7 @@
import·java.nio.file.Files
import·java.nio.file.Path
-@Suppress("FunctionName")·//TODO:·How·to·suppress·"kotlin:S100"·from·SonarLint?
+@Suppress("FunctionName")·//·TODO:·How·to·suppress·"kotlin:S100"·from·SonarLint?
@ExtendWith(WiremockResolver::class)
class·NexusPublishPluginTests·{
Run 'gradlew spotlessApply' to fix these violations.
which suggests that rule is still taken into account.
What have I missed? How to effectively disable ktlint rule for the whole project?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
FAQ - Ktlint
ktlint -disable no-wildcard-imports other-rule-id */ import package.a. ... A big disadvantage is that it is not possible to override the property partially ...
Read more >How to disable ktlint rule for Missing newline after ":"
I just wanted to bring the interfaces below one another since bunch of interfaces consumes too much of code line. android · kotlin...
Read more >jeremymailen / ktlint Download - JitPack
To disable a specific rule you'll need to turn on the verbose mode ( ktlint --verbose ... ). At the end of each...
Read more >Changelog and Migration Guide - Detekt
KtLint replaced their default Indentation rule. Expect new formatting issues here! We removed HierachicalConfig interface. It was deprecated in 1.7.0 and could ...
Read more >Anti-Bikeshedding with Ktlint - Thrive Mobile
For example, you cannot to ignore the whitespace rules for your entire project, instead you must disable the rule on a file-by-file basis....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@nedtwigg Did you mean to refer to #142, by any chance? 😃
I don’t think such a disable rule exist. The mechanism in Spotless works in general though: