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

Ignore suppressions in rule no-unused-imports #2725

Merged
merged 5 commits into from
Jul 2, 2024

Commits on Jun 25, 2024

  1. Ignore suppressions for no-unused-imports rule

    Imports which are only used in code blocks which are suppressed for ktlint should not be reported as unused as removal results in compilation errors.
    
    Refactored the code so that a rule can be marked with interface `IgnoreKtlintSuppressions` to indicate that all suppression for this rule are to be ignored.
    
    Closes #2696
    paul-dingemans committed Jun 25, 2024
    Configuration menu
    Copy the full SHA
    b0acf4c View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2024

  1. Fix API contracts

    paul-dingemans committed Jun 27, 2024
    Configuration menu
    Copy the full SHA
    9bc2352 View commit details
    Browse the repository at this point in the history

Commits on Jul 2, 2024

  1. Refactor rebuilding suppression locator

    The former SuppressionLocator lambda and object SuppressionLocatorBuilder are now replaced with the class SuppressionLocator. Upon each check whether a ASTNode has to be suppressed, it is also determined whether it is needed to rebuild the suppression hints. This is only needed when the code that is represented by the AST has been changed.
    
    The CodeFormatter no longer has to rebuild the suppression locator after autocorrect. This responsibility is now moved into the RuleExecutionContext and SuppressionLocator itself.
    paul-dingemans committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    9341200 View commit details
    Browse the repository at this point in the history
  2. Refactor rebuilding suppression locator

    The former SuppressionLocator lambda and object SuppressionLocatorBuilder are now replaced with the class SuppressionLocator. Upon each check whether a ASTNode has to be suppressed, it is also determined whether it is needed to rebuild the suppression hints. This is only needed when the code that is represented by the AST has been changed.
    
    The CodeFormatter no longer has to rebuild the suppression locator after autocorrect. This responsibility is now moved into the RuleExecutionContext and SuppressionLocator itself.
    paul-dingemans committed Jul 2, 2024
    Configuration menu
    Copy the full SHA
    747aad7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    bd6efc2 View commit details
    Browse the repository at this point in the history