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

Support setting config file via system property #682

Merged
merged 6 commits into from
Jan 5, 2021

Conversation

petertrr
Copy link
Member

What's done:

  • Added support in DiktatRuleSetProvider
  • Added support in diktat-gradle-plugin
  • Added example with gradle multimodule project
  • Added new functional test

This pull request closes #672

### What's done:
* Added support in DiktatRuleSetProvider
* Added support in diktat-gradle-plugin
* Added example with gradle multimodule project
* Added new functional test
@codecov
Copy link

codecov bot commented Dec 31, 2020

Codecov Report

Merging #682 (c330987) into master (62c5a01) will decrease coverage by 0.04%.
The diff coverage is 81.57%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master     #682      +/-   ##
============================================
- Coverage     79.94%   79.90%   -0.05%     
- Complexity     1835     1839       +4     
============================================
  Files            87       87              
  Lines          4778     4801      +23     
  Branches       1544     1549       +5     
============================================
+ Hits           3820     3836      +16     
- Misses          239      241       +2     
- Partials        719      724       +5     
Flag Coverage Δ Complexity Δ
unittests 79.90% <81.57%> (-0.05%) 0.00 <5.00> (ø)

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

Impacted Files Coverage Δ Complexity Δ
...qfn/diktat/plugin/gradle/DiktatJavaExecTaskBase.kt 91.22% <80.00%> (-2.53%) 17.00 <2.00> (+2.00) ⬇️
...cqfn/diktat/ruleset/rules/DiktatRuleSetProvider.kt 93.06% <81.48%> (-4.64%) 11.00 <3.00> (+2.00) ⬇️
...n/org/cqfn/diktat/plugin/gradle/DiktatExtension.kt 100.00% <100.00%> (ø) 6.00 <0.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 62c5a01...c330987. Read the comment docs.

### What's done:
* Updated example
* Code style
### What's done:
* Code style
### What's done:
* Refactoring
### What's done:
* Refactoring
Comment on lines +165 to 166
val closestMatch = Warnings.names.minByOrNull { Levenshtein.distance(it, config.name) }
"Warning name <${config.name}> in configuration file is invalid, did you mean <$closestMatch>?"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Does it happen in case if config is empty? If so do we need this warning message?

Copy link
Member Author

Choose a reason for hiding this comment

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

Config can't be empty, at the very least we will use config included in the jar.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh you used minByOrNull because minBy is deprecated

Copy link
Collaborator

@aktsay6 aktsay6 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 c852602 into master Jan 5, 2021
@petertrr petertrr deleted the feature/config-system-property#672 branch January 5, 2021 20:34
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.

Use system property (-D) as an alternative way to specify diktat config path
2 participants