You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After I try to run diktatFix of grade-plugin on a simple file (simplified example is in Steps to reproduce section) I get stack trace:
ERROR org.cqfn.diktat.ruleset.rules.DiktatRule - Internal error has occurred in rule [class-like-structures]. Please make an issue on this bug at https://github.com/saveourtool/diKTat/.
As a workaround you can disable these inspections in yml config: <[BLANK_LINE_BETWEEN_PROPERTIES, WRONG_ORDER_IN_CLASS_LIKE_STRUCTURES]>.
Root cause of the problem is in [/Users/sanyavertolet/StudioProjects/iomt-android1/app/src/main/java/com/iomt/android/SignupActivity.kt] file.
java.lang.IndexOutOfBoundsException: Index 7 out of bounds for length 7
at java.base/jdk.internal.util.Preconditions.outOfBounds(Preconditions.java:64)
at java.base/jdk.internal.util.Preconditions.outOfBoundsCheckIndex(Preconditions.java:70)
at java.base/jdk.internal.util.Preconditions.checkIndex(Preconditions.java:266)
at java.base/java.util.Objects.checkIndex(Objects.java:359)
at java.base/java.util.ArrayList.get(ArrayList.java:427)
at org.cqfn.diktat.ruleset.rules.chapter3.ClassLikeStructuresOrderRule.checkAndReorderBlocks(ClassLikeStructuresOrderRule.kt:141)
at org.cqfn.diktat.ruleset.rules.chapter3.ClassLikeStructuresOrderRule.checkDeclarationsOrderInClass(ClassLikeStructuresOrderRule.kt:80)
at org.cqfn.diktat.ruleset.rules.chapter3.ClassLikeStructuresOrderRule.logic(ClassLikeStructuresOrderRule.kt:53)
at org.cqfn.diktat.ruleset.rules.DiktatRule.visit(DiktatRule.kt:52)
at org.cqfn.diktat.ruleset.rules.OrderedRuleSet$Companion$OrderedRule.visit(OrderedRuleSet.kt:80)
at com.pinterest.ktlint.core.KtLint$format$1.invoke(KtLint.kt:251)
at com.pinterest.ktlint.core.KtLint$format$1.invoke(KtLint.kt:244)
at com.pinterest.ktlint.core.internal.VisitorProvider$sequentialVisitor$1$1$1$1.invoke(VisitorProvider.kt:123)
at com.pinterest.ktlint.core.internal.VisitorProvider$sequentialVisitor$1$1$1$1.invoke(VisitorProvider.kt:123)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:236)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:237)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:237)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:237)
at com.pinterest.ktlint.core.ast.PackageKt.visit(package.kt:237)
at com.pinterest.ktlint.core.internal.VisitorProvider$sequentialVisitor$1.invoke(VisitorProvider.kt:123)
at com.pinterest.ktlint.core.internal.VisitorProvider$sequentialVisitor$1.invoke(VisitorProvider.kt:115)
at com.pinterest.ktlint.core.KtLint.format(KtLint.kt:244)
at com.pinterest.ktlint.internal.FileUtilsKt.formatFile(FileUtils.kt:202)
at com.pinterest.ktlint.internal.KtlintCommandLine.process(KtlintCommandLine.kt:355)
at com.pinterest.ktlint.internal.KtlintCommandLine.access$process(KtlintCommandLine.kt:48)
at com.pinterest.ktlint.internal.KtlintCommandLine$lintFiles$3.invoke$lambda-1(KtlintCommandLine.kt:274)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:833)
Expected behavior
Given code should be formatted like that:
classClassName {
companionobject {
privateconstvalEMAIL_ERROR_TEXT="Введите корректно e-mail"privateconstvalLOGIN_ERROR_TEXT="Не менее 2 символов"privateconstvalNAME_ERROR_TEXT="Не менее 2 символов"privateconstvalPATRONYMIC_ERROR_TEXT="Не менее 2 символов"privateconstvalPHONE_NUMBER_ERROR_TEXT="Введите корректно номер телефона"privateconstvalSURNAME_ERROR_TEXT="Не менее 2 символов"privateconstvalTAG="SignupActivity"
}
}
Observed behavior
Stack trace (you can find it above)
Steps to Reproduce
Run diktatFix task of grade-plugin on this code snippet:
classClassName {
companionobject {
privateconstvalTAG="SignupActivity"privateconstvalNAME_ERROR_TEXT="Не менее 2 символов"privateconstvalSURNAME_ERROR_TEXT="Не менее 2 символов"privateconstvalPATRONYMIC_ERROR_TEXT="Не менее 2 символов"privateconstvalLOGIN_ERROR_TEXT="Не менее 2 символов"privateconstvalEMAIL_ERROR_TEXT="Введите корректно e-mail"privateconstvalPHONE_NUMBER_ERROR_TEXT="Введите корректно номер телефона"
}
}
Environment information
diktat version: diktat 1.2.1 with ktlint 0.46.1
build tool (maven/gradle): gradle
how is diktat run (CLI, plugin, etc.): gradle plugin
kotlin version: 1.6.20-M1
operating system: macOS Monterey v.12.3.1
upd: Same issue exists when running diktatCheck
The text was updated successfully, but these errors were encountered:
### What's done:
* `const` properties named `log` or `logger` are no longer treated as loggers.
* `lateinit` properties named `log` or `logger` are no longer treated as
loggers.
* Arbitrary properties containing `log` or `logger` in their names
(e.g.: `loginName` or `LOGIN_NAME`) are no longer treated as loggers.
* A diagnostic check added.
* An IOOBE is no longer thrown.
* Closes#1516.
### What's done:
* `const` properties named `log` or `logger` are no longer treated as loggers.
* `lateinit` properties named `log` or `logger` are no longer treated as
loggers.
* Arbitrary properties containing `log` or `logger` in their names
(e.g.: `loginName` or `LOGIN_NAME`) are no longer treated as loggers.
* A diagnostic check added.
* An IOOBE is no longer thrown.
* Closes#1516.
Describe the bug
After I try to run
diktatFix
of grade-plugin on a simple file (simplified example is inSteps to reproduce
section) I get stack trace:Expected behavior
Given code should be formatted like that:
Observed behavior
Stack trace (you can find it above)
Steps to Reproduce
Run
diktatFix
task ofgrade-plugin
on this code snippet:Environment information
upd: Same issue exists when running
diktatCheck
The text was updated successfully, but these errors were encountered: