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

Rule: ModifierOrder #239

Merged
merged 5 commits into from
Jul 27, 2017
Merged

Rule: ModifierOrder #239

merged 5 commits into from
Jul 27, 2017

Conversation

Mauin
Copy link
Collaborator

@Mauin Mauin commented Jul 23, 2017

Copy link
Member

@arturbosch arturbosch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a test case where you run the rule against a real file (in resources) with no problems. 👍

given("a kt parameter with wrongly ordered modifiers") {
val code = "lateinit internal private val test: String"

it("should report the package statement and import statements by default") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is a mistake?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh.. Good catch. Copy pasted the MaxLineLengthSpec and forgot to change the description 🙃

given("a kt parameter with correctly ordered modifiers") {
val code = "private internal lateinit val test: String"

it("should report the package statement and import statements by default") {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too?

@Mauin
Copy link
Collaborator Author

Mauin commented Jul 25, 2017

Updated the tests and included a Test class for the Modifier order. It felt wrong writing that class with the modifiers all over the place... 😐

it("should not report modifiers") {
val rule = ModifierOrder()

val findings = rule.lint(file.text)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just give Case.Default.path to lint or you compile two times the file :)

}

given("a kt file with correctly ordered modifiers") {
val file = compileForTest(Case.ModifierOrder.path())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too

@arturbosch arturbosch merged commit 27b639c into detekt:master Jul 27, 2017
@arturbosch arturbosch modified the milestone: RC1 Jul 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants