Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ internal fun Project.configureSpotlessForRootProject() {
endWithNewline()
}
format("kts") {
target("*.kts")
target("build-logic/*.kts")
target("build-logic/convention/*.kts")
target("*.kts", "build-logic/*.kts", "build-logic/convention/*.kts")
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The current list of target patterns is quite specific and may miss .kts files in newly added modules or deeper directories within build-logic. Using a recursive glob pattern like build-logic/**/*.kts would be more robust and maintainable, ensuring all script files within the build logic are covered regardless of future changes to the directory structure.

Suggested change
target("*.kts", "build-logic/*.kts", "build-logic/convention/*.kts")
target("*.kts", "build-logic/**/*.kts")

// Look for the first line that doesn't have a block comment (assumed to be the license)
licenseHeaderFile(rootDir.resolve("spotless/copyright.kts"), "(^(?![\\/ ]\\*).*$)")
endWithNewline()
Expand Down