diff --git a/AGENTS.md b/AGENTS.md index 7e361269..1cd58c40 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -404,7 +404,7 @@ EOF When writing documentation (README, CHANGES, docs/), follow these rules for code blocks: -**One command per code block.** This makes commands individually copyable. +**One command per code block.** This makes commands individually copyable. For sequential commands, either use separate code blocks or chain them with `&&` or `;` and `\` continuations (keeping it one logical command). **Put explanations outside the code block**, not as comments inside. @@ -432,6 +432,42 @@ $ uv run pytest $ uv run pytest --cov ``` +### Shell Command Formatting + +These rules apply to shell commands in documentation (README, CHANGES, docs/), **not** to Python doctests. + +**Use `console` language tag with `$ ` prefix.** This distinguishes interactive commands from scripts and enables prompt-aware copy in many terminals. + +Good: + +```console +$ uv run pytest +``` + +Bad: + +```bash +uv run pytest +``` + +**Split long commands with `\` for readability.** Each flag or flag+value pair gets its own continuation line, indented. Positional parameters go on the final line. + +Good: + +```console +$ pipx install \ + --suffix=@next \ + --pip-args '\--pre' \ + --force \ + 'libvcs' +``` + +Bad: + +```console +$ pipx install --suffix=@next --pip-args '\--pre' --force 'libvcs' +``` + ## Debugging Tips When stuck in debugging loops: diff --git a/CHANGES b/CHANGES index 1470c3da..23b020e3 100644 --- a/CHANGES +++ b/CHANGES @@ -393,14 +393,17 @@ _Maintenance only, no bug fixes, or new features_ via ruff v0.3.4, all automated lint fixes, including unsafe and previews were applied: - ```sh - ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; ruff format . + ```console + $ ruff check --select ALL . \ + --fix --unsafe-fixes \ + --preview --show-fixes; \ + ruff format . ``` Branches were treated with: - ```sh - git rebase \ + ```console + $ git rebase \ --strategy-option=theirs \ --exec 'poetry run ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes; poetry run ruff format .; git add src tests; git commit --amend --no-edit' \ origin/master diff --git a/README.md b/README.md index 0445daf5..aa16a120 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,20 @@ It powers [vcspull](https://github.com/vcs-python/vcspull) and simplifies VCS in ## Installation -```bash -pip install libvcs +```console +$ pip install libvcs ``` With [uv](https://docs.astral.sh/uv/): -```bash -uv add libvcs +```console +$ uv add libvcs ``` Try it interactively: -```bash -uvx --with libvcs ipython +```console +$ uvx --with libvcs ipython ``` Tip: libvcs is pre-1.0. Pin a version range in projects to avoid surprises: