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

Add unit tests for mis-indented expression body functions #1363

Conversation

0x6675636b796f75676974687562
Copy link
Member

What's done:

@codecov
Copy link

codecov bot commented Jun 15, 2022

Codecov Report

Merging #1363 (e3aef73) into master (b3d32e2) will increase coverage by 0.08%.
The diff coverage is 81.60%.

@@             Coverage Diff              @@
##             master    #1363      +/-   ##
============================================
+ Coverage     83.59%   83.68%   +0.08%     
- Complexity     2567     2588      +21     
============================================
  Files           106      106              
  Lines          7291     7386      +95     
  Branches       2018     2048      +30     
============================================
+ Hits           6095     6181      +86     
  Misses          353      353              
- Partials        843      852       +9     
Flag Coverage Δ
unittests 83.68% <81.60%> (+0.08%) ⬆️

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

Impacted Files Coverage Δ
...leset/rules/chapter2/comments/HeaderCommentRule.kt 86.61% <25.00%> (-1.29%) ⬇️
...ruleset/rules/chapter3/CollapseIfStatementsRule.kt 85.84% <25.00%> (-1.77%) ⬇️
.../ruleset/rules/chapter3/files/FileStructureRule.kt 83.76% <33.33%> (-0.36%) ⬇️
...fn/diktat/ruleset/rules/chapter4/NullChecksRule.kt 83.21% <33.33%> (-1.00%) ⬇️
...ruleset/rules/chapter3/StringTemplateFormatRule.kt 87.27% <75.00%> (+0.73%) ⬆️
...uleset/rules/chapter6/classes/InlineClassesRule.kt 80.00% <75.00%> (+2.58%) ⬆️
...iktat/ruleset/rules/chapter3/files/NewlinesRule.kt 81.08% <85.71%> (+0.72%) ⬆️
.../cqfn/diktat/ruleset/utils/indentation/Checkers.kt 79.48% <87.50%> (+3.59%) ⬆️
...tat/ruleset/rules/chapter3/files/WhiteSpaceRule.kt 82.74% <90.00%> (+0.54%) ⬆️
.../ruleset/rules/chapter2/kdoc/CommentsFormatting.kt 74.09% <100.00%> (+0.40%) ⬆️
... and 9 more

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 3dcd13e...e3aef73. Read the comment docs.

*/
private fun readFile(fileName: String): List<String> {
var list: List<String> = ArrayList()
private fun readFile(file: Path): List<String> =
Copy link
Member

Choose a reason for hiding this comment

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

maybe move to companion as in another class?

Copy link
Member Author

Choose a reason for hiding this comment

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

Thanks for the heads-up. Addressed with 80a9e3f.

@0x6675636b796f75676974687562 0x6675636b796f75676974687562 force-pushed the feature/andrey.shcheglov/indentation-unit-tests branch from 0a16f9c to 80a9e3f Compare June 15, 2022 14:54
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 added the tests Improve testing label Jun 15, 2022
### What's done:

 * Added unit tests for mis-indented expression body functions.
 * See #1330.
…o the user

### What's done:

 * `columnWidth` increased from 80 to `Int.MAX_VALUE`, so deltas will no longer have any inline `<br/>`
### What's done:

 * `readFile()` moved to a companion object
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 force-pushed the feature/andrey.shcheglov/indentation-unit-tests branch from 80a9e3f to e3aef73 Compare June 15, 2022 15:30
@0x6675636b796f75676974687562 0x6675636b796f75676974687562 deleted the feature/andrey.shcheglov/indentation-unit-tests branch June 15, 2022 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Improve testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

False positives: incorrectly indented expression body functions with WRONG_INDENTATION inspection
3 participants