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

override functions excluded from FUNCTION_BOOLEAN_PREFIX #567

Merged
merged 6 commits into from
Dec 2, 2020

Conversation

PhilipDukhov
Copy link
Contributor

We don't need to ask subclasses to rename superclass methods

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.

Thanks for the PR, @PhilipDukhov! Your change seems useful. Could you please fix the CI build (https://github.com/cqfn/diKTat/pull/567/checks?check_run_id=1450878080)?

FUNCTION_BOOLEAN_PREFIX.warnAndFix(configRules, emitWarn, isFixMode, functionName.text, functionName.startOffset, functionName) {
// FixMe: add agressive autofix for this
// We don't need to ask subclasses to rename superclass methods
if (node.treeParent.findChildByType(MODIFIER_LIST)?.findChildByType(OVERRIDE_KEYWORD) == null) {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (node.treeParent.findChildByType(MODIFIER_LIST)?.findChildByType(OVERRIDE_KEYWORD) == null) {
if (node.treeParent.isOverriden()) {

We have a special extension function in org.cqfn.diktat.ruleset.utils.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, it's done
on my local machine I wasn't been able to build current version. have an error Redeclaration: AstNodeUtilsTest when try to run verify task, that's why it took me so many commits🙃 Any idea why this is happening, for the future?

Copy link
Member

Choose a reason for hiding this comment

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

No, I've never encountered redeclaration errors :) FWIW, sometimes clean build (mvn clean install) or invalidating caches in IDEA helps.

@codecov
Copy link

codecov bot commented Dec 1, 2020

Codecov Report

Merging #567 (bc2e712) into master (078b6d7) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #567   +/-   ##
=========================================
  Coverage     80.81%   80.82%           
  Complexity     1712     1712           
=========================================
  Files            87       87           
  Lines          4383     4385    +2     
  Branches       1349     1351    +2     
=========================================
+ Hits           3542     3544    +2     
  Misses          298      298           
  Partials        543      543           
Flag Coverage Δ Complexity Δ
unittests 80.82% <100.00%> (+<0.01%) 0.00 <5.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...kotlin/org/cqfn/diktat/ruleset/rules/EmptyBlock.kt 66.66% <100.00%> (ø) 9.00 <5.00> (-1.00)
.../org/cqfn/diktat/ruleset/rules/IdentifierNaming.kt 83.33% <100.00%> (+0.12%) 78.00 <0.00> (+1.00)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 83.79% <100.00%> (+0.07%) 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 078b6d7...bc2e712. Read the comment docs.

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

@petertrr petertrr merged commit 27b7973 into saveourtool:master Dec 2, 2020
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.

2 participants