What is a recommended way of updating detekt config after a new release? #3558
-
I have a custom yml config in my project, and every time a new version of detekt is released, I can't figure a good way to update it. There are usually new rules, which are disabled by default. This is fine, because it unexpected checks won't be activated, but requires to manually add new entries into the configuration file. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 5 replies
-
Really good question! I want to read the answers of other people. What I do is to use the GNU
I know that this is far from ideal so I'd like to know how other people do this and find better ways to improve this. |
Beta Was this translation helpful? Give feedback.
-
Have you considered using |
Beta Was this translation helpful? Give feedback.
Really good question! I want to read the answers of other people. What I do is to use the GNU
diff
andpatch
commands.mv config/detekt/detekt.yml config/detekt/mydetekt.yml
./gradlew detektGenerateConfig
diff -u config/detekt/detekt.yml config/detekt/mydetekt.yml >config/detekt/mydetekt.patch
rm config/detekt/detekt.yml config/detekt/mydetekt.yml
./gradlew detektGenerateConfig
patch -u --merge --no-backup-if-mismatch config/detekt/dete…