-
Notifications
You must be signed in to change notification settings - Fork 39
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
Support 'value' keyword from Kotlin 1.5 #1171
Conversation
### What's done: * Support 'value' keyword from Kotlin 1.6 Closes #1170
@@ -129,7 +129,7 @@ enum class Warnings( | |||
LONG_NUMERICAL_VALUES_SEPARATED(true, "3.14.2", "long numerical values should be separated with underscore"), | |||
MAGIC_NUMBER(false, "3.14.3", "avoid using magic numbers, instead define constants with clear names describing what the magic number means"), | |||
WRONG_DECLARATIONS_ORDER(true, "3.1.4", "declarations of constants and enum members should be sorted alphabetically"), | |||
WRONG_MULTIPLE_MODIFIERS_ORDER(true, "3.14.1", "sequence of modifier-keywords is incorrect"), | |||
WRONG_MULTIPLE_MODIFIERS_ORDER(true, "3.14.1", "sequence of modifier-keywords is incorrect. Value identifier supported in Kotlin 1.6"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think it should be in a warning text. We have access to version set in diktat-analysis.yaml
and can do some logic in the rule itself
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is what I have asked. I need some mentions/tags of Kotlin 1.5 features to aggregate them. Any ideas?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can use different list of keywords based on version from config. To aggregate we could add a marker annotation like @MinimalLanguageVersion
for rules that are only used starting with a particular version or @OptionalLanguageVersion
for rules that have part of their functionality available starting from a particular version (like this one).
@@ -890,7 +891,7 @@ inner | |||
out | |||
enum / annotation | |||
companion | |||
inline / noinline | |||
value / inline / noinline |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not from 1.6, we don't even support 1.6 in diktat now. Please check if it appeared in 1.4 or 1.5
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1.5
Kotlin/KEEP#237
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed all
### What's done: * Support 'value' keyword from Kotlin 1.6 Closes #1170
Codecov Report
@@ Coverage Diff @@
## master #1171 +/- ##
=========================================
Coverage 84.74% 84.74%
Complexity 2498 2498
=========================================
Files 102 102
Lines 6990 6990
Branches 1881 1881
=========================================
Hits 5924 5924
Misses 302 302
Partials 764 764
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@@ -129,7 +129,7 @@ enum class Warnings( | |||
LONG_NUMERICAL_VALUES_SEPARATED(true, "3.14.2", "long numerical values should be separated with underscore"), | |||
MAGIC_NUMBER(false, "3.14.3", "avoid using magic numbers, instead define constants with clear names describing what the magic number means"), | |||
WRONG_DECLARATIONS_ORDER(true, "3.1.4", "declarations of constants and enum members should be sorted alphabetically"), | |||
WRONG_MULTIPLE_MODIFIERS_ORDER(true, "3.14.1", "sequence of modifier-keywords is incorrect"), | |||
WRONG_MULTIPLE_MODIFIERS_ORDER(true, "3.14.1", "sequence of modifier-keywords is incorrect. Value identifier supported in Kotlin 1.5"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
available-rules.md
### What's done: * Support 'value' keyword from Kotlin 1.6 Closes #1170
What's done:
Closes Support 'value' keyword from Kotlin 1.5 #1170