Skip to content
This repository has been archived by the owner on Oct 22, 2023. It is now read-only.

Commit

Permalink
Run Spotless against all Kotlin Gradle scripts.
Browse files Browse the repository at this point in the history
  • Loading branch information
charleskorn committed Sep 12, 2021
1 parent 20b88b9 commit 8498dde
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 26 deletions.
32 changes: 18 additions & 14 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -80,20 +80,24 @@ tasks.named("check").configure {
}

checkUnitTestLayout {
ignoreFileNameCheck.set(fileTree("src/unitTest/kotlin") {
include(
"batect/cli/commands/FakeDockerConnectivity.kt",
"batect/testutils/**",
"batect/config/ExceptionMatchers.kt"
)
})

ignoreMissingMainFile.set(fileTree("src/unitTest/kotlin") {
include(
"batect/execution/model/steps/*.kt",
"batect/execution/model/events/*.kt"
)
})
ignoreFileNameCheck.set(
fileTree("src/unitTest/kotlin") {
include(
"batect/cli/commands/FakeDockerConnectivity.kt",
"batect/testutils/**",
"batect/config/ExceptionMatchers.kt"
)
}
)

ignoreMissingMainFile.set(
fileTree("src/unitTest/kotlin") {
include(
"batect/execution/model/steps/*.kt",
"batect/execution/model/events/*.kt"
)
}
)
}

apply {
Expand Down
2 changes: 1 addition & 1 deletion buildSrc/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017-2020 Charles Korn.
Copyright 2017-2021 Charles Korn.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand Down
4 changes: 2 additions & 2 deletions gradle/spotless.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ spotless {
}

kotlinGradle {
target "*.gradle.kts"
target "**/*.gradle.kts"

ktlint("0.42.1")

// Check what values are really required with: find . -name '*.gradle.kts' -type f -exec sed -n 17p \{]} \; | cut -d' ' -f1 | sort | uniq
// TODO: This confuses spotless plugin for settings.gradle.kts -- is
// this a spotless issue, or does this configuration need more
// specificity?
licenseHeader "/*$licenseText*/\n\n", "(val|import|pluginManagement|plugins)"
licenseHeader "/*$licenseText*/\n\n", "(val|import|pluginManagement|plugins|//)"
}
}
9 changes: 1 addition & 8 deletions gradle/updateInfoUpload.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright 2017-2020 Charles Korn.
Copyright 2017-2021 Charles Korn.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,14 +15,7 @@
*/

import batect.buildtools.GoogleCloudStorageUpload
import com.google.auth.oauth2.GoogleCredentials
import com.google.cloud.storage.BlobId
import com.google.cloud.storage.BlobInfo
import com.google.cloud.storage.Storage
import com.google.cloud.storage.StorageOptions
import java.io.FileInputStream
import java.nio.file.Files
import java.io.ByteArrayInputStream


buildscript {
Expand Down
3 changes: 2 additions & 1 deletion renovate.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
{
"fileMatch": [
".groovy$",
".gradle$"
".gradle$",
".gradle.kts$"
],
"matchStrings": [
"ktlint\\(\"(?<currentValue>[\\d.]*?)\"\\)"
Expand Down

0 comments on commit 8498dde

Please sign in to comment.