-
Notifications
You must be signed in to change notification settings - Fork 506
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1011 from romtsn/fix-import-ordering-editorconfig
Fix import-ordering editorconifg generation
- Loading branch information
Showing
5 changed files
with
54 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
...in/com/pinterest/ktlint/ruleset/standard/importordering/ImportOrderingEditorconfigTest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package com.pinterest.ktlint.ruleset.standard.importordering | ||
|
||
import com.pinterest.ktlint.core.api.EditorConfigProperties | ||
import com.pinterest.ktlint.core.api.FeatureInAlphaState | ||
import com.pinterest.ktlint.ruleset.standard.ImportOrderingRule | ||
import org.assertj.core.api.Assertions.assertThat | ||
import org.junit.Test | ||
|
||
@OptIn(FeatureInAlphaState::class) | ||
class ImportOrderingEditorconfigTest { | ||
|
||
@Test | ||
fun `import ordering gets written correctly to editorconfig`() { | ||
val properties: EditorConfigProperties = emptyMap() | ||
val rule = ImportOrderingRule() | ||
with(rule) { | ||
val raw = properties.writeEditorConfigProperty(ImportOrderingRule.ideaImportsLayoutProperty, false) | ||
assertThat(raw).isEqualTo("*,java.**,javax.**,kotlin.**,^") | ||
} | ||
} | ||
} |