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

Custom label #715

Merged
merged 6 commits into from
Jan 20, 2021
Merged

Custom label #715

merged 6 commits into from
Jan 20, 2021

Conversation

kentr0w
Copy link
Collaborator

@kentr0w kentr0w commented Jan 19, 2021

What's done:

Implemented rule, added tests and documentation.

Actions checklist

### What's done:
   Implemented rule, added tests and documentation.
@kentr0w kentr0w added the enhancement New feature or request label Jan 19, 2021
@kentr0w kentr0w requested review from petertrr and aktsay6 January 19, 2021 12:10
### What's done:
   Fixed according our code-style
@codecov
Copy link

codecov bot commented Jan 19, 2021

Codecov Report

Merging #715 (5d34060) into master (9eefb12) will increase coverage by 0.04%.
The diff coverage is 94.44%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #715      +/-   ##
============================================
+ Coverage     80.13%   80.17%   +0.04%     
- Complexity     1895     1901       +6     
============================================
  Files            90       91       +1     
  Lines          4912     4927      +15     
  Branches       1575     1579       +4     
============================================
+ Hits           3936     3950      +14     
  Misses          238      238              
- Partials        738      739       +1     
Flag Coverage Δ Complexity Δ
unittests 80.17% <94.44%> (+0.04%) 0.00 <10.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> (ø)
...otlin/org/cqfn/diktat/ruleset/rules/CustomLabel.kt 91.66% <91.66%> (ø) 10.00 <10.00> (?)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 97.74% <100.00%> (+0.01%) 11.00 <0.00> (ø)
.../cqfn/diktat/ruleset/rules/BlockStructureBraces.kt 79.64% <100.00%> (ø) 52.00 <0.00> (-2.00)
.../ruleset/rules/BracesInConditionalsAndLoopsRule.kt 78.57% <100.00%> (ø) 27.00 <0.00> (-2.00)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 93.33% <100.00%> (+0.06%) 11.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstConstants.kt 100.00% <100.00%> (ø) 0.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 81.32% <100.00%> (ø) 0.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 9eefb12...5d34060. Read the comment docs.

### What's done:
   Fixed according our code-style
info/guide/guide-chapter-5.md Show resolved Hide resolved
info/guide/guide-chapter-5.md Show resolved Hide resolved
emitWarn = emit
isFixMode = autoCorrect

if (node.elementType == LABEL_QUALIFIER && node.text !in labels) {
Copy link
Member

Choose a reason for hiding this comment

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

Does AST allow to distinguish label declaration and label usage?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No , in AST they look same, that why I check stopWords near them

### What's done:
   Fixed after review
### What's done:
   Fixed according our code-style
@kentr0w kentr0w merged commit 6b0b9d2 into master Jan 20, 2021
@kentr0w kentr0w deleted the feature/no-custom-labels branch January 20, 2021 18:32
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.

Describe and implement rules on labels usage
2 participants