Skip to content

Rule to mandate/forbid trailing commas #709

@3flex

Description

@3flex

Expected Behavior

ktlint offers a rule that enforces a particular code style regarding trailing commas, which are now permitted by the Kotlin compiler as of 1.3.70, see https://youtrack.jetbrains.com/issue/KT-34743 for more details.

This may not be a good fit for ktlint as it's too opinionated and no conventions exist yet, but if it's suitable it's a better fit here than in detekt where it was originally proposed.

Observed Behavior

No such rule exists.

Steps to Reproduce

N/A, new rule required.

Your Environment

  • Version of ktlint used:
  • Name and version (or code for custom task) of integration used (Gradle plugin, Maven plugin, command line, custom Gradle task):
  • Version of Gradle used (if applicable):
  • Operating System and version:
  • Link to your project (if it's a public repository):

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions