Skip to content
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

Merged
merged 3 commits into from
Jan 17, 2022
Merged

Conversation

Cheshiriks
Copy link
Member

What's done:

### What's done:
* Support 'value' keyword from Kotlin 1.6
Closes #1170
@Cheshiriks Cheshiriks requested a review from orchestr7 January 14, 2022 13:05
@@ -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"),
Copy link
Member

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

Copy link
Member

@orchestr7 orchestr7 Jan 14, 2022

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?

Copy link
Member

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
Copy link
Member

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

Copy link
Member

@orchestr7 orchestr7 Jan 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed all

@orchestr7 orchestr7 changed the title Support 'value' keyword from Kotlin 1.6 Support 'value' keyword from Kotlin 1.5 Jan 14, 2022
### What's done:
* Support 'value' keyword from Kotlin 1.6
Closes #1170
@codecov
Copy link

codecov bot commented Jan 14, 2022

Codecov Report

Merging #1171 (bb63cee) into master (86169b4) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            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           
Flag Coverage Δ
unittests 84.74% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...uleset/rules/chapter3/MultipleModifiersSequence.kt 98.18% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 86169b4...bb63cee. Read the comment docs.

@@ -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"),
Copy link
Member

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
@petertrr petertrr merged commit 961da9e into master Jan 17, 2022
@petertrr petertrr deleted the bugfix/value-identifier branch January 17, 2022 10:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support 'value' keyword from Kotlin 1.5
3 participants