Skip to content

What is a recommended way of updating detekt config after a new release? #3558

Answered by BraisGabin
petertrr asked this question in Q&A
Discussion options

You must be logged in to vote

Really good question! I want to read the answers of other people. What I do is to use the GNU diff and patch commands.

  • mv config/detekt/detekt.yml config/detekt/mydetekt.yml
    • Move my configuration to another file
  • ./gradlew detektGenerateConfig
    • Recreate the default configuration
  • diff -u config/detekt/detekt.yml config/detekt/mydetekt.yml >config/detekt/mydetekt.patch
    • Save the difference between the default and my configuration
  • rm config/detekt/detekt.yml config/detekt/mydetekt.yml
    • remove all the configurations
  • Update detekt
  • ./gradlew detektGenerateConfig
    • Recreate the default configuration with the new detekt version
  • patch -u --merge --no-backup-if-mismatch config/detekt/dete…

Replies: 2 comments 5 replies

Comment options

You must be logged in to vote
1 reply
@petertrr
Comment options

Answer selected by schalkms
Comment options

You must be logged in to vote
4 replies
@petertrr
Comment options

@cortinico
Comment options

@BraisGabin
Comment options

@petertrr
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants