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: Suppress COMPLEX_EXPRESSION in .gradle.kts #1193

Merged
merged 2 commits into from
Jan 31, 2022

Conversation

petertrr
Copy link
Member

@petertrr petertrr commented Jan 27, 2022

What's done:

  • Fixes
  • Minor refactoring
  • Tests

This pull request closes #1148

### What's done:
* Fixes
* Tests
@codecov
Copy link

codecov bot commented Jan 27, 2022

Codecov Report

Merging #1193 (425665a) into master (297417a) will increase coverage by 0.01%.
The diff coverage is 85.71%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #1193      +/-   ##
============================================
+ Coverage     84.54%   84.55%   +0.01%     
- Complexity     2524     2526       +2     
============================================
  Files           103      103              
  Lines          7077     7082       +5     
  Branches       1913     1914       +1     
============================================
+ Hits           5983     5988       +5     
  Misses          306      306              
  Partials        788      788              
Flag Coverage Δ
unittests 84.55% <85.71%> (+0.01%) ⬆️

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

Impacted Files Coverage Δ
...iktat/ruleset/rules/chapter3/files/NewlinesRule.kt 80.95% <85.71%> (+0.28%) ⬆️

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 297417a...425665a. Read the comment docs.

@@ -216,6 +218,14 @@ class NewlinesRule(configRules: List<RulesConfig>) : DiktatRule(
}
}

private fun checkForComplexExpression(node: ASTNode) {
if (node.getRootNode().getFilePath().isGradleScript()) {
Copy link
Member

Choose a reason for hiding this comment

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

Where this method isGradle comes from? Is it our extension?
May be one day we can move this logic to Rule class, so it will skip some rules for some groups of patterns.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it's from one of our utils files.

@petertrr petertrr enabled auto-merge (squash) January 31, 2022 08:01
@petertrr petertrr merged commit d140a2e into master Jan 31, 2022
@petertrr petertrr deleted the bugfix/complex-expression-kts#1148 branch January 31, 2022 08:16
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.

COMPLEX_EXPRESSION can be softened for gradle scripts
2 participants