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 for fix mode of AVOID_NULL_CHECK #1535

Merged
merged 6 commits into from
Oct 27, 2022

Conversation

sanyavertolet
Copy link
Member

This PR closes #1293

What's done:

  • Added isAssignment utility function to check if a line has assignment operator ('=') using simple regex
  • Added a check for assignment operator when deciding if to put run block or not
  • Added tests

### What's done:
 * Added isAssignment utility function to check if a line has assignment operator ('=') using simple regex
 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
@sanyavertolet sanyavertolet added bug Something isn't working autofix Issues related to diktat in autofix mode labels Oct 26, 2022
@sanyavertolet sanyavertolet self-assigned this Oct 26, 2022
@codecov
Copy link

codecov bot commented Oct 26, 2022

Codecov Report

Merging #1535 (46fe6b3) into master (5ade536) will increase coverage by 0.01%.
The diff coverage is 86.66%.

@@             Coverage Diff              @@
##             master    #1535      +/-   ##
============================================
+ Coverage     83.00%   83.01%   +0.01%     
- Complexity     2362     2363       +1     
============================================
  Files           111      111              
  Lines          7753     7760       +7     
  Branches       2008     2009       +1     
============================================
+ Hits           6435     6442       +7     
  Misses          439      439              
  Partials        879      879              
Flag Coverage Δ
unittests 83.01% <86.66%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...fn/diktat/ruleset/rules/chapter4/NullChecksRule.kt 84.02% <86.66%> (+0.81%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 26, 2022

JUnit Tests (Windows, EnricoMi/publish-unit-test-result-action@v2)

1 938 tests   1 923 ✔️  3m 5s ⏱️
   160 suites       15 💤
   160 files           0

Results for commit 62463ae.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 26, 2022

JUnit Tests (macOS, EnricoMi/publish-unit-test-result-action@v2)

1 923 tests   1 908 ✔️  1m 30s ⏱️
   159 suites       15 💤
   159 files           0

Results for commit 62463ae.

♻️ This comment has been updated with latest results.

### What's done:
 * Added isAssignment utility function to check if a line has assignment operator ('=') using simple regex
 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
### What's done:
 * Added isAssignment utility function to check if a line has assignment operator ('=') using simple regex
 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
### What's done:
 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
### What's done:
 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
@sanyavertolet sanyavertolet enabled auto-merge (squash) October 27, 2022 11:19
@sanyavertolet sanyavertolet merged commit 3beabb0 into master Oct 27, 2022
@sanyavertolet sanyavertolet deleted the bugfix/wrong_fix_in_AVOID_NULL_CHECK branch October 27, 2022 11:29
nulls pushed a commit that referenced this pull request Oct 27, 2022
* Bugfix for fix mode of AVOID_NULL_CHECK

 * Added a check for assignment operator when deciding if to put run block or not
 * Added tests
(#1293)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autofix Issues related to diktat in autofix mode bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug in fix mode in rule AVOID_NULL_CHECK
3 participants