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

Use the new configure config for formatting #4352

Merged
merged 4 commits into from Jan 25, 2022
Merged

Conversation

BraisGabin
Copy link
Member

@BraisGabin BraisGabin commented Dec 2, 2021

Now that we can concat different configuration files this PR uses it on our first-party-plugin formatting.

close #3242

@BraisGabin BraisGabin changed the base branch from main to configure-config December 2, 2021 09:42
@BraisGabin BraisGabin marked this pull request as draft December 2, 2021 09:42
@BraisGabin BraisGabin added this to the 1.20.0 milestone Dec 2, 2021
@BraisGabin BraisGabin added the notable changes Marker for notable changes in the changelog label Dec 2, 2021
@codecov
Copy link

codecov bot commented Dec 2, 2021

Codecov Report

Merging #4352 (df33211) into main (743706f) will decrease coverage by 0.04%.
The diff coverage is 69.44%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #4352      +/-   ##
============================================
- Coverage     84.15%   84.11%   -0.05%     
+ Complexity     3314     3310       -4     
============================================
  Files           476      477       +1     
  Lines         10871    10879       +8     
  Branches       2011     2015       +4     
============================================
+ Hits           9149     9151       +2     
- Misses          692      698       +6     
  Partials       1030     1030              
Impacted Files Coverage Δ
...itlab/arturbosch/detekt/generator/DetektPrinter.kt 0.00% <0.00%> (ø)
...ator/printer/defaultconfig/RuleSetConfigPrinter.kt 88.88% <88.88%> (ø)
...t/generator/printer/defaultconfig/ConfigPrinter.kt 100.00% <100.00%> (+6.81%) ⬆️

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 743706f...df33211. Read the comment docs.

Base automatically changed from configure-config to main January 2, 2022 17:55
@BraisGabin BraisGabin marked this pull request as ready for review January 2, 2022 17:57
@chao2zhang
Copy link
Member

Many codebases I worked with refer to the URL detekt-core/src/main/resources/default-detekt-config.yml directly in the config file. So this is one of the most notable changes

@BraisGabin
Copy link
Member Author

Why do they that instead of using the generate task? It seems odd because we add new rules there that old versions of detekt don't have.

@chao2zhang
Copy link
Member

Sorry, I should have clarify - The URL was referred as a link in the comment section. Because people need to compare what has changed between the old detekt version and new detekt version.

@BraisGabin
Copy link
Member Author

Oh, I see. I use this script #3558 (comment)

Update the Detekt configuration between versions is really difficult. We should probably look for a way to improve it. Maybe implement a semantic merge but I don't know.

@zdenda-online
Copy link

zdenda-online commented Aug 25, 2022

Guys this is not well documented at all.
Now detekt.yml does not work with formatting and I suppose we should add a new file in resources. Does it mean that for multi-project repo, we should add it to all subprojects? We would like to use just one configuration for the whole repo.

@cortinico
Copy link
Member

Now detekt.yml does not work with formatting and I suppose we should add a new file in resources

Nope you should not. Please open an issue and explain your setup as you're most likely facing a bug of some sort

@zdenda-online
Copy link

zdenda-online commented Sep 1, 2022

It just says that formatting is not allowed to be in detekt.yml (in newer version, in older it worked). Do you think that is really the bug? 🤔 I thought that is due to that change.

@BraisGabin
Copy link
Member Author

That seems like an issue in your configuration. To be more precise it seems that you are not applying the formatting plugin. And, because you are not applying it detekt doesn't know what formatting: is so it complains about that key.

@chriswininger
Copy link

That seems like an issue in your configuration. To be more precise it seems that you are not applying the formatting plugin. And, because you are not applying it detekt doesn't know what formatting: is so it complains about that key.

interesting what is the formatting plugin and how do we use it. Also here trying to upgrade from an older version and seeing the same error as above

@BraisGabin
Copy link
Member Author

https://detekt.dev//docs/rules/formatting/

You can find information about how to use it there. It's a wrapper around ktlint.

@mairi17
Copy link

mairi17 commented Oct 26, 2022

Here's the correct link in case it's useful:
https://detekt.dev/docs/rules/formatting/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
notable changes Marker for notable changes in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement ConfigPropertiesProvider
6 participants