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 6.2.2(#447) #501

Merged
merged 12 commits into from
Nov 16, 2020
Merged

Rule 6.2.2(#447) #501

merged 12 commits into from
Nov 16, 2020

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Nov 7, 2020

There should be no extension functions with the same name and signature if they extend base and inheritor classes

This pull request closes #447

Actions checklist

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

Fixme

Should find related classes in all project, not only in file

### What's done:
  * Added rule logic
  * Added warn tests
### What's done:
  * Added rule logic
  * Added warn tests
### What's done:
  * Added rule logic
  * Added warn tests
@aktsay6 aktsay6 added the enhancement New feature or request label Nov 7, 2020
@aktsay6 aktsay6 requested review from petertrr and kentr0w November 7, 2020 08:35
@codecov
Copy link

codecov bot commented Nov 7, 2020

Codecov Report

Merging #501 (948a369) into master (08b2deb) will increase coverage by 0.17%.
The diff coverage is 96.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #501      +/-   ##
============================================
+ Coverage     81.70%   81.87%   +0.17%     
- Complexity     1600     1618      +18     
============================================
  Files            76       77       +1     
  Lines          4034     4083      +49     
  Branches       1282     1290       +8     
============================================
+ Hits           3296     3343      +47     
  Misses          218      218              
- Partials        520      522       +2     
Flag Coverage Δ Complexity Δ
unittests 81.87% <96.00%> (+0.17%) 0.00 <18.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> (ø)
...at/ruleset/rules/ExtensionFunctionsSameNameRule.kt 95.74% <95.74%> (ø) 18.00 <18.00> (?)
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 98.30% <100.00%> (+0.01%) 10.00 <0.00> (ø)
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 97.22% <100.00%> (+0.03%) 8.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 08b2deb...346e1ee. Read the comment docs.

# Conflicts:
#	diktat-analysis.yml
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/constants/Warnings.kt
#	diktat-rules/src/main/resources/diktat-analysis-huawei.yml
#	diktat-rules/src/main/resources/diktat-analysis.yml
#	info/available-rules.md
### What's done:
  * Fixed bugs
@aktsay6 aktsay6 marked this pull request as ready for review November 10, 2020 09:03
/**
* This rule checks if extension functions with the same signature don't have related classes
*/
class ExtensionFunctionsSameNameRule(private val configRules: List<RulesConfig>) : Rule("extension-functions-same-name") {
Copy link
Member

Choose a reason for hiding this comment

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

What if there are more than two matching classes? It should be a rare case, but at least we shouldn't crash when we encounter it and output something reasonable.

@aktsay6 aktsay6 requested a review from petertrr November 10, 2020 13:51
aktsay6 and others added 5 commits November 16, 2020 11:34
# Conflicts:
#	diktat-analysis.yml
#	diktat-rules/src/main/kotlin/generated/WarningNames.kt
#	diktat-rules/src/main/kotlin/org/cqfn/diktat/ruleset/constants/Warnings.kt
#	diktat-rules/src/main/resources/diktat-analysis-huawei.yml
#	diktat-rules/src/main/resources/diktat-analysis.yml
#	info/available-rules.md
### What's done:
  * Merged master in current branch
### What's done:
  * Fixed bugs
@aktsay6 aktsay6 merged commit bb1227a into master Nov 16, 2020
@aktsay6 aktsay6 deleted the feature/rule-6.2.2(#447) branch November 16, 2020 09:36
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
2 participants