Read the prose language and the title and branch templates from the project's config

This commit is contained in:
2026-11-14 01:14:08 +01:00
parent 82f4bbd91b
commit ce87a519f0
22 changed files with 134 additions and 29 deletions
+20 -4
View File
@@ -6,7 +6,7 @@ Run inside a checkout, or a worktree of one. It finds the config that names the
~/.claude-projects/<key>/config.toml, and prints each setting and its absolute path, as in
`plan: /home/me/code/acme/todo.md`. Given a setting, it prints only that setting's path.
The config is TOML. `checkout` names the project's main checkout, and every other setting but `wait-for-approval` is a path:
The config is TOML. `checkout` names the project's main checkout, and every setting in the example below is a path:
"checkout:<path>" inside the checkout, "folder:<path>" inside the config's own folder, or one that
starts with / or ~/. In a worktree, a "checkout:" path is the worktree's own file.
@@ -26,13 +26,29 @@ a path that starts with / or ~/ and lies outside the checkout and the config's f
"~/.claude-projects/acme-billing.env". Where it is left out, the project has no credentials file, and
a tool that needs one fails naming the setting. It is printed with the others only where it is set.
`wait-for-approval` is the other optional setting, true or false: whether `chunk-pr merge` waits for a human's
`wait-for-approval` is an optional setting, true or false: whether `chunk-pr merge` waits for a human's
approval of the pull request, as its branch protection requires on GitHub, before it merges. Left out, it is
false. `project-config wait-for-approval` prints true or false; the full listing shows the setting only where
it is true.
Four optional settings say how the project writes, for a project whose owners don't write as
~/.claude/CLAUDE.md does:
language = "Swedish"
commit-title = "PAY-{id} - {summary}"
pull-request-title = "PAY-{id} - {summary}"
branch = "feature/PAY-{id}"
`language` names the language of the project's prose by its English name; left out, it is English.
The others are templates. {summary} is the one line that says what a commit or pull request does,
and {id} is the ID of the chunk's first plan item. A title template holds {summary} once and {id}
at most once; left out, it is "{summary}". `branch` holds {id} once, among letters, digits and
. _ / -; left out, it is "item-{id}". A template has no way to write a literal { or }.
`project-config <setting>` prints each one's value, and the full listing shows it only where the
config sets it to something else than it is when left out.
Exit 1, naming each fault on stderr, where no config names the checkout, or its config leaves out a
setting, names an unknown one, misspells a path or sets `wait-for-approval` to anything but true or
setting, names an unknown one, misspells a path, a language or a template, or sets `wait-for-approval` to anything but true or
false, and where `env-file` is asked for and not set. No path setting has a default.
"""
import pathlib
@@ -40,8 +56,8 @@ import sys
from project_config.settings import CONFIG, ENV_FILE, load, OPTIONAL, ProjectConfig, SETTINGS, WAIT_FOR_APPROVAL
from failure import Failure
from project_config import templates
from git_cli.git_repo import git, Git
from project_config import templates
def main(argv: list[str]) -> int: