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

ClassOrdering rule prints incorrect message #7407

Open
spaceracoon opened this issue Jun 26, 2024 · 0 comments
Open

ClassOrdering rule prints incorrect message #7407

spaceracoon opened this issue Jun 26, 2024 · 0 comments

Comments

@spaceracoon
Copy link

Expected Behavior

Observed Behavior

Steps to Reproduce

Example class that can triggers this behavior

class ExampleClass {

    var var1 = 1

    fun bar() {

    }

    var var2 = 2

    init {
    }

    companion object {
    }
}

Context

Sometimes ClassOrdering Rule print you incorrect messages. For example in code above it types "ClassOrdering: method bar() should be declared before companion object." despite bar() already declared before companion object. The correct error here is "method bar() should be declared after property declarations and initializer blocks"

Your Environment

  • Version of detekt used: 1.23.6
  • Version of Gradle used (if applicable):
  • Gradle scan link (add --scan option when running the gradle task):
  • Operating System and version:
  • Link to your project (if it's a public repository):
@spaceracoon spaceracoon changed the title ClassOrdering rule print incorrect message ClassOrdering rule prints incorrect message Jun 26, 2024
@3flex 3flex added the rules label Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants