This adds a spotless formatting step using the new pkl formatter.
This only formats Pkl sources in the stdlib, because other sources are possibly test input and not meant to be formatted.
TODO: it'd be good to also format the sources in .circleci (and .github once we migrate to GHA), but I'm running into some Gradle weirdness when trying to set that up; seeing this error:
A problem was found with the configuration of task ':spotlessPkl' (type 'SpotlessTaskImpl').
- Gradle detected a problem with the following location: '/Users/danielchao/code/apple/pkl'.
Reason: Task ':spotlessPkl' uses this output of task ':stdlib:spotlessKotlinGradle' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/apple/pkl/pull/1253
**Author:** [@bioball](https://github.com/bioball)
**Created:** 10/23/2025
**Status:** ✅ Merged
**Merged:** 10/24/2025
**Merged by:** [@bioball](https://github.com/bioball)
**Base:** `main` ← **Head:** `spotless-format-pkl`
---
### 📝 Commits (1)
- [`e13b794`](https://github.com/apple/pkl/commit/e13b7942f71eb691a0f96968701dd7aa89f97948) Enforce Pkl formatting of stdlib with spotless
### 📊 Changes
**4 files changed** (+94 additions, -12 deletions)
<details>
<summary>View changed files</summary>
➕ `buildSrc/src/main/kotlin/PklFormatterSpotless.kt` (+56 -0)
➕ `buildSrc/src/main/kotlin/pklSpotlessFormat.gradle.kts` (+36 -0)
📝 `stdlib/base.pkl` (+1 -1)
📝 `stdlib/stdlib.gradle.kts` (+1 -11)
</details>
### 📄 Description
This adds a spotless formatting step using the new pkl formatter.
This only formats Pkl sources in the stdlib, because other sources are possibly test input and not meant to be formatted.
TODO: it'd be good to also format the sources in `.circleci` (and `.github` once we migrate to GHA), but I'm running into some Gradle weirdness when trying to set that up; seeing this error:
```
A problem was found with the configuration of task ':spotlessPkl' (type 'SpotlessTaskImpl').
- Gradle detected a problem with the following location: '/Users/danielchao/code/apple/pkl'.
Reason: Task ':spotlessPkl' uses this output of task ':stdlib:spotlessKotlinGradle' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
```
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/apple/pkl/pull/1253
Author: @bioball
Created: 10/23/2025
Status: ✅ Merged
Merged: 10/24/2025
Merged by: @bioball
Base:
main← Head:spotless-format-pkl📝 Commits (1)
e13b794Enforce Pkl formatting of stdlib with spotless📊 Changes
4 files changed (+94 additions, -12 deletions)
View changed files
➕
buildSrc/src/main/kotlin/PklFormatterSpotless.kt(+56 -0)➕
buildSrc/src/main/kotlin/pklSpotlessFormat.gradle.kts(+36 -0)📝
stdlib/base.pkl(+1 -1)📝
stdlib/stdlib.gradle.kts(+1 -11)📄 Description
This adds a spotless formatting step using the new pkl formatter.
This only formats Pkl sources in the stdlib, because other sources are possibly test input and not meant to be formatted.
TODO: it'd be good to also format the sources in
.circleci(and.githubonce we migrate to GHA), but I'm running into some Gradle weirdness when trying to set that up; seeing this error:🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.