Skip to content

test: guard the api/cli/format layering - #463

Open
thde wants to merge 4 commits into
mainfrom
thde/352-06-cli-format-split
Open

thde wants to merge 4 commits into
mainfrom
thde/352-06-cli-format-split

Conversation

@thde

@thde thde commented Sep 17, 2026

Copy link
Copy Markdown
Member

TestLayering enumerates the packages of the module and checks their
imports against the layering the restructure established: api/... uses
only api/... and internal/cli, internal/cli, internal/format and
internal/logbox use nothing else of the module, and verbs are imported
by main and other verbs only. Test files may additionally import
internal/test for fixtures.

@thde
thde added this pull request to stack #459 September 17, 2026 11:12
@thde
thde force-pushed the thde/352-06-cli-format-split branch from 46fdfd2 to 11b5f84 Compare October 6, 2026 08:35
Base automatically changed from thde/352-05-update-create to main October 9, 2026 09:04
thde added 4 commits October 9, 2026 11:04
The command-hint builder (Command(), LoginCommand, LogoutCommand) only
feeds Error.WithSuggestions and login hints, so it belongs next to
Error in internal/cli. Inline the failure prefix in Error.Error so cli
no longer imports format; api and api/config now depend on cli only.
ManagedByAnnotation, Name and IsManagedBy describe Kubernetes object
annotations and api.DefaultAnnotations is their main consumer, so they
belong in api rather than in internal/cli, which is now limited to
Error, exit codes and command hints.
missingChildren, exitIfErrorf and the flag placeholder interpolation
are kong parser plumbing used by main.go only; format now contains
nothing but output formatting.
TestLayering enumerates the packages of the module and checks their
imports against the layering the restructure established: api/... uses
only api/... and internal/cli, internal/cli, internal/format and
internal/logbox use nothing else of the module, and verbs are imported
by main and other verbs only. Test files may additionally import
internal/test for fixtures.
@thde
thde force-pushed the thde/352-06-cli-format-split branch from 11b5f84 to ca7688c Compare October 9, 2026 09:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant