Repository navigation
Conversation
Messages, help and errors name a command the way the docs do, in backticks, and terminals printed the backticks literally. The source keeps them; the output layer now renders them: bold on a terminal with color on, plain text anywhere else (a pipe, a file, NO_COLOR), and plain text in the --output json error object and warning records. The rule is narrow (pkg/ansi/backticks.go): a pair of backticks on one line around up to 200 characters that do not start or end with a space, with no letter or digit outside either backtick. A lone backtick, an empty pair, a run of three, and one inside a word or a quoted value are left as they are. Co-Authored-By: Claude <noreply@anthropic.com>
Coverage Report for CI Build 37986622376Coverage increased (+0.003%) to 57.678%Details
Uncovered Changes
Coverage RegressionsNo coverage regressions found. Coverage Stats
💛 - Coveralls |
This reverts commit f3acec6. Review found the runtime transform unsafe: a % inside a span went through aurora's Sprintf, real backticks in passed-through uv, HTTP and Airflow text were stripped, and copy-paste commands were rewritten. Command names are written as plain text at the source instead, in the commits that follow. Co-Authored-By: Claude <noreply@anthropic.com>
Messages, help and notes named commands, flags and paths the way the docs do, in backticks, and a terminal printed the backticks as they were, as did an error object's json. They are plain text now, at the source: "astro dev start was removed in Astro CLI v2. Use astro local start instead." Where a bare command read ambiguously mid-sentence, the sentence is rephrased rather than quoted. TestMessagesWriteCommandsAsPlainText (internal/archlint) fails on a string literal holding a backtick anywhere in the repo's non-test Go code, except what its backtickAllowed list names: the markdown astro init writes, the upgrade prompt handed to Otto, and one shell-metacharacter set. TestHelpHasNoBackticks renders every help page in every tree and fails on a backtick. Co-Authored-By: Claude <noreply@anthropic.com>
Co-Authored-By: Claude <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The CLI's own messages named commands, flags and paths the way the docs do, in backticks: "
astro dev startwas removed in Astro CLI v2. Useastro local startinstead." A terminal printed the backticks literally, and so did the--output jsonerror object. This PR writes them as plain text at the source:There is no runtime transform. The PR's first commit (a renderer that bolded or stripped backticks at output time) is reverted in the second. Review found it unsafe in four ways:
%inside a span went through aurora's Sprintf;Plain text at the source has none of those problems.
What changed
astro initconversion notes,checknotes, Deployment clone notes, theastro devstub's payloaderrorandnotes), helpShort/Long/flag usage, next steps (astro package), prompts, and removed-command and removed-flag messages. This spanscmd/,internal/,airflow/, and thepkg/*sub-modulesawsauth,checks,container,emfetch,googleauth,imagebuild,instancelocate,instances,localrtandscaffold, pluspkg/httputilandpkg/util. Astro Desktop sees the plain text too, since it imports the sub-modules.setcreates …" became "The set command creates …" in four places (env, deployment and link removal guidance);lslists" became "The ls command lists" (local api), and "listshows" became "The list command shows" (variables);astro local start --dockerthen" became "then use astro local start --docker" (dev stub note);local" became "Drop local from the command";uv run pytestyourself" became "run your tests yourself with uv run pytest";default = true" became "set default = true on a link";.env" became "add a .env line";linknarrows … useget" became "linking narrows … use the get command";workspaceanddomainin pyproject.toml" became "Check the workspace and domain keys in pyproject.toml", with the same change for "sets noworkspace" and "organizationandworkspaceunder [tool.astro]";dockerfileunder [tool.astro]" became "with the dockerfile key under [tool.astro]";if r.Format == FormatJSONpanic text became "branch on r.Format == FormatJSON";astro initnote that lists severalastro link add …commands now joins them with "; " rather than ", ", so one command is not read as running into the next.cliUpgradePrompt.BringUp) is now plain, matching what Astro Desktop already sends.pkg/scaffold/airflowupgradeprompt.go) stays markdown.docs/*.mdare markdown), and text passed through from uv, Airflow or an API.Guard tests
TestMessagesWriteCommandsAsPlainText(internal/archlint/backticks_test.go) parses every non-test.gofile in the repo, sub-modules included. It fails on any string literal that holds a backtick, and the failure message states the convention. It skipse2e/,*.gen.go,testdata/and the test-helper packagescliouttest/andinstancestest/. Its allowlist,backtickAllowed, has three entries:pkg/scaffold/templates.go: the README and AGENTS.md thatastro initwrites into a project, which are markdown;pkg/scaffold/airflowupgradeprompt.go: the prompt handed to Otto, which is markdown for a model and is never printed;pkg/scaffold/files1x.go, the literal"$*?\"`: the shell metacharacters that make an argument unsafe to repeat unquoted.An entry that no longer matches anything also fails the test.
TestHelpHasNoBackticks(cmd/help_backticks_test.go) renders every help page in every tree fromrootsUnderTest, hidden commands included. It fails on any line with a backtick, which also catches strings assembled at run time.docs/architecture.md: a new "Commands in messages" section under Output states the convention and the two guards, and the help style guide gains a bullet for it.Tests that pinned backticked text were updated in 52 test files, including
e2e/devstub_test.goande2e/convert_test.go.make update-schemaschanged no goldens; they pin shapes, not values.#2291 (removed-commands-and-bundle-output)
git merge-tree --write-tree HEAD origin/removed-commands-and-bundle-outputconflicts in 6 files. Both PRs edit the same removed-command message lines, and #2291 also restructures the stubs around them:cmd/astro/deployment_removed.gocmd/astro/env_removed.gocmd/astro/env_var_link.gocmd/local/dev.gocmd/local/run_removed.gocmd/removed_flags_test.goTo resolve, take #2291's structure (
cliout.RemovedCommand/removedCmdStub) and its wording ("was removed in Astro CLI v2", "It has no replacement in the CLI yet: …"), with the backticks dropped. Whichever PR merges second must then update these strings from #2291:headindeployment_removed.goandenv_removed.go, and theenv_var_link.goguidance: "astro deployment %swas removed in Astro CLI v2." becomes "astro deployment %s was removed in Astro CLI v2."Shorts: "Removed in v2 — useset, which creates or updates" becomes "… use the set command, which creates or updates"; "Removed in v2 — local Airflow lives underastro local", "Removed in v2 — use"+replaceRunDag+"" and "Removed in v2 — useastro env " + o.envNoun + "" lose their backticks;t.Skiptext inremoved_flags_test.gois a conflict on wording only.It must also update these #2291 tests:
cmd/removed_commands_test.go:namesReplacementlooks for "`astro " in the guidance. Plain guidance ("Use astro local start instead") needs "astro " or "Use astro ".cmd/localtests asserting "Useastro local statusinstead" (and similar) need the plain form.TestMessagesWriteCommandsAsPlainTextandTestHelpHasNoBackticksfail on any backticked string left in, so a missed one cannot slip through.Checks
go build ./...andGOOS=windows go build ./...pass.GOOS=windows go vet ./cmd/...passes.make testandmake test-submodulespass.make test-e2e(tier 0) passes.make lintpasses; the only follow-up was a gofmt comment-alignment fix, committed separately.make lint-submodules,make lint-e2e,make lint-goosandmake deadcodepass.make update-schemasproduced no diff.Breaking changes
The text of messages changes. A script that greps stderr, or an error object's
error, for a backticked command (`astro local start`) now seesastro local start. The JSON shapes are unchanged.