saveourtool/diktat
GitHub で見る`FILE_UNORDERED_IMPORTS` error message doesn't match the style guide
Open
#1,933 opened on 2024年6月19日
buggood first issue
Repository metrics
- Stars
- (571 stars)
- PR merge metrics
- (PR metrics pending)
説明
Describe the bug
When there is a violation on imports, the error message doesn't match Diktat style guide. The message says:
[FILE_UNORDERED_IMPORTS] imports should be ordered alphabetically and shouldn't be separated by newlines: import [...] (diktat-ruleset:file-structure)
while the corresponding style rule says:
From top to bottom, the order is the following:
- Android
- Imports of packages used internally in your organization
- Imports from other non-core dependencies
- Java core packages
- kotlin stdlib
Each category should be alphabetically arranged. Each group should be separated by a blank line.
In fact, running gradle diktatFix formats the code according to the convention above.
Expected behavior
The error message should match the style guide
Steps to Reproduce
- shuffle import declarations or remove blank lines between groups
- run
gradle diktatCheck
Environment information
- diktat version: 2.0.0
- build tool (maven/gradle): gradle
- how is diktat run (CLI, plugin, etc.): plugin
- kotlin version: 1.9.24
- operating system: MacOS