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

Diktat rule configs #1686

Merged
merged 21 commits into from
Jun 13, 2023
Merged

Diktat rule configs #1686

merged 21 commits into from
Jun 13, 2023

Conversation

nulls
Copy link
Member

@nulls nulls commented Jun 7, 2023

What's done:

  • introduced DiktatRuleConfigReader

It closes #1695

### What's done:
- main runner

It closes #1685
@nulls nulls added this to the 2.0.0 milestone Jun 7, 2023
@nulls nulls self-assigned this Jun 7, 2023
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

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

   162 files  ±0     162 suites  ±0   10m 23s ⏱️ - 1m 35s
1 371 tests ±0  1 335 ✔️ ±0  36 💤 ±0  0 ±0 
2 750 runs  ±0  2 714 ✔️ ±0  36 💤 ±0  0 ±0 

Results for commit 04294d8. ± Comparison against base commit d7d39f0.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
com.saveourtool.diktat.util.DiktatRuleSetProviderTest ‑ check DiktatRuleSetProviderTest contain all rules()
com.saveourtool.diktat.util.DiktatRuleSetFactoryImplTest ‑ check DiktatRuleSetFactoryImpl contain all rules()

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

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

   162 files  ±0     162 suites  ±0   9m 40s ⏱️ - 2m 2s
1 371 tests ±0  1 354 ✔️ ±0  17 💤 ±0  0 ±0 
2 750 runs  ±0  2 733 ✔️ ±0  17 💤 ±0  0 ±0 

Results for commit 04294d8. ± Comparison against base commit d7d39f0.

This pull request removes 1 and adds 1 tests. Note that renamed tests count towards both.
com.saveourtool.diktat.util.DiktatRuleSetProviderTest ‑ check DiktatRuleSetProviderTest contain all rules()
com.saveourtool.diktat.util.DiktatRuleSetFactoryImplTest ‑ check DiktatRuleSetFactoryImpl contain all rules()

♻️ This comment has been updated with latest results.

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #1686 (ec0c24c) into master (4f23c71) will decrease coverage by 0.37%.
The diff coverage is 62.25%.

@@             Coverage Diff              @@
##             master    #1686      +/-   ##
============================================
- Coverage     78.72%   78.35%   -0.37%     
+ Complexity     2317     2312       -5     
============================================
  Files           124      124              
  Lines          8151     8142       -9     
  Branches       2062     2060       -2     
============================================
- Hits           6417     6380      -37     
- Misses          826      858      +32     
+ Partials        908      904       -4     
Impacted Files Coverage Δ
...c/main/kotlin/com/saveourtool/diktat/DiktatMain.kt 0.00% <0.00%> (ø)
...lin/com/saveourtool/diktat/cli/DiktatProperties.kt 0.00% <0.00%> (ø)
.../saveourtool/diktat/plugin/maven/DiktatBaseMojo.kt 0.00% <0.00%> (ø)
.../com/saveourtool/diktat/plugin/maven/DiktatMojo.kt 0.00% <ø> (ø)
...diktat/ruleset/rules/chapter2/kdoc/KdocComments.kt 89.95% <ø> (ø)
.../ruleset/rules/chapter3/files/FileStructureRule.kt 85.35% <ø> (ø)
...diktat/ruleset/rules/DiktatRuleSetProviderV3Spi.kt 0.00% <0.00%> (ø)
...diktat/ruleset/rules/DiktatRuleConfigReaderImpl.kt 60.00% <60.00%> (ø)
...iktat/common/config/reader/AbstractConfigReader.kt 75.00% <75.00%> (ø)
...ol/diktat/common/config/rules/RulesConfigReader.kt 34.14% <100.00%> (-5.14%) ⬇️
... and 2 more

@nulls nulls changed the title Diktat runner Diktat rule configs Jun 8, 2023
@nulls nulls requested a review from kgevorkyan June 8, 2023 15:05
@nulls nulls marked this pull request as ready for review June 8, 2023 15:05
@orchestr7
Copy link
Member

Unfortunately you will need to wait until I will finish all the work related to the renaming of packages.

But my real question is the following: is it possible to create a small runner of diktat without this huge change with existing code? You told me “everything is already done” in CliRunner and you can call API directly, but the only problem is that there is no chance to provide external configuration of diktat-analysis directly to runner (only possible with a file).

@nulls
Copy link
Member Author

nulls commented Jun 9, 2023

But my real question is the following: is it possible to create a small runner of diktat without this huge change with existing code?

I thought I've showed to you. Restored this main class: #1689

@orchestr7
Copy link
Member

But my real question is the following: is it possible to create a small runner of diktat without this huge change with existing code?

I thought I've showed to you. Restored this main class: #1689

I missed this comment and actually got pissed because of this a little bit. If you show that to me - how external people should know about our API and how to call our methods? 👿 Anyway - I have sent #1689 to our friends, thank you 😄

@nulls
Copy link
Member Author

nulls commented Jun 13, 2023

If you show that to me - how external people should know about our API and how to call our methods?

I've showed you that it doesn't work in the way that we wanted (configuration now supported only via a file), that why I continue with this PR

@nulls nulls mentioned this pull request Jun 13, 2023
4 tasks
@nulls nulls enabled auto-merge (squash) June 13, 2023 11:06
@nulls nulls merged commit 4c90d15 into master Jun 13, 2023
@nulls nulls deleted the feature/rule-config#1685 branch June 13, 2023 11:17
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.

Externalize loading diktat rules
4 participants