[PR #947] [MERGED] Bump clikt to 5.0.3 to fix bash autocompletion #821

Closed
opened 2025-12-30 01:27:01 +01:00 by adam · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/apple/pkl/pull/947
Author: @gordonbondon
Created: 2/12/2025
Status: Merged
Merged: 2/20/2025
Merged by: @bioball

Base: mainHead: clickt-bump


📝 Commits (10+)

📊 Changes

46 files changed (+463 additions, -228 deletions)

View changed files

📝 bench/gradle.lockfile (+1 -1)
📝 buildSrc/src/main/kotlin/pklAllProjects.gradle.kts (+9 -0)
📝 buildSrc/src/main/kotlin/pklFatJar.gradle.kts (+3 -0)
📝 docs/gradle.lockfile (+1 -2)
📝 gradle/libs.versions.toml (+3 -2)
📝 pkl-cli/gradle.lockfile (+24 -4)
📝 pkl-cli/pkl-cli.gradle.kts (+1 -5)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/CliTestRunner.kt (+2 -2)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt (+1 -0)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/AnalyzeCommand.kt (+9 -13)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/DownloadPackageCommand.kt (+17 -19)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/EvalCommand.kt (+8 -6)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/ProjectCommand.kt (+54 -60)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/ReplCommand.kt (+3 -1)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/RootCommand.kt (+10 -10)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/ServerCommand.kt (+6 -6)
📝 pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt (+4 -3)
📝 pkl-cli/src/test/kotlin/org/pkl/cli/CliMainTest.kt (+9 -5)
📝 pkl-cli/src/test/kotlin/org/pkl/cli/CliTestRunnerTest.kt (+4 -4)
📝 pkl-codegen-java/gradle.lockfile (+24 -4)

...and 26 more files

📄 Description

Previously bash completion generated by pkl was causing errors like:

-bash: /opt/homebrew/etc/bash_completion.d/pkl: line 347: syntax error near unexpected token `<'
-bash: /opt/homebrew/etc/bash_completion.d/pkl: line 347: `    <modules>)'

This was due to clikt bug https://github.com/ajalt/clikt/issues/563 and was fixed in clikt 5.0.3

This PR:

  1. Bumps clikt to 5.0.3
  2. Updates code following clikt migration guide https://ajalt.github.io/clikt/migration/
  3. Removes unneeded <..> around metavars, as clikt now correctly generates them inside help output.

Bonus: This comes with added colours and "markdown" support inside help:
Before:
Screenshot 2025-02-12 at 17 28 04

After:
Screenshot 2025-02-12 at 17 28 18


🔄 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/947 **Author:** [@gordonbondon](https://github.com/gordonbondon) **Created:** 2/12/2025 **Status:** ✅ Merged **Merged:** 2/20/2025 **Merged by:** [@bioball](https://github.com/bioball) **Base:** `main` ← **Head:** `clickt-bump` --- ### 📝 Commits (10+) - [`1873d9d`](https://github.com/apple/pkl/commit/1873d9d44860927d13e22db5dc5db781bdffbf1a) Bump clikt to 5.0.3 - [`ebcaf8d`](https://github.com/apple/pkl/commit/ebcaf8d426ddb68bbe80e27c8f83d87de4f8617b) Migrate code to clikt 5.0 - [`bb911b4`](https://github.com/apple/pkl/commit/bb911b464fc1ac1df8f4d032fd8e5a881793ddf1) Remove unneeded greater and less sign in metavars - [`f4335e1`](https://github.com/apple/pkl/commit/f4335e101f029762480c754f0e6c3a3882daebd0) Bump - [`5536925`](https://github.com/apple/pkl/commit/553692552629325a8f8e29dd31f287a24fdd4bca) rebase - [`045c2a6`](https://github.com/apple/pkl/commit/045c2a60b69d3ee6be8c2f43a424d126891ae1e7) Update lockfile - [`1bef03b`](https://github.com/apple/pkl/commit/1bef03bad153f67f61d6553642c51356cf112099) review suggestions - [`b1e7bc8`](https://github.com/apple/pkl/commit/b1e7bc8e148f982f8d8c0aebf05ae0d7a4e95664) Switch to extensions - [`dd88633`](https://github.com/apple/pkl/commit/dd88633a566d167975fe0477ee58424ec05defb1) Update doc links for other clis - [`405a290`](https://github.com/apple/pkl/commit/405a290610332b9ca2f42533d933fb6c5d1d82dc) format ### 📊 Changes **46 files changed** (+463 additions, -228 deletions) <details> <summary>View changed files</summary> 📝 `bench/gradle.lockfile` (+1 -1) 📝 `buildSrc/src/main/kotlin/pklAllProjects.gradle.kts` (+9 -0) 📝 `buildSrc/src/main/kotlin/pklFatJar.gradle.kts` (+3 -0) 📝 `docs/gradle.lockfile` (+1 -2) 📝 `gradle/libs.versions.toml` (+3 -2) 📝 `pkl-cli/gradle.lockfile` (+24 -4) 📝 `pkl-cli/pkl-cli.gradle.kts` (+1 -5) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/CliTestRunner.kt` (+2 -2) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/Main.kt` (+1 -0) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/AnalyzeCommand.kt` (+9 -13) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/DownloadPackageCommand.kt` (+17 -19) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/EvalCommand.kt` (+8 -6) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/ProjectCommand.kt` (+54 -60) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/ReplCommand.kt` (+3 -1) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/RootCommand.kt` (+10 -10) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/ServerCommand.kt` (+6 -6) 📝 `pkl-cli/src/main/kotlin/org/pkl/cli/commands/TestCommand.kt` (+4 -3) 📝 `pkl-cli/src/test/kotlin/org/pkl/cli/CliMainTest.kt` (+9 -5) 📝 `pkl-cli/src/test/kotlin/org/pkl/cli/CliTestRunnerTest.kt` (+4 -4) 📝 `pkl-codegen-java/gradle.lockfile` (+24 -4) _...and 26 more files_ </details> ### 📄 Description Previously `bash` completion generated by `pkl` was causing errors like: ``` -bash: /opt/homebrew/etc/bash_completion.d/pkl: line 347: syntax error near unexpected token `<' -bash: /opt/homebrew/etc/bash_completion.d/pkl: line 347: ` <modules>)' ``` This was due to clikt bug https://github.com/ajalt/clikt/issues/563 and was fixed in [clikt 5.0.3](https://github.com/ajalt/clikt/releases/tag/5.0.3) This PR: 1. Bumps clikt to 5.0.3 2. Updates code following clikt migration guide https://ajalt.github.io/clikt/migration/ 3. Removes unneeded `<..>` around metavars, as clikt now correctly generates them inside help output. Bonus: This comes with added colours and "markdown" support inside help: Before: <img width="719" alt="Screenshot 2025-02-12 at 17 28 04" src="https://github.com/user-attachments/assets/63afcb6c-c248-4a32-a7b2-72de04b676bd" /> After: <img width="635" alt="Screenshot 2025-02-12 at 17 28 18" src="https://github.com/user-attachments/assets/5ff1e8eb-2e1c-47b4-9519-6ae9dbb216f5" /> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
adam added the pull-request label 2025-12-30 01:27:01 +01:00
adam closed this issue 2025-12-30 01:27:01 +01:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/pkl#821