Skip to content

Keep stdout to a command's output - #68

Merged
JohannesRudolph merged 2 commits into
mainfrom
fix/stdout-data-only
Nov 4, 2026
Merged

JohannesRudolph merged 2 commits into
mainfrom
fix/stdout-data-only

Conversation

@JohannesRudolph

Copy link
Copy Markdown
Member

Every command already sends data to stdout and logs, prompts and errors to stderr. This makes that hold:

  • forbidigo rejects fmt.Print* and os.Stdout outside tests. A command writes to cmd.OutOrStdout() instead, which a test can capture.
  • ndjson truncation: a listing that fails part way leaves valid lines and exits non-zero. Unlike json, nothing in the stream shows the cut. The WriteList comment says so, and the agent skill tells agents to use set -o pipefail, since a pipe into jq hides the exit status.

task lint is clean; the rule fires on a planted fmt.Println and os.Stdout.

🤖 Generated with Claude Code

JohannesRudolph and others added 2 commits November 4, 2026 12:15
A command already writes its output to cmd.OutOrStdout() and everything
else to stderr. Nothing enforced it, so a stray fmt.Println would mix log
text into what a pipe reads. Tests stay exempt: their child processes
stand in for programs whose stdout is their output.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
json output stays unterminated when a listing fails, so it does not parse.
ndjson has no end to leave out, and a pipe into jq hides the exit status.
Tell agents to use pipefail.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@sonarqubecloud

sonarqubecloud Bot commented Nov 4, 2026

Copy link
Copy Markdown

@JohannesRudolph
JohannesRudolph marked this pull request as ready for review November 4, 2026 11:16
@meshcloud-gh-actions

Copy link
Copy Markdown

Coverage of the acceptance run against the meshStack backend, on ffc6d0612ef8a38d542ddbdd77dfc5bf9bad8721.

Scope Coverage
Unit tests 77.8%
Acceptance tests 55.3%
Combined 80.5%
Uncovered functions
client/api_key.go:52: meshApiKeyClient.Create 0.0%
client/api_key.go:56: meshApiKeyClient.Read 0.0%
client/api_key.go:60: meshApiKeyClient.Update 0.0%
client/api_key.go:64: meshApiKeyClient.Delete 0.0%
client/api_key_permissions.go:20: ApiKeyPermissions.AllCodes 0.0%
client/api_key_permissions.go:33: ApiKeyPermissions.WorkspaceCodes 0.0%
client/api_key_permissions.go:262: AllApiKeyPermissions 0.0%
client/api_key_permissions.go:266: WorkspacePermissionCodes 0.0%
client/building_block_definition.go:71: MeshBuildingBlockDefinitionApprovalPolicies.NothingRequiresApproval 0.0%
client/building_block_definition.go:82: DisabledSchedule 0.0%
client/building_block_definition.go:89: MeshBuildingBlockDefinitionSchedule.IsDisabled 0.0%
client/building_block_definition.go:93: MeshBuildingBlockDefinitionSpec.HasNeutralPolicies 0.0%
client/building_block_definition.go:97: MeshBuildingBlockDefinitionSpec.WithNeutralPolicies 0.0%
client/building_block_definition.go:166: meshBuildingBlockDefinitionClient.List 0.0%
client/building_block_definition.go:173: meshBuildingBlockDefinitionClient.Read 0.0%
client/building_block_definition.go:177: meshBuildingBlockDefinitionClient.Create 0.0%
client/building_block_definition.go:181: meshBuildingBlockDefinitionClient.Update 0.0%
client/building_block_definition.go:185: meshBuildingBlockDefinitionClient.Delete 0.0%
client/building_block_definition_version.go:100: MeshBuildingBlockType.TagInputTargets 0.0%
client/building_block_definition_version.go:245: meshBuildingBlockDefinitionVersionClient.Create 0.0%
client/building_block_definition_version.go:254: meshBuildingBlockDefinitionVersionClient.Update 0.0%
client/building_block_definition_version_implementation.go:80: MeshBuildingBlockDefinitionImplementation.InferType 0.0%
client/building_block_definition_version_implementation.go:94: MeshBuildingBlockDefinitionImplementation.MarshalJSON 0.0%
client/building_block_definition_version_implementation.go:107: *MeshBuildingBlockDefinitionImplementation.UnmarshalJSON 0.0%
client/building_block_runner.go:93: meshBuildingBlockRunnerClient.Create 0.0%
... and 132 more

covdata func names a method without its receiver, so an entry can belong to an implementation nothing selects rather than to a function the tests never reached. Open the file and line before reading one as a coverage gap.

@JohannesRudolph
JohannesRudolph merged commit b87fcc1 into main Nov 4, 2026
13 checks passed
@JohannesRudolph
JohannesRudolph deleted the fix/stdout-data-only branch November 4, 2026 15:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants