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
We're being required to replace a range created with .. with a non-equal range.
Expected behavior
Range replacements should be equal.
Observed behavior
They are not.
Steps to Reproduce
Write code like 0..(string.length - 2)) and see that it's corrected to 0 until (string.length)). Here's a demonstration of the difference:
funmain(args:Array<String>) {
val string ="abc123"println(string.substring(0..(string.length -2))) // prints abc12println(string.substring(0 until (string.length))) // prints abc123
}
Environment information
diktat version: 1.0.3 (and cannot upgrade easily due to conflicts between Spotless/Ktlint/DiKTat)
build tool (maven/gradle): gradle
how is diktat run (CLI, plugin, etc.): spotless
kotlin version: 1.6.21
operating system: Mac
link to a project (if your project is public):
The text was updated successfully, but these errors were encountered:
Hi @andrewparmet! Thanks for your report. While the behavior you have described is definitely a bug, could you please also describe a bit more about why it's not easy to upgrade diktat? Starting with spotless-gradle-plugin 6.8.0 minimal supported version of diktat is 1.2.1 because of some breaking changes in the ktlint framework. Do you face problems related to this?
Probably - I was getting NoClassDefFoundErrors related to some internal ktlint config classes. I was trying a blind upgrade to see if the rule had been fixed in the latest version, but it doesn't look like it's been touched since it was written.
Describe the bug
We're being required to replace a range created with
..
with a non-equal range.Expected behavior
Range replacements should be equal.
Observed behavior
They are not.
Steps to Reproduce
Write code like
0..(string.length - 2))
and see that it's corrected to0 until (string.length))
. Here's a demonstration of the difference:Environment information
The text was updated successfully, but these errors were encountered: