Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Upgrade ktlint to 0.47.1 * Update detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingCommaOnDeclarationSite.kt Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com> * Update detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingCommaOnCallSite.kt Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com> * Update detekt-formatting/src/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingCommaOnDeclarationSite.kt Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com> * Update detekt rule property names * Fix tests * Add deprecated properties and active rules by default * Fix more annotation on separate line Co-authored-by: Matthew Haughton <3flex@users.noreply.github.com>
- Loading branch information
1 parent
7027c27
commit e259980
Showing
30 changed files
with
298 additions
and
188 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...rc/main/kotlin/io/gitlab/arturbosch/detekt/formatting/wrappers/TrailingCommaOnCallSite.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package io.gitlab.arturbosch.detekt.formatting.wrappers | ||
|
||
import com.pinterest.ktlint.core.api.UsesEditorConfigProperties | ||
import com.pinterest.ktlint.ruleset.standard.TrailingCommaOnCallSiteRule | ||
import io.gitlab.arturbosch.detekt.api.Config | ||
import io.gitlab.arturbosch.detekt.api.config | ||
import io.gitlab.arturbosch.detekt.api.internal.AutoCorrectable | ||
import io.gitlab.arturbosch.detekt.api.internal.Configuration | ||
import io.gitlab.arturbosch.detekt.formatting.FormattingRule | ||
|
||
/** | ||
* See [ktlint docs](https://pinterest.github.io/ktlint/rules/standard/) for documentation. | ||
*/ | ||
@AutoCorrectable(since = "1.22.0") | ||
class TrailingCommaOnCallSite(config: Config) : FormattingRule(config) { | ||
|
||
override val wrapping = TrailingCommaOnCallSiteRule() | ||
override val issue = issueFor("Rule to mandate/forbid trailing commas at call sites") | ||
|
||
@Configuration("Defines whether a trailing comma (or no trailing comma) should be enforced at call sites") | ||
private val useTrailingCommaOnCallSite by config(false) | ||
|
||
override fun overrideEditorConfigProperties(): Map<UsesEditorConfigProperties.EditorConfigProperty<*>, String> = | ||
mapOf( | ||
TrailingCommaOnCallSiteRule.allowTrailingCommaOnCallSiteProperty to useTrailingCommaOnCallSite.toString(), | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.