Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rule to migrate away from ktlint-disable directives #2068

Merged
merged 28 commits into from
Jun 27, 2023

Commits on Jun 5, 2023

  1. Configuration menu
    Copy the full SHA
    437a428 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5031bad View commit details
    Browse the repository at this point in the history
  3. Improve trace logging by printing a lint error directly when it is em…

    …itted
    
    The reports print the lint violations in which they occur in the source code. This is not necessarily the order in which they are detected and fixed. For debugging some type of problems, the latter order is important.
    paul-dingemans committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    675b708 View commit details
    Browse the repository at this point in the history
  4. Add rule to migrate ktlint-disable directives from comments to @Suppress

     or @SuppressWarnings annotations
    
    Note that the SuppressionLocatorBuilder never ignore this rule as otherwise the suppression hint to ignore *all* rules would also ignore the rule which has to migrate this suppression hint.
    
    Closes #1947
    paul-dingemans committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    428d52e View commit details
    Browse the repository at this point in the history
  5. Fix lint violations

    paul-dingemans committed Jun 5, 2023
    Configuration menu
    Copy the full SHA
    e2422c8 View commit details
    Browse the repository at this point in the history

Commits on Jun 6, 2023

  1. Configuration menu
    Copy the full SHA
    fea7170 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    a973293 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    b84d8a8 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a40c27e View commit details
    Browse the repository at this point in the history
  5. Fix lint violations

    paul-dingemans committed Jun 6, 2023
    Configuration menu
    Copy the full SHA
    11861fe View commit details
    Browse the repository at this point in the history

Commits on Jun 8, 2023

  1. - Fix rule suppressions on a class initializer

    - Merge rule suppressions that propagate to the same declaration annotation
    paul-dingemans committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    ec099d5 View commit details
    Browse the repository at this point in the history
  2. fix lint violation

    paul-dingemans committed Jun 8, 2023
    Configuration menu
    Copy the full SHA
    ad9ac65 View commit details
    Browse the repository at this point in the history

Commits on Jun 10, 2023

  1. - Convert a top level block comment with a ktlint-disable directive t…

    …o a file annotation. This also applies to directives which are placed as last comment before a top level class, fun or property (the kotlin embeddable compiler places such comments inside the ASTNode of the class, fun, property respectively.
    
    - Convert a block comment with a ktlint-disable directive to the first parent declaration or expression whenever a matching ktlint-enable directive is found as sibling inside the same parent node.
    - Do not autocorrect other block comments containing a ktlint-disable directive
    paul-dingemans committed Jun 10, 2023
    Configuration menu
    Copy the full SHA
    51a8b3e View commit details
    Browse the repository at this point in the history

Commits on Jun 13, 2023

  1. - Move KtlintSuppressionRule from standard ruleset to an internal rul…

    …eset. In this way, it can be guaranteed that the rule runs for all API consumers, even the consumers that do not pass the standard rule providers
    
    - Do not process the ktlint-directives in the SuppressionLocatorBuilder, MaxLineLengthRule, NoSingleLineBlockCommentRule anymore
    - Fix offset problem with suppression annotation (see unit test MaxLineLengthRuleTest)
    - Fix problems in unit tests that referred to ktlint-directives which are no longer processed
    - Add "libs.logback" as runtime only dependency so that logging is visible in unit tests
    - Move checking of unknown rule ids from SuppressionLocatorBuilder to KtlintSuppressionRule so that normal lint violations are emitted instead of log message being printed.
    paul-dingemans committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    4b0b4e8 View commit details
    Browse the repository at this point in the history
  2. fix lint violation

    paul-dingemans committed Jun 13, 2023
    Configuration menu
    Copy the full SHA
    05bdaa2 View commit details
    Browse the repository at this point in the history

Commits on Jun 23, 2023

  1. Fix typo

    paul-dingemans committed Jun 23, 2023
    Configuration menu
    Copy the full SHA
    7fa8d3f View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5094565 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    a165c3a View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    be43f54 View commit details
    Browse the repository at this point in the history

Commits on Jun 24, 2023

  1. Configuration menu
    Copy the full SHA
    cb8e15c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    d87ec58 View commit details
    Browse the repository at this point in the history
  3. Promote a matching pair of ktlint-disable and ktlint-enable directive…

    …s to the parent declaration in case the block contains multiple declarations or statements
    paul-dingemans committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    e091cbc View commit details
    Browse the repository at this point in the history
  4. Merge new ktlint rule suppression with existing suppression using a n…

    …amed argument
    
    The named argument is replaced with the vararg notation in which the existing and new suppressions are merged
    paul-dingemans committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    1e2ffb9 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    681d8ec View commit details
    Browse the repository at this point in the history
  6. Ensure that ktlint-suppression runs before any other rule

    ktlint-disable directives have to be replaced with annotations before process other rules because the SuppressionLocatorBuilder is no longer processing those directives.
    paul-dingemans committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    76af1d1 View commit details
    Browse the repository at this point in the history
  7. Fix lint violation

    paul-dingemans committed Jun 24, 2023
    Configuration menu
    Copy the full SHA
    73e3d4e View commit details
    Browse the repository at this point in the history

Commits on Jun 25, 2023

  1. Merge remote-tracking branch 'origin/master' into 1947-ktlint-disable

    # Conflicts:
    #	CHANGELOG.md
    #	ktlint-rule-engine/src/main/kotlin/com/pinterest/ktlint/rule/engine/api/KtLintRuleEngine.kt
    paul-dingemans committed Jun 25, 2023
    Configuration menu
    Copy the full SHA
    4d5b734 View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2023

  1. Configuration menu
    Copy the full SHA
    37b6f3c View commit details
    Browse the repository at this point in the history