Skip to content

Commit

Permalink
Fix ktlint issues for new default rules
Browse files Browse the repository at this point in the history
  • Loading branch information
3flex committed Apr 22, 2023
1 parent 1bedc03 commit b921d46
Show file tree
Hide file tree
Showing 8 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ interface Config {
/**
* Is thrown when loading a configuration results in errors.
*/
class InvalidConfigurationError(throwable: Throwable? = null /* nullable to not break signature */) :
class InvalidConfigurationError(throwable: Throwable? = null) :
RuntimeException(
"Provided configuration file is invalid: Structure must be from type Map<String,Any>!" +
throwable?.let { "\n" + it.message }.orEmpty(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class CliArgs {
The following @Parameters are used for type resolution. When additional parameters are required the
names should mirror the names found in this file (e.g. "classpath", "language-version", "jvm-target"):
https://github.com/JetBrains/kotlin/blob/master/compiler/cli/cli-common/src/org/jetbrains/kotlin/cli/common/arguments/K2JVMCompilerArguments.kt
*/
*/
@Parameter(
names = ["--classpath", "-cp"],
description = "EXPERIMENTAL: Paths where to find user class files and depending jar files. " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class AnnotationSuppressorSpec(private val env: KotlinCoreEnvironment) {
inner class AnnotationSuppressorFactory {
@Test
fun `Factory returns null if ignoreAnnotated is not set`() {
val suppressor = annotationSuppressorFactory(buildConfigAware(/* empty */), BindingContext.EMPTY)
val suppressor = annotationSuppressorFactory(buildConfigAware(), BindingContext.EMPTY)

assertThat(suppressor).isNull()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class FunctionSuppressorSpec {
@Test
fun `Factory returns null if ignoreFunction is not set`() {
val suppressor = functionSuppressorFactory(
buildConfigAware(/* empty */),
buildConfigAware(),
BindingContext.EMPTY,
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ internal class RuleVisitor : DetektVisitor() {
// which needs detekt-formatting.jar,
// which needs :detekt-formatting:processResources task output,
// which needs output of this class.
/*io.gitlab.arturbosch.detekt.api.Rule*/ "Rule",
/*io.gitlab.arturbosch.detekt.formatting.FormattingRule*/ "FormattingRule",
/*io.gitlab.arturbosch.detekt.api.ThresholdRule*/ "ThresholdRule",
/*io.gitlab.arturbosch.detekt.rules.empty.EmptyRule*/ "EmptyRule",
"Rule", // io.gitlab.arturbosch.detekt.api.Rule
"FormattingRule", // io.gitlab.arturbosch.detekt.formatting.FormattingRule
"ThresholdRule", // io.gitlab.arturbosch.detekt.api.ThresholdRule
"EmptyRule", // io.gitlab.arturbosch.detekt.rules.empty.EmptyRule
)

private const val ISSUE_ARGUMENT_SIZE = 4
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ internal class DefaultClassLoaderCache : ClassLoaderCache {
return classpathFilesHashWithLoaders.getOrPut(classpathHashCode) {
URLClassLoader(
classpathFiles.map { it.toURI().toURL() }.toTypedArray(),
null /* isolate detekt environment */
null // isolate detekt environment
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class MaxLineLength(config: Config = Config.empty) : Rule(config) {
report(CodeSmell(issue, Entity.from(ktElement, location), issue.description))
}

offset += 1 /* '\n' */
offset += 1 // '\n'
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class TrailingWhitespace(config: Config = Config.empty) : Rule(config) {
report(CodeSmell(issue, entity, createMessage(index)))
}
}
offset += 1 /* '\n' */
offset += 1 // '\n'
}
}

Expand Down

0 comments on commit b921d46

Please sign in to comment.