Skip to content

Commit

Permalink
Ensure verifyGeneratorOutput task checks necessary files (#5489)
Browse files Browse the repository at this point in the history
* Ensure verifyGeneratorOutput task checks necessary files

* Update generated ruleauthors config file
  • Loading branch information
3flex committed Oct 31, 2022
1 parent e0b3d99 commit e5a9768
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 6 deletions.
17 changes: 13 additions & 4 deletions detekt-generator/build.gradle.kts
Expand Up @@ -88,16 +88,25 @@ val generateDocumentation by tasks.registering(JavaExec::class) {

val verifyGeneratorOutput by tasks.registering(Exec::class) {
dependsOn(generateDocumentation)
description = "Verifies that the default-detekt-config.yml is up-to-date"
commandLine = listOf("git", "diff", "--quiet", defaultConfigFile, deprecationFile)
description = "Verifies that generated config files are up-to-date"
commandLine = listOf(
"git",
"diff",
"--quiet",
defaultConfigFile,
formattingConfigFile,
librariesConfigFile,
ruleauthorsConfigFile,
deprecationFile,
)
isIgnoreExitValue = true

doLast {
if (executionResult.get().exitValue == 1) {
throw GradleException(
"The default-detekt-config.yml is not up-to-date. " +
"At least one generated configuration file is not up-to-date. " +
"You can execute the generateDocumentation Gradle task " +
"to update it and commit the changed files."
"to update generated files then commit the changes."
)
}
}
Expand Down
4 changes: 2 additions & 2 deletions detekt-rules-ruleauthors/src/main/resources/config/config.yml
@@ -1,6 +1,6 @@
ruleauthors:
active: true
ViolatesTypeResolutionRequirements:
active: true
UseEntityAtName:
active: true
ViolatesTypeResolutionRequirements:
active: true

0 comments on commit e5a9768

Please sign in to comment.