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

Fix NPE in KdocFormatting rule #876

Merged
merged 4 commits into from
May 11, 2021
Merged

Fix NPE in KdocFormatting rule #876

merged 4 commits into from
May 11, 2021

Conversation

petertrr
Copy link
Member

@petertrr petertrr commented May 11, 2021

What's done:

  • Updated logic
  • Added tests

We were treating any blank line in KDoc tag's body as an error and were trying to remove it, while empty lines between tag's lines are valid.

TODO:

  • example with trailing blank line in tag's body

This pull request closes #868

### What's done:
* Updated logic
* Added tests
@petertrr petertrr marked this pull request as draft May 11, 2021 10:06
### What's done:
* Updated logic
* Added tests
### What's done:
* Updated logic
* Added tests
@petertrr petertrr added this to the 0.5.3 milestone May 11, 2021
@codecov
Copy link

codecov bot commented May 11, 2021

Codecov Report

Merging #876 (cf75a65) into master (a2f4056) will decrease coverage by 0.08%.
The diff coverage is 60.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #876      +/-   ##
============================================
- Coverage     83.61%   83.53%   -0.09%     
- Complexity     2208     2210       +2     
============================================
  Files           101      101              
  Lines          5669     5677       +8     
  Branches       1614     1620       +6     
============================================
+ Hits           4740     4742       +2     
  Misses          256      256              
- Partials        673      679       +6     
Flag Coverage Δ Complexity Δ
unittests 83.53% <60.00%> (-0.09%) 2210.00 <4.00> (+2.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/utils/KdocUtils.kt 20.83% <20.00%> (-0.22%) 0.00 <0.00> (ø)
...tlin/org/cqfn/diktat/ruleset/utils/AstNodeUtils.kt 84.77% <60.00%> (-0.53%) 0.00 <0.00> (ø)
...ktat/ruleset/rules/chapter2/kdoc/KdocFormatting.kt 83.90% <63.63%> (-0.93%) 89.00 <4.00> (ø)
...n/diktat/ruleset/rules/chapter3/MagicNumberRule.kt 86.04% <100.00%> (+0.68%) 27.00 <0.00> (+1.00)
.../ruleset/rules/chapter2/kdoc/CommentsFormatting.kt 71.81% <0.00%> (+0.67%) 77.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 8fa1ece...cf75a65. Read the comment docs.

@petertrr petertrr marked this pull request as ready for review May 11, 2021 13:32
Copy link
Collaborator

@kentr0w kentr0w 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 6de6a62 into master May 11, 2021
@petertrr petertrr deleted the bugfix/npe-in-kdoc#868 branch May 11, 2021 15:10
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.

Kdoc-formatting failure
2 participants