Skip to content

Commit 73e3278

Browse files
committed
fix: skipCodeStyle task condition
1 parent 1f4739e commit 73e3278

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

gradle/code-style-config.gradle

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,11 @@ extensions.configure(CodeNarcExtension) {
3636
}
3737

3838
// Do not run Code Style checks if the property 'skipCodeStyle' is defined
39-
if (findProperty('skipCodeStyle')) {
40-
tasks.withType(Checkstyle).configureEach { enabled = false }
41-
tasks.withType(CodeNarc).configureEach { enabled = false }
39+
tasks.withType(Checkstyle).configureEach {
40+
onlyIf { !project.hasProperty('skipCodeStyle') }
41+
}
42+
tasks.withType(CodeNarc).configureEach {
43+
onlyIf { !project.hasProperty('skipCodeStyle') }
4244
}
4345

4446
tasks.register('codeStyle') {

0 commit comments

Comments
 (0)