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

Rule 3.14.2 string template format #305

Merged
merged 8 commits into from
Sep 24, 2020

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Sep 18, 2020

What's done:

  • Added rule logic
  • Added warn and fix test

Actions checklist

  • Implemented Rule, added Warnings
  • Added tests on checks
  • Added tests on fixers
  • Updated diktat-analysis.yml
  • Updated available-rules.md

Closes #301

### What's done:
 * Added rule logic
 * Added warn and fix test
@aktsay6 aktsay6 added the enhancement New feature or request label Sep 18, 2020
@codecov
Copy link

codecov bot commented Sep 18, 2020

Codecov Report

Merging #305 into master will increase coverage by 0.13%.
The diff coverage is 93.54%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #305      +/-   ##
============================================
+ Coverage     82.23%   82.36%   +0.13%     
- Complexity      990      999       +9     
============================================
  Files            50       51       +1     
  Lines          2544     2575      +31     
  Branches        803      808       +5     
============================================
+ Hits           2092     2121      +29     
  Misses          169      169              
- Partials        283      285       +2     
Flag Coverage Δ Complexity Δ
#unittests 82.36% <93.54%> (+0.13%) 999.00 <9.00> (+9.00)

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

Impacted Files Coverage Δ Complexity Δ
...at-rules/src/main/kotlin/generated/WarningNames.kt 0.00% <ø> (ø) 0.00 <0.00> (ø)
...n/diktat/ruleset/rules/StringTemplateFormatRule.kt 92.85% <92.85%> (ø) 9.00 <9.00> (?)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 96.55% <100.00%> (+0.08%) 8.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 97.61% <100.00%> (+0.05%) 3.00 <0.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 d078abc...ffe2197. Read the comment docs.

### What's done:
 * Fixed bugs
typeReferenceLength: '25' # max length of type reference
- name: REDUNDANT_CURLY_BRACES
Copy link
Member

Choose a reason for hiding this comment

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

add description
change names: STRING_TEMPLATE_CURLY_BRACES
STRING_TEMPLATE_QUOTES

Comment on lines 34 to 36
}

if (node.elementType == SHORT_STRING_TEMPLATE_ENTRY) {
Copy link
Member

Choose a reason for hiding this comment

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

Please add comment about why these two ifs cannot be combined in if-else

@aktsay6 aktsay6 requested a review from petertrr September 24, 2020 15:23
Copy link
Member

@petertrr petertrr left a comment

Choose a reason for hiding this comment

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

LGTM

@aktsay6 aktsay6 merged commit 5b33011 into master Sep 24, 2020
@petertrr petertrr deleted the feature/rule-3.14.2-string-template-format branch September 30, 2020 08:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rule 3.14.2: String template format
3 participants