Skip to content

Support --json flag in rwx lint#371

Merged
robinaugh merged 1 commit intomainfrom
jrobinaugh/lint-json-flag
Feb 20, 2026
Merged

Support --json flag in rwx lint#371
robinaugh merged 1 commit intomainfrom
jrobinaugh/lint-json-flag

Conversation

@robinaugh
Copy link
Contributor

Summary

  • The global --json flag was ignored by rwx lint because it used its own local --output flag
  • Now rwx lint --json behaves identically to rwx lint -o json, consistent with other commands like run, sandbox, dispatch, etc.

Manual test plan

# Introduce a lint error (e.g., add an unknown key to a .rwx yaml file)

# Verify --json produces JSON output
rwx lint --json
# Expected: {"Diagnostics":[{"Severity":"error","Message":"...","FilePath":"...","Line":...,"Column":...}],"FileCount":...,"FixedCount":0}

# Verify -o json still works
rwx lint -o json
# Expected: same JSON output as above

# Verify --json overrides -o if both are passed
rwx lint -o oneline --json
# Expected: JSON output (--json takes precedence)

# Verify default output is unchanged without --json
rwx lint
# Expected: multiline format with human-readable diagnostics

# Verify clean files produce empty diagnostics in JSON
rwx lint --json
# Expected: {"Diagnostics":[],"FileCount":...,"FixedCount":0}

The global --json flag was ignored by the lint command because it used
its own local --output flag. Now --json overrides the output format to
json, matching the behavior of other commands like run, sandbox, etc.
@robinaugh robinaugh self-assigned this Feb 20, 2026
@robinaugh robinaugh marked this pull request as ready for review February 20, 2026 14:32
@robinaugh robinaugh merged commit 6ea5d50 into main Feb 20, 2026
1 check passed
@robinaugh robinaugh deleted the jrobinaugh/lint-json-flag branch February 20, 2026 14:34
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