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

Bugfix. CommentsRule doesn't detect commented out class declaration #630

Merged
merged 10 commits into from
Dec 14, 2020

Conversation

aktsay6
Copy link
Collaborator

@aktsay6 aktsay6 commented Dec 10, 2020

What's done:

  • Added logic
  • Added tests

This pull request closes #462

### What's done:
 * Added logic
 * Added tests
@aktsay6 aktsay6 added the bug Something isn't working label Dec 10, 2020
@aktsay6 aktsay6 requested review from petertrr and kentr0w December 10, 2020 08:30
@aktsay6 aktsay6 changed the title bugfix/comments-rule-detect-class(#462) Bugfix. CommentsRule doesn't detect commented out class declaration Dec 10, 2020
@aktsay6 aktsay6 marked this pull request as draft December 10, 2020 08:44
### What's done:
 * Fixed bugs
### What's done:
 * Fixed bugs
@codecov
Copy link

codecov bot commented Dec 10, 2020

Codecov Report

Merging #630 (10e1804) into master (3efb993) will increase coverage by 0.00%.
The diff coverage is 87.50%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #630   +/-   ##
=========================================
  Coverage     80.82%   80.83%           
- Complexity     1771     1774    +3     
=========================================
  Files            90       90           
  Lines          4663     4670    +7     
  Branches       1407     1408    +1     
=========================================
+ Hits           3769     3775    +6     
  Misses          317      317           
- Partials        577      578    +1     
Flag Coverage Δ Complexity Δ
unittests 80.83% <87.50%> (+<0.01%) 0.00 <2.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...cqfn/diktat/ruleset/rules/comments/CommentsRule.kt 96.42% <87.50%> (-1.54%) 22.00 <2.00> (+3.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 3efb993...10e1804. Read the comment docs.

### What's done:
 * Fixed bugs
@aktsay6 aktsay6 marked this pull request as ready for review December 10, 2020 09:51
companion object {
private val importKeyword = KtTokens.IMPORT_KEYWORD.value
private val packageKeyword = KtTokens.PACKAGE_KEYWORD.value
private val importOrPackage = """($importKeyword|$packageKeyword) """.toRegex()
private val classRegex =
"""^\s*(public|private|open|internal|protected)*\s*(class|object)\s+(\w+)(\(.*\))*(\s*:\s*\w+(\(.*\))*)?\s*\{*$""".toRegex()
Copy link
Member

Choose a reason for hiding this comment

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

oh my.

@aktsay6 aktsay6 requested a review from petertrr December 11, 2020 13:21
@aktsay6 aktsay6 merged commit 4edbd78 into master Dec 14, 2020
@aktsay6 aktsay6 deleted the bugfix/comments-rule-doesnt-detect-class(#462) branch December 14, 2020 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[false-negative] CommentsRule doesn't detect commented out class declaration
2 participants