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

Fixing DiktatRuleSet crashes when there are no package and no imports #464

Merged
merged 5 commits into from
Oct 31, 2020

Conversation

petertrr
Copy link
Member

@petertrr petertrr commented Oct 29, 2020

What's done:

  • Fixed logic in rules
  • Added tests
  • Added way to disable several rules in smoke test
  • FileStructureRule works when package and/or imports are missing

### What's done:
* Fixed logic in rules
* Added tests
* Added way to disable several rules in smoke test
@codecov
Copy link

codecov bot commented Oct 29, 2020

Codecov Report

Merging #464 into master will decrease coverage by 0.12%.
The diff coverage is 48.78%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #464      +/-   ##
============================================
- Coverage     81.87%   81.74%   -0.13%     
- Complexity     1478     1499      +21     
============================================
  Files            71       71              
  Lines          3730     3731       +1     
  Branches       1195     1203       +8     
============================================
- Hits           3054     3050       -4     
- Misses          203      209       +6     
+ Partials        473      472       -1     
Flag Coverage Δ Complexity Δ
#unittests 81.74% <48.78%> (-0.13%) 1499.00 <26.00> (+21.00) ⬇️

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

Impacted Files Coverage Δ Complexity Δ
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 82.54% <33.33%> (+0.38%) 0.00 <0.00> (ø)
...fn/diktat/ruleset/rules/files/FileStructureRule.kt 69.09% <48.00%> (-5.44%) 46.00 <18.00> (+14.00) ⬇️
...fn/diktat/ruleset/rules/kdoc/CommentsFormatting.kt 68.42% <53.84%> (-1.21%) 69.00 <8.00> (+5.00) ⬇️
...tlin/org/cqfn/diktat/ruleset/constants/Warnings.kt 98.19% <0.00%> (+0.90%) 10.00% <0.00%> (+1.00%)
...fn/diktat/ruleset/rules/classes/DataClassesRule.kt 86.84% <0.00%> (+2.63%) 26.00% <0.00%> (+1.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 e273989...b5179ee. Read the comment docs.

### What's done:
* Handle cases when package and/or imports are missing in FileStructureRule
### What's done:
* Code style
@petertrr petertrr marked this pull request as ready for review October 30, 2020 12:02
…re-wo-package#267

# Conflicts:
#	diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/smoke/DiktatSmokeTest.kt
Copy link
Member

@orchestr7 orchestr7 left a comment

Choose a reason for hiding this comment

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

lgtm

@orchestr7 orchestr7 merged commit b08f9d8 into master Oct 31, 2020
@petertrr petertrr deleted the bugfix/file-structure-wo-package#267 branch November 2, 2020 06:35
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