Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pinterest/ktlint
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 1.1.1
Choose a base ref
...
head repository: pinterest/ktlint
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1.2.0
Choose a head ref

Commits on Jan 3, 2024

  1. Simplify BOM exclude list

    Goooler committed Jan 3, 2024
    Copy the full SHA
    c3d1998 View commit details

Commits on Jan 8, 2024

  1. Updated refs to latest (1.1.1) release

    Ktlint Release Workflow committed Jan 8, 2024
    Copy the full SHA
    a573af8 View commit details
  2. Merge pull request #2496 from pinterest/1.1.1-update-refs

    Updated refs to latest (1.1.1) release
    paul-dingemans authored Jan 8, 2024
    Copy the full SHA
    2f84850 View commit details
  3. Copy the full SHA
    8ee14f3 View commit details
  4. Set 1.2.0-SNAPSHOT

    paul-dingemans committed Jan 8, 2024
    Copy the full SHA
    0c3f302 View commit details
  5. Merge pull request #2498 from pinterest/1.1.1-clean-up

    Finish 1.1.1 release
    paul-dingemans authored Jan 8, 2024
    Copy the full SHA
    6e09999 View commit details

Commits on Jan 9, 2024

  1. Merge pull request #2497 from pinterest/renovate/org.slf4j-slf4j-simp…

    …le-2.x
    
    fix(deps): update dependency org.slf4j:slf4j-simple to v2.0.11
    paul-dingemans authored Jan 9, 2024
    Copy the full SHA
    983a035 View commit details

Commits on Jan 10, 2024

  1. Copy the full SHA
    9d338c2 View commit details
  2. Copy the full SHA
    761728a View commit details

Commits on Jan 12, 2024

  1. Copy the full SHA
    7354181 View commit details

Commits on Jan 14, 2024

  1. Merge pull request #2503 from pinterest/renovate/org.gradle.toolchain…

    …s.foojay-resolver-convention-0.x
    
    chore(deps): update plugin org.gradle.toolchains.foojay-resolver-convention to v0.8.0
    paul-dingemans authored Jan 14, 2024
    Copy the full SHA
    bdc82f8 View commit details

Commits on Jan 15, 2024

  1. Copy the full SHA
    8f2af74 View commit details

Commits on Jan 23, 2024

  1. Merge pull request #2440 from pinterest/renovate/io.github.oshai-kotl…

    …in-logging-jvm-6.x
    
    fix(deps): update dependency io.github.oshai:kotlin-logging-jvm to v6
    paul-dingemans authored Jan 23, 2024
    Copy the full SHA
    08fb4bd View commit details
  2. Merge pull request #2476 from Goooler/simplify-bom-publishing

    Simplify BOM exclude list
    paul-dingemans authored Jan 23, 2024
    Copy the full SHA
    f7557d2 View commit details
  3. Merge pull request #2500 from pinterest/2499-argument-list-wrapping

    Prevent IllegalArgumentException in `argument-list-wrapping` rule
    paul-dingemans authored Jan 23, 2024
    Copy the full SHA
    cc1954d View commit details
  4. Break dependency between string-template-indent and multiline-express…

    …ion-wrapping (#2505)
    
    * Break dependency between string-template-indent and multiline-expression-wrapping
    
    If need be, the string-template-indent rule wraps the opening quotes of a multiline raw string literal to a new line. The `string-template-indent` can now be enabled regardless whether `multiline-expression-wrapping` is enabled.
    
    Closes #2504
    paul-dingemans authored Jan 23, 2024
    Copy the full SHA
    30e8b1d View commit details
  5. Copy the full SHA
    5d9c5bb View commit details
  6. Add configuration setting for ignoring argument-list-wrapping above…

    … treshold of parameters (#2481)
    
    * Add configuration setting for ignoring `argument-list-wrapping` above treshold of parameters
    
    Breaking change: For code style `ktlint_official` the default value for this setting has default `unset` which is different from previous default value `8`. Not wrapping parameters should be a conscious decision of the developer. This can either be done on a case by case basis by suppressing the rule, or by configuring the parameter.
    
    Closes #2461
    paul-dingemans authored Jan 23, 2024
    Copy the full SHA
    66d4854 View commit details

Commits on Jan 26, 2024

  1. fix(deps): update dependency org.assertj:assertj-core to v3.25.2 (#2511)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 26, 2024
    Copy the full SHA
    60046ef View commit details

Commits on Jan 27, 2024

  1. chore(deps): update gradle/gradle-build-action action to v3 (#2512)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 27, 2024
    Copy the full SHA
    50aab14 View commit details

Commits on Jan 28, 2024

  1. Ignore EOL comment that causes max_line_length to be exceeded, except…

    … in max-line-length rule (#2516)
    
    Rules should not start wrapping code in case the max_line_length is exceeded because of the EOL comment. The developer should determine whether the EOL comment should be shortened, or be placed on a separate line instead of wrapping via autocorrect.
    
    Closes #2450
    paul-dingemans authored Jan 28, 2024
    Copy the full SHA
    705221b View commit details
  2. Copy the full SHA
    897deef View commit details
  3. Copy the full SHA
    dd1e9cc View commit details

Commits on Jan 30, 2024

  1. chore(deps): update plugin kotlinx-binary-compatibiltiy-validator to …

    …v0.14.0 (#2522)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 30, 2024
    Copy the full SHA
    c765c49 View commit details
  2. chore(deps): update gradle/wrapper-validation-action action to v2 (#2523

    )
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 30, 2024
    Copy the full SHA
    8ed004d View commit details
  3. chore(deps): update ffurrer2/extract-release-notes action to v2 (#2515)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Jan 30, 2024
    Copy the full SHA
    4fd9d0b View commit details

Commits on Feb 3, 2024

  1. chore(deps): update dependency gradle to v8.6 (#2531)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 3, 2024
    Copy the full SHA
    9ab5f9e View commit details
  2. Copy the full SHA
    4c5c305 View commit details
  3. Copy the full SHA
    3b25af6 View commit details

Commits on Feb 5, 2024

  1. fix(deps): update dependency org.assertj:assertj-core to v3.25.3 (#2536)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 5, 2024
    Copy the full SHA
    08db11f View commit details
  2. fix(deps): update dependency org.junit.jupiter:junit-jupiter to v5.10…

    ….2 (#2534)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 5, 2024
    Copy the full SHA
    5b7d5ef View commit details

Commits on Feb 6, 2024

  1. fix(deps): update dependency org.slf4j:slf4j-simple to v2.0.12 (#2538)

    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 6, 2024
    Copy the full SHA
    d38c899 View commit details

Commits on Feb 9, 2024

  1. Handle comment between class/function name and parameterlist (#2541)

    Comments are not allowed between a class/function name and the parameter list.
    
    * Insert newline after KDoc at correct position in the AST
    * Report violation when parameter list is preceded by a comment
    
    Closes #2535
    paul-dingemans authored Feb 9, 2024
    Copy the full SHA
    4c13743 View commit details

Commits on Feb 11, 2024

  1. Copy the full SHA
    a6e6b55 View commit details
  2. Add new rule for disallowing KDoc at non-whitelisted locations (#2548)

    KDocs should only be used at locations for which it makes sense to provide (e.g. generate) documentation to be used by other consumers.
    
    Closes #2547
    paul-dingemans authored Feb 11, 2024
    Copy the full SHA
    7501f72 View commit details
  3. Improve insert of suppression (#2546)

    * Prevent KtlintSuppressionOutOfBoundsException Suppression if offset equals the end the line.
    * Insert suppression at parent in case the target location of the suppression is a whitespace.
    
    Closes #2514
    paul-dingemans authored Feb 11, 2024
    Copy the full SHA
    1b7c449 View commit details

Commits on Feb 13, 2024

  1. Copy the full SHA
    22ba7c1 View commit details

Commits on Feb 14, 2024

  1. Ignore EOL comments in value-argument-comment and `value-parameter-…

    …comment` (#2551)
    
    EOL comments which are just before or after a value argument or value parameter do not belong to the VALUE_ARGUMENT or VALUE_PARAMETER AST node but to the out LIST element. So this rule only reports comments that are actually inside the VALUE_ARGUMENT or VALUE_PARAMETER node.
    
    Closes #2519
    paul-dingemans authored Feb 14, 2024
    Copy the full SHA
    33396eb View commit details
  2. Ignore modifier of backing property in android_studio code style (#…

    …2552)
    
    Extract `backing-property-name` from `property-naming` rule. This allows users to disable this rule, but keep the `property-naming` rule in place.
    
     For `android_studio` code style the restrictions regarding the modifier of the correlated property or function is ignored entirely as the Android Kotlin Styleguide does not require it to be public.
    
     Closes #2528
    paul-dingemans authored Feb 14, 2024
    Copy the full SHA
    a88a2e5 View commit details
  3. Do not indent string template starting at first position of line (#2553)

    Also, the `indent` rule should not change unexpected indentation characters inside a string template but leave this up to the `string-template-indent` rule. As a result the `indent` rule could be a bit simplified.
    
    Closes #2350
    paul-dingemans authored Feb 14, 2024
    Copy the full SHA
    8eb0a58 View commit details

Commits on Feb 18, 2024

  1. Copy the full SHA
    114a776 View commit details
  2. Copy the full SHA
    c639b30 View commit details

Commits on Feb 20, 2024

  1. Revert "Remove dependency org.codehaus.janino:janino (#2545)" (#2558)

    Janino is required for logback-test.xml conditional configuration so that trace-logging in unit test can be automatically enabled using an environment variable
    
    This (partially) reverts commit a6e6b55.
    paul-dingemans authored Feb 20, 2024
    Copy the full SHA
    028c1eb View commit details

Commits on Feb 24, 2024

  1. Replace picocli with clikt (#2556)

    Clikt is a kotlin library which allows more Kotlin native code. Also, it is blocking minifying the ktlint jar.
    
    Closes #2550
    paul-dingemans authored Feb 24, 2024
    Copy the full SHA
    cb17bbf View commit details
  2. fix(deps): update dependency org.codehaus.janino:janino to v3.1.12 (#…

    …2559)
    
    Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
    renovate[bot] authored Feb 24, 2024
    Copy the full SHA
    e12a648 View commit details

Commits on Feb 27, 2024

  1. Copy the full SHA
    60b6b8f View commit details
  2. Exclude EOL-comments when check whether max line length is exceeded i…

    …n rules other than max-line-length (#2565)
    
    Follow up on #2450:
    - fix exception in `function-literal` in case the literal block just contains an EOL-comment only
    - Change function `dropTrailingComment` to private (it was not yet exposed in a released version before)
    paul-dingemans authored Feb 27, 2024
    Copy the full SHA
    913887d View commit details
  3. Copy the full SHA
    4720ab2 View commit details
  4. Copy the full SHA
    6795977 View commit details
  5. Merge pull request #2568 from pinterest/2454-argument-list-wrapping

    Run argument-list-wrapping after function-signature
    paul-dingemans authored Feb 27, 2024
    Copy the full SHA
    773fd1d View commit details
Showing with 3,662 additions and 1,523 deletions.
  1. +1 −1 .github/actions/setup-gradle-build/action.yml
  2. +1 −1 .github/workflows/generate-changelog.yml
  3. +1 −1 .github/workflows/gradle-wrapper-validation.yml
  4. +1 −1 .github/workflows/publish-release-build.yml
  5. +75 −0 CHANGELOG.md
  6. +1 −1 build-logic/settings.gradle.kts
  7. +1 −1 build-logic/src/main/kotlin/ktlint-publication.gradle.kts
  8. +2 −2 documentation/release-latest/docs/install/cli.md
  9. +3 −3 documentation/release-latest/docs/install/integrations.md
  10. +1 −1 documentation/release-latest/docs/rules/configuration-ktlint.md
  11. +7 −8 documentation/release-latest/docs/rules/standard.md
  12. +2 −2 documentation/snapshot/docs/install/cli.md
  13. +3 −3 documentation/snapshot/docs/install/integrations.md
  14. +222 −0 documentation/snapshot/docs/rules/experimental.md
  15. +25 −49 documentation/snapshot/docs/rules/standard.md
  16. +1 −1 gradle.properties
  17. +9 −8 gradle/libs.versions.toml
  18. +2 −2 gradle/wrapper/gradle-wrapper.properties
  19. +3 −6 ktlint-bom/build.gradle.kts
  20. +4 −0 ...nt-cli-reporter-format/src/main/kotlin/com/pinterest/ktlint/cli/reporter/format/FormatReporter.kt
  21. +1 −1 ...eporter-format/src/main/kotlin/com/pinterest/ktlint/cli/reporter/format/FormatReporterProvider.kt
  22. +1 −1 ...i-reporter-plain/src/main/kotlin/com/pinterest/ktlint/cli/reporter/plain/PlainReporterProvider.kt
  23. +1 −1 ktlint-cli/build.gradle.kts
  24. +7 −35 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/Main.kt
  25. +2 −0 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/FileUtils.kt
  26. +14 −44 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/GenerateEditorConfigSubCommand.kt
  27. +10 −10 .../src/main/kotlin/com/pinterest/ktlint/cli/internal/{GitHookInstaller.kt → GitHookCliktCommand.kt}
  28. +6 −18 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/GitPreCommitHookSubCommand.kt
  29. +6 −18 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/GitPrePushHookSubCommand.kt
  30. +231 −241 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/KtlintCommandLine.kt
  31. +3 −5 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/KtlintVersionProvider.kt
  32. +0 −17 ktlint-cli/src/main/kotlin/com/pinterest/ktlint/cli/internal/PrintCommandLineHelpOrVersionUsage.kt
  33. +2 −1 ktlint-cli/src/test/kotlin/com/pinterest/ktlint/cli/CommandLineTestRunner.kt
  34. +19 −14 ktlint-cli/src/test/kotlin/com/pinterest/ktlint/cli/SimpleCLITest.kt
  35. +3 −0 ktlint-rule-engine-core/api/ktlint-rule-engine-core.api
  36. +46 −5 ...nt-rule-engine-core/src/main/kotlin/com/pinterest/ktlint/rule/engine/core/api/ASTNodeExtension.kt
  37. +1 −0 ktlint-rule-engine-core/src/main/kotlin/com/pinterest/ktlint/rule/engine/core/api/IndentConfig.kt
  38. +1 −1 ...in/kotlin/com/pinterest/ktlint/rule/engine/core/api/editorconfig/CodeStyleEditorConfigProperty.kt
  39. +1 −1 ...otlin/com/pinterest/ktlint/rule/engine/core/api/editorconfig/MaxLineLengthEditorConfigProperty.kt
  40. +1 −1 ...otlin/com/pinterest/ktlint/rule/engine/core/api/editorconfig/RuleExecutionEditorConfigProperty.kt
  41. +194 −50 ...ule-engine-core/src/test/kotlin/com/pinterest/ktlint/rule/engine/core/api/ASTNodeExtensionTest.kt
  42. +1 −1 ...e-core/src/test/kotlin/com/pinterest/ktlint/rule/engine/core/api/editorconfig/EditorConfigTest.kt
  43. +1 −1 ...src/test/kotlin/com/pinterest/ktlint/rule/engine/core/api/editorconfig/SafeEnumValueParserTest.kt
  44. +3 −3 ktlint-rule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/api/KtLintRuleEngine.kt
  45. +27 −4 ...t-rule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/api/KtlintRuleEngineSuppression.kt
  46. +1 −0 ...nt-rule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/internal/PositionInTextLocator.kt
  47. +3 −0 ...ule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/internal/SuppressionLocatorBuilder.kt
  48. +3 −0 ...e/src/main/kotlin/com/pinterest/ktlint/rule/engine/internal/rulefilter/RuleExecutionRuleFilter.kt
  49. +2 −1 ktlint-rule-engine/src/test/kotlin/com/pinterest/ktlint/rule/engine/api/KtLintTest.kt
  50. +87 −0 ...-engine/src/test/kotlin/com/pinterest/ktlint/rule/engine/api/KtlintRuleEngineSuppressionKtTest.kt
  51. +48 −0 ktlint-ruleset-standard/api/ktlint-ruleset-standard.api
  52. +8 −0 ...ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/StandardRuleSetProvider.kt
  53. +6 −0 ...nt-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/AnnotationRule.kt
  54. +54 −7 ...-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ArgumentListWrappingRule.kt
  55. +133 −0 ...standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BackingPropertyNamingRule.kt
  56. +5 −8 ...ndard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BinaryExpressionWrappingRule.kt
  57. +4 −1 ...ard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BlankLineBeforeDeclarationRule.kt
  58. +155 −0 ...ard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BlankLineBetweenWhenConditions.kt
  59. +7 −1 ...andard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRule.kt
  60. +2 −0 ...ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainWrappingRule.kt
  61. +1 −0 ...andard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ContextReceiverWrappingRule.kt
  62. +7 −4 ...-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/EnumWrappingRule.kt
  63. +0 −2 ...tandard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionExpressionBodyRule.kt
  64. +4 −3 ...leset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionLiteralRule.kt
  65. +2 −0 ...uleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionNamingRule.kt
  66. +1 −8 ...set-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionSignatureRule.kt
  67. +3 −0 ...ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/IfElseBracingRule.kt
  68. +3 −0 ...uleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ImportOrderingRule.kt
  69. +12 −89 ...t-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/IndentationRule.kt
  70. +80 −0 ktlint-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/KdocRule.kt
  71. +19 −56 ...-ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/KdocWrappingRule.kt
  72. +23 −5 ...ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/MaxLineLengthRule.kt
  73. +37 −26 ...ruleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ModifierOrderRule.kt
  74. +5 −0 ...standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoConsecutiveCommentsRule.kt
  75. +2 −0 ...eset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoTrailingSpacesRule.kt
  76. +8 −0 ...leset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoUnusedImportsRule.kt
  77. +5 −3 ...-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ParameterListSpacingRule.kt
  78. +37 −20 ...standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ParameterListWrappingRule.kt
  79. +6 −76 ...uleset-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/PropertyNamingRule.kt
  80. +7 −1 ...et-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundCurlyRule.kt
  81. +6 −1 ...ndard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundDoubleColonRule.kt
  82. +9 −2 ...-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundKeywordRule.kt
  83. +2 −0 ...tandard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundOperatorsRule.kt
  84. +2 −0 ...t-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundParensRule.kt
  85. +2 −0 ...ard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundRangeOperatorRule.kt
  86. +100 −0 ...rd/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundSquareBracketsRule.kt
  87. +91 −46 ...-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/StringTemplateIndentRule.kt
  88. +3 −0 ...andard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TrailingCommaOnCallSiteRule.kt
  89. +9 −0 ...src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TrailingCommaOnDeclarationSiteRule.kt
  90. +1 −0 ...tandard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TryCatchFinallySpacingRule.kt
  91. +0 −5 ...t-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TypeArgumentCommentRule.kt
  92. +1 −0 ...andard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TypeArgumentListSpacingRule.kt
  93. +0 −5 ...-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TypeParameterCommentRule.kt
  94. +2 −0 ...ndard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TypeParameterListSpacingRule.kt
  95. +17 −60 ...-standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ValueArgumentCommentRule.kt
  96. +25 −88 ...standard/src/main/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ValueParameterCommentRule.kt
  97. +273 −35 ...ndard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ArgumentListWrappingRuleTest.kt
  98. +347 −0 ...dard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BackingPropertyNamingRuleTest.kt
  99. +34 −0 ...d/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BinaryExpressionWrappingRuleTest.kt
  100. +13 −0 ...src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BlankLineBeforeDeclarationRuleTest.kt
  101. +274 −0 ...src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/BlankLineBetweenWhenConditionsTest.kt
  102. +68 −0 ...rd/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ChainMethodContinuationRuleTest.kt
  103. +27 −1 ...eset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/EnumWrappingRuleTest.kt
  104. +33 −1 ...t-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionLiteralRuleTest.kt
  105. +6 −18 ...standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/FunctionSignatureRuleTest.kt
  106. +212 −0 ktlint-ruleset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/KdocRuleTest.kt
  107. +27 −23 ...eset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/KdocWrappingRuleTest.kt
  108. +19 −3 ...set-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/MaxLineLengthRuleTest.kt
  109. +0 −1 ...leset-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/NoEmptyFileRuleTest.kt
  110. +45 −0 ...dard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ParameterListWrappingRuleTest.kt
  111. +12 −168 ...et-standard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/PropertyNamingRuleTest.kt
  112. +18 −0 ...tandard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundCurlyRuleTest.kt
  113. +128 −0 ...rc/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/SpacingAroundSquareBracketsRuleTest.kt
  114. +122 −46 ...ndard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/StringTemplateIndentRuleTest.kt
  115. +0 −22 ...andard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TypeArgumentCommentRuleTest.kt
  116. +0 −22 ...ndard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/TypeParameterCommentRuleTest.kt
  117. +0 −63 ...ndard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ValueArgumentCommentRuleTest.kt
  118. +6 −37 ...dard/src/test/kotlin/com/pinterest/ktlint/ruleset/standard/rules/ValueParameterCommentRuleTest.kt
  119. +1 −1 settings.gradle.kts
2 changes: 1 addition & 1 deletion .github/actions/setup-gradle-build/action.yml
Original file line number Diff line number Diff line change
@@ -35,6 +35,6 @@ runs:
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties
shell: bash

- uses: gradle/gradle-build-action@v2
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true
2 changes: 1 addition & 1 deletion .github/workflows/generate-changelog.yml
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ jobs:
distribution: 'zulu'
java-version: 21

- uses: gradle/gradle-build-action@v2
- uses: gradle/actions/setup-gradle@v3
with:
gradle-home-cache-cleanup: true

2 changes: 1 addition & 1 deletion .github/workflows/gradle-wrapper-validation.yml
Original file line number Diff line number Diff line change
@@ -8,4 +8,4 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- uses: gradle/wrapper-validation-action@v1
- uses: gradle/wrapper-validation-action@v2
2 changes: 1 addition & 1 deletion .github/workflows/publish-release-build.yml
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ jobs:
- name: Extract release notes
id: release_notes
if: ${{ success() }}
uses: ffurrer2/extract-release-notes@v1
uses: ffurrer2/extract-release-notes@v2

- name: Get version
id: get_version
75 changes: 75 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -2,6 +2,80 @@
All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](https://semver.org/).

## [1.2.0] - 2024-02-28

### 🆕 Features


* Break dependency between string-template-indent and multiline-expression-wrapping - [#2505](https://github.com/pinterest/ktlint/pull/2505), by @paul-dingemans

* Allow string template to exceed max line length when it is the only element on a line - [#2480](https://github.com/pinterest/ktlint/pull/2480), by @paul-dingemans

* Add configuration setting for ignoring `argument-list-wrapping` above treshold of argument - [#2481](https://github.com/pinterest/ktlint/pull/2481), by @paul-dingemans
NOTE: In code style `ktlint_official` this threshold is `unset` so that arguments are always wrapped. If this impacts your code too much, you can make it backward compatible by setting `.editorconfig` property `ktlint_argument_list_wrapping_ignore_when_parameter_count_greater_or_equal_than` to value `8`. For other code styles this property is initialized with value `8` and as of that backward compatible by default.

* Ignore EOL comment that causes max_line_length to be exceeded, except in max-line-length rule - [#2516](https://github.com/pinterest/ktlint/pull/2516), by @paul-dingemans

* Add new rule for disallowing KDoc at non-whitelisted locations - [#2548](https://github.com/pinterest/ktlint/pull/2548), by @paul-dingemans

* Improve insert of suppression - [#2546](https://github.com/pinterest/ktlint/pull/2546), by @paul-dingemans

* Ignore modifier of backing property in `android_studio` code style - [#2552](https://github.com/pinterest/ktlint/pull/2552), by @paul-dingemans

* Add rule to check spacing around square brackets 'square-brackets-spacing' - [#2555](https://github.com/pinterest/ktlint/pull/2555), by @paul-dingemans

* Add rule `blank-line-between-when-conditions` - [#2564](https://github.com/pinterest/ktlint/pull/2564), by @paul-dingemans

### 🔧 Fixes

* Prevent IllegalArgumentException in `argument-list-wrapping` rule - [#2500](https://github.com/pinterest/ktlint/pull/2500), by @paul-dingemans

* Ignore function which is returned as result in a function body - [#2526](https://github.com/pinterest/ktlint/pull/2526), by @paul-dingemans

* Fix false positive newline expected before comment in enum - [#2527](https://github.com/pinterest/ktlint/pull/2527), by @paul-dingemans

* Report violation when parameter list is preceded by a comment - [#2541](https://github.com/pinterest/ktlint/pull/2541), by @paul-dingemans

* Ignore EOL comments in `value-argument-comment` and `value-parameter-comment` - [#2551](https://github.com/pinterest/ktlint/pull/2551), by @paul-dingemans

* Do not indent string template starting at first position of line - [#2553](https://github.com/pinterest/ktlint/pull/2553), by @paul-dingemans

* Prevent conflict when curly closing brace is followed by range (until) operator - [#2554](https://github.com/pinterest/ktlint/pull/2554), by @paul-dingemans

* Run argument-list-wrapping after function-signature - [#2568](https://github.com/pinterest/ktlint/pull/2568), by @paul-dingemans

* Ignore simple reference expressions in `chain-method-continuation` - [#2569](https://github.com/pinterest/ktlint/pull/2569), by @paul-dingemans

### 📦 Dependencies

* chore(deps): update plugin org.gradle.toolchains.foojay-resolver-convention to v0.8.0 - [#2503](https://github.com/pinterest/ktlint/pull/2503), by @renovate[bot]

* fix(deps): update dependency io.github.oshai:kotlin-logging-jvm to v6 - [#2440](https://github.com/pinterest/ktlint/pull/2440), by @renovate[bot]

* Replace gradle/gradle-build-action@v3 with gradle/actions/setup-gradle@v3 - [#2518](https://github.com/pinterest/ktlint/pull/2518), by @paul-dingemans

* chore(deps): update plugin kotlinx-binary-compatibiltiy-validator to v0.14.0 - [#2522](https://github.com/pinterest/ktlint/pull/2522), by @renovate[bot]

* chore(deps): update gradle/wrapper-validation-action action to v2 - [#2523](https://github.com/pinterest/ktlint/pull/2523), by @renovate[bot]

* chore(deps): update ffurrer2/extract-release-notes action to v2 - [#2515](https://github.com/pinterest/ktlint/pull/2515), by @renovate[bot]

* chore(deps): update dependency gradle to v8.6 - [#2531](https://github.com/pinterest/ktlint/pull/2531), by @renovate[bot]

* fix(deps): update dependency org.assertj:assertj-core to v3.25.3 - [#2536](https://github.com/pinterest/ktlint/pull/2536), by @renovate[bot]

* fix(deps): update dependency org.junit.jupiter:junit-jupiter to v5.10.2 - [#2534](https://github.com/pinterest/ktlint/pull/2534), by @renovate[bot]

* fix(deps): update dependency org.slf4j:slf4j-simple to v2.0.12 - [#2538](https://github.com/pinterest/ktlint/pull/2538), by @renovate[bot]

* fix(deps): update dependency org.codehaus.janino:janino to v3.1.12 - [#2559](https://github.com/pinterest/ktlint/pull/2559), by @renovate[bot]

### 💬 Other

* Simplify BOM exclude list - [#2476](https://github.com/pinterest/ktlint/pull/2476), by @Goooler

* 2550 clikt - [#2556](https://github.com/pinterest/ktlint/pull/2556), by @paul-dingemans

## [1.1.1] - 2024-01-08

### 🆕 Features
@@ -2301,6 +2375,7 @@ set in `[*{kt,kts}]` section).

## 0.1.0 - 2016-07-27

[1.1.2]: https://github.com/pinterest/ktlint/compare/1.2.0...1.1.1
[1.1.1]: https://github.com/pinterest/ktlint/compare/1.1.1...1.1.0
[1.1.0]: https://github.com/pinterest/ktlint/compare/1.0.1...1.1.0
[1.0.1]: https://github.com/pinterest/ktlint/compare/1.0.0...1.0.1
2 changes: 1 addition & 1 deletion build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -7,5 +7,5 @@ dependencyResolutionManagement {
}

plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
id("org.gradle.toolchains.foojay-resolver-convention") version "0.8.0"
}
2 changes: 1 addition & 1 deletion build-logic/src/main/kotlin/ktlint-publication.gradle.kts
Original file line number Diff line number Diff line change
@@ -80,7 +80,7 @@ publishing {
}
}

/**
/*
* Following signing parameters must be configured in `$HOME/.gradle/gradle.properties`:
* ```properties
* signing.keyId=12345678
4 changes: 2 additions & 2 deletions documentation/release-latest/docs/install/cli.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ All releases of `ktlint` can be downloaded from the [releases](https://github.co
A particular version of `ktlint` can be downloaded with next command which also changes the file to an executable in directory `/usr/local/bin`:

```sh title="Download"
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
```

!!! tip "Curl not installed or behind proxy"
@@ -209,6 +209,6 @@ Options `--stdin` and `--patterns-from-stdin` are mutually exclusive, only one o

Microsoft Windows is not able to run the `ktlint` command directly. Ktlint can be run in following ways on Microsoft Windows:

1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.1.0). Add the batch file to your `%PATH%` environment variable for easy access
1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.1.1). Add the batch file to your `%PATH%` environment variable for easy access
2. Run `ktlint` using Git Bash
3. Run as `java -jar ktlint`
6 changes: 3 additions & 3 deletions documentation/release-latest/docs/install/integrations.md
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ See [cli usage](../cli) for arguments that can be supplied to `ktlint`.
<dependency>
<groupId>com.pinterest.ktlint</groupId>
<artifactId>ktlint-cli</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
<!-- additional 3rd party ruleset(s) can be specified here -->
</dependencies>
@@ -117,7 +117,7 @@ configurations {
}
dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
@@ -167,7 +167,7 @@ The configuration below, defines following task:
val ktlint by configurations.creating

dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ The configuration settings below are used to configure the behavior of a specifi
| ij_kotlin_packages_to_use_import_on_demand | [no-wildcard-imports](../standard/#no-wildcard-imports) |
| indent_size | [indent](../standard/#indentation) | |
| indent_style | [indent](../standard/#indentation) | |
|
|
| insert_final_newline | [final-newline](../standard/#final-newline) | |
| ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than | [chain-method-continuation](../experimental/#chain-method-continuation) |
| ktlint_class_signature_rule_force_multiline_when_parameter_count_greater_or_equal_than | [class-signature](../experimental/#class-signature) |
15 changes: 7 additions & 8 deletions documentation/release-latest/docs/rules/standard.md
Original file line number Diff line number Diff line change
@@ -2253,14 +2253,14 @@ Disallows comments to be placed at certain locations inside a value argument (li
```

!!! note
In a lot of projects it is an accepted practice to use EOL comments to document the parameter *before* the comma as is shown below:
In Ktlint 1.1.x EOL comments like below are disallowed. This will be reverted in Ktlint 1.2.
```kotlin
fun foo(
bar1: Bar1, // some comment
bar2: Bar2, // some other comment
)
val foo1 =
foo(
bar1: Bar1, // some comment
bar2: Bar2, // some other comment
)
```
Although this code sample might look ok, it is semantically and programmatically unclear on which parameter `some comment` refers. From the developer perspective it might be clear that it belongs to parameter `bar1`. From the parsers perspective, it does belong to parameter `bar2`. This might lead to [unexpected behavior in Intellij IDEA](https://github.com/pinterest/ktlint/issues/2445#issuecomment-1863432022).

Rule id: `value-argument-comment` (`standard` rule set)

@@ -2302,14 +2302,13 @@ Disallows comments to be placed at certain locations inside a value argument (li
```

!!! note
In a lot of projects it is an accepted practice to use EOL comments to document the parameter *before* the comma as is shown below:
In Ktlint 1.1.x EOL comments like below are disallowed. This will be reverted in Ktlint 1.2.
```kotlin
class Foo(
bar1: Bar1, // some comment
bar2: Bar2, // some other comment
)
```
Although this code sample might look ok, it is semantically and programmatically unclear on which parameter `some comment` refers. From the developer perspective it might be clear that it belongs to parameter `bar1`. From the parsers perspective, it does belong to parameter `bar2`. This might lead to [unexpected behavior in Intellij IDEA](https://github.com/pinterest/ktlint/issues/2445#issuecomment-1863432022).

Rule id: `value-parameter-comment` (`standard` rule set)

4 changes: 2 additions & 2 deletions documentation/snapshot/docs/install/cli.md
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@ All releases of `ktlint` can be downloaded from the [releases](https://github.co
A particular version of `ktlint` can be downloaded with next command which also changes the file to an executable in directory `/usr/local/bin`:

```sh title="Download"
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.0/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
curl -sSLO https://github.com/pinterest/ktlint/releases/download/1.1.1/ktlint && chmod a+x ktlint && sudo mv ktlint /usr/local/bin/
```

!!! tip "Curl not installed or behind proxy"
@@ -209,6 +209,6 @@ Options `--stdin` and `--patterns-from-stdin` are mutually exclusive, only one o

Microsoft Windows is not able to run the `ktlint` command directly. Ktlint can be run in following ways on Microsoft Windows:

1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.1.0). Add the batch file to your `%PATH%` environment variable for easy access
1. Use the `ktlint.bat` batch file provided as part of the [release](https://github.com/pinterest/ktlint/releases/tag/1.1.1). Add the batch file to your `%PATH%` environment variable for easy access
2. Run `ktlint` using Git Bash
3. Run as `java -jar ktlint`
6 changes: 3 additions & 3 deletions documentation/snapshot/docs/install/integrations.md
Original file line number Diff line number Diff line change
@@ -56,7 +56,7 @@ See [cli usage](../cli) for arguments that can be supplied to `ktlint`.
<dependency>
<groupId>com.pinterest.ktlint</groupId>
<artifactId>ktlint-cli</artifactId>
<version>1.1.0</version>
<version>1.1.1</version>
</dependency>
<!-- additional 3rd party ruleset(s) can be specified here -->
</dependencies>
@@ -117,7 +117,7 @@ configurations {
}
dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, getObjects().named(Bundling, Bundling.EXTERNAL))
}
@@ -167,7 +167,7 @@ The configuration below, defines following task:
val ktlint by configurations.creating

dependencies {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.0") {
ktlint("com.pinterest.ktlint:ktlint-cli:1.1.1") {
attributes {
attribute(Bundling.BUNDLING_ATTRIBUTE, objects.named(Bundling.EXTERNAL))
}
Loading