Skip to content

Fully support YAML on fmt and lint --fix - #884

Merged
jviotti merged 6 commits into
mainfrom
yaml-changes
Sep 24, 2026
Merged

jviotti merged 6 commits into
mainfrom
yaml-changes

Conversation

@jviotti

@jviotti jviotti commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Review in cubic

@jviotti jviotti changed the title yaml changes Fully support YAML on fmt and lint --fix Sep 24, 2026

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

24 issues found across 58 files

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/format/pass_yaml_comments.clitest">

<violation number="1" location="test/format/pass_yaml_comments.clitest:15">
P3: This test omits `--verbose`, so it never checks the formatter's diagnostic output; run it verbosely and assert the expected stdout and stderr alongside the rewritten YAML.

(Based on your team's feedback about verbose stream assertions.)</violation>
</file>

<file name="test/lint/pass_lint_fix_yml.clitest">

<violation number="1" location="test/lint/pass_lint_fix_yml.clitest:11">
P2: This test never exercises verbose diagnostics for YAML autofix. Add `--verbose` and assert the expected stdout and stderr.

(Based on your team's feedback about capturing verbose test output.)</violation>
</file>

<file name="test/format/pass_yaml_flow_root.clitest">

<violation number="1" location="test/format/pass_yaml_flow_root.clitest:5">
P2: This test only exercises the silent path, so it misses regressions in verbose stdout/stderr reporting for YAML formatting. Run `fmt` with `--verbose` and assert the captured `1>`/`2>` output.

(Based on your team's feedback about capturing verbose command output.)</violation>
</file>

<file name="test/format/pass_yaml_crlf.sh">

<violation number="1" location="test/format/pass_yaml_crlf.sh:17">
P2: This non-verbose invocation checks only stdout, so unexpected stderr from a successful `fmt` run goes unnoticed. Run with `--verbose`, capture both streams, and assert their expected contents.

(Based on your team's feedback about capturing test output streams.)</violation>
</file>

<file name="test/format/pass_check_yaml.clitest">

<violation number="1" location="test/format/pass_check_yaml.clitest:8">
P3: This test checks only the exit status and misses unexpected stdout or stderr. Run with `--verbose` and assert the expected output streams, as the JSON check test does.

(Based on your team's feedback about capturing stdout and stderr in verbose tests.)</violation>
</file>

<file name="test/format/pass_extension_empty_yaml.clitest">

<violation number="1" location="test/format/pass_extension_empty_yaml.clitest:8">
P3: Run this test with `--verbose` and assert the captured output; as written, it never checks fmt’s per-file messages for the extensionless YAML file.

(Based on your team's feedback about capturing both output streams in verbose tests.)</violation>
</file>

<file name="test/format/pass_yaml_directory.clitest">

<violation number="1" location="test/format/pass_yaml_directory.clitest:16">
P2: This run checks only the empty default output, not which directory inputs `fmt` processed. Add `--verbose` and assert the expected output for both files.

(Based on your team's feedback about capturing verbose command output.)</violation>
</file>

<file name="test/format/pass_custom_extension_yaml.clitest">

<violation number="1" location="test/format/pass_custom_extension_yaml.clitest:7">
P3: This test checks only the silent default path, so regressions in `fmt`'s verbose output for custom-extension YAML go undetected. Run with `--verbose` and assert the expected output, including both streams.

(Based on your team's feedback about capturing verbose command output.)</violation>
</file>

<file name="test/format/pass_yaml_document_markers.clitest">

<violation number="1" location="test/format/pass_yaml_document_markers.clitest:10">
P2: Run this case with `--verbose` and assert the resulting stream output; the current invocation only covers the default silent path and misses verbose diagnostics.

(Based on your team's feedback about verbose test output.)</violation>
</file>

<file name="test/lint/pass_lint_fix_yaml.clitest">

<violation number="1" location="test/lint/pass_lint_fix_yaml.clitest:11">
P3: The two runs assert only one stream each, so unexpected output on the other stream passes unnoticed. Run both with `--verbose` and assert stdout and stderr for each.

(Based on your team's feedback about capturing both output streams.)</violation>
</file>

<file name="test/format/pass_yaml_idempotent.clitest">

<violation number="1" location="test/format/pass_yaml_idempotent.clitest:10">
P3: These runs only assert that non-verbose `fmt` produces no output, leaving its formatting diagnostics untested. Add `--verbose` to both invocations and assert the expected `Formatting:` stderr lines.

(Based on your team's feedback about capturing command output in silent tests.)</violation>
</file>

<file name="test/format/pass_yaml.clitest">

<violation number="1" location="test/format/pass_yaml.clitest:12">
P3: This test does not exercise the formatter's verbose output, so regressions in its progress diagnostics remain unverified. Run `fmt` with `--verbose` and assert the captured stdout and stderr.

(Based on your team's feedback about capturing stdout and stderr in verbose tests.)</violation>
</file>

<file name="test/lint/pass_lint_fix_extension_empty_yaml.clitest">

<violation number="1" location="test/lint/pass_lint_fix_extension_empty_yaml.clitest:13">
P3: This case does not assert verbose per-file output; add `--verbose` and assert the matched YAML file's `Linting:` line.

(Based on your team's feedback about verbose test output.)</violation>
</file>

<file name="test/format/pass_yaml_intact_mtime.clitest">

<violation number="1" location="test/format/pass_yaml_intact_mtime.clitest:12">
P2: This silent-mode invocation leaves the formatter's verbose reporting path untested; run it with `--verbose` and assert the expected stdout and stderr.

(Based on your team's feedback about verbose test output capture.)</violation>
</file>

<file name="test/lint/pass_lint_fix_yaml_no_changes.clitest">

<violation number="1" location="test/lint/pass_lint_fix_yaml_no_changes.clitest:12">
P3: This checks only the quiet invocation, so it misses regressions in verbose diagnostics for a clean YAML schema. Add a `--verbose` run and assert the expected output from both streams.

(Based on your team's feedback about verbose test output.)</violation>
</file>

<file name="test/lint/pass_lint_fix_without_extension_yaml.clitest">

<violation number="1" location="test/lint/pass_lint_fix_without_extension_yaml.clitest:11">
P2: This successful `--fix` test is non-verbose, so it cannot catch unexpected diagnostic output exposed in verbose mode. Add `--verbose` and assert the expected stdout and stderr.

(Based on your team's feedback about capturing command output in verbose tests.)</violation>
</file>

<file name="test/lint/pass_lint_fix_format_yaml_keep_ordering.clitest">

<violation number="1" location="test/lint/pass_lint_fix_format_yaml_keep_ordering.clitest:11">
P3: This case checks only default output, leaving verbose YAML lint reporting untested. Run it with `--verbose` and assert the resulting stdout and stderr.</violation>
</file>

<file name="test/format/pass_yaml_scalar_styles.clitest">

<violation number="1" location="test/format/pass_yaml_scalar_styles.clitest:14">
P3: This only verifies quiet-mode behavior and never checks the verbose diagnostics for this YAML formatting path. Add a `--verbose` invocation and assert its stream-tagged output.

(Based on your team's feedback about capturing verbose output streams.) .</violation>
</file>

<file name="test/lint/pass_lint_fix_yaml_comments.clitest">

<violation number="1" location="test/lint/pass_lint_fix_yaml_comments.clitest:14">
P3: This only checks the default progress marker; run with `--verbose` and assert both streams to catch regressions in lint/fix reporting.

(Based on your team's feedback about verbose test output.)</violation>
</file>

<file name="test/lint/pass_lint_fix_format_yaml.clitest">

<violation number="1" location="test/lint/pass_lint_fix_format_yaml.clitest:11">
P3: This success case checks only stderr, so unexpected stdout can go unnoticed; run it with `--verbose` and assert both streams.

(Based on your team's feedback about capturing stdout and stderr in verbose tests.)</violation>
</file>

<file name="test/format/pass_yml.clitest">

<violation number="1" location="test/format/pass_yml.clitest:7">
P3: Run this case with `--verbose` and assert the expected output on both streams; the current assertion misses regressions in formatter status output.

(Based on your team's feedback about capturing verbose command output.)</violation>
</file>

<file name="test/lint/pass_lint_openapi_fix_yaml.clitest">

<violation number="1" location="test/lint/pass_lint_openapi_fix_yaml.clitest:18">
P3: This test omits `--verbose`, so it cannot catch regressions in lint's verbose output; run it verbosely and assert the expected stdout and stderr.

(Based on your team's feedback about verbose test output.)</violation>
</file>

<file name="test/format/pass_without_extension_yaml.clitest">

<violation number="1" location="test/format/pass_without_extension_yaml.clitest:11">
P2: This test only asserts the silent default path and misses regressions in `fmt`'s verbose output. Run with `--verbose` and assert the expected stdout and stderr.

(Based on your team's feedback about capturing verbose command output.)</violation>
</file>

<file name="test/lint/pass_lint_fix_custom_extension_yaml.clitest">

<violation number="1" location="test/lint/pass_lint_fix_custom_extension_yaml.clitest:11">
P3: This test checks only the default `.` status, so it misses regressions in verbose processing output for custom-extension YAML. Add `--verbose` and assert the complete output streams.</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

title: I should not be moved up
EOF

RUN lint schema.yml --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This test never exercises verbose diagnostics for YAML autofix. Add --verbose and assert the expected stdout and stderr.

(Based on your team's feedback about capturing verbose test output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/lint/pass_lint_fix_yml.clitest, line 11:

<comment>This test never exercises verbose diagnostics for YAML autofix. Add `--verbose` and assert the expected stdout and stderr.

(Based on your team's feedback about capturing verbose test output.) </comment>

<file context>
@@ -0,0 +1,28 @@
+title: I should not be moved up
+EOF
+
+RUN lint schema.yml --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0
+
+WRITE expected_file_0.txt UNTIL EOF
</file context>

{ $schema: "https://json-schema.org/draft/2020-12/schema", type: string, title: Flow }
EOF

RUN fmt schema.yaml STDIN /dev/null IN . INTO result.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This test only exercises the silent path, so it misses regressions in verbose stdout/stderr reporting for YAML formatting. Run fmt with --verbose and assert the captured 1>/2> output.

(Based on your team's feedback about capturing verbose command output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/pass_yaml_flow_root.clitest, line 5:

<comment>This test only exercises the silent path, so it misses regressions in verbose stdout/stderr reporting for YAML formatting. Run `fmt` with `--verbose` and assert the captured `1>`/`2>` output.

(Based on your team's feedback about capturing verbose command output.) </comment>

<file context>
@@ -0,0 +1,16 @@
+{ $schema: "https://json-schema.org/draft/2020-12/schema", type: string, title: Flow }
+EOF
+
+RUN fmt schema.yaml STDIN /dev/null IN . INTO result.txt EXPECTING 0
+
+WRITE expected.txt UNTIL EOF
</file context>

EOF
awk '{ printf "%s\r\n", $0 }' "$TMP/lf.yaml" > "$TMP/schema.yaml"

"$1" fmt "$TMP/schema.yaml" > "$TMP/output.txt"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This non-verbose invocation checks only stdout, so unexpected stderr from a successful fmt run goes unnoticed. Run with --verbose, capture both streams, and assert their expected contents.

(Based on your team's feedback about capturing test output streams.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/pass_yaml_crlf.sh, line 17:

<comment>This non-verbose invocation checks only stdout, so unexpected stderr from a successful `fmt` run goes unnoticed. Run with `--verbose`, capture both streams, and assert their expected contents.

(Based on your team's feedback about capturing test output streams.) </comment>

<file context>
@@ -0,0 +1,31 @@
+EOF
+awk '{ printf "%s\r\n", $0 }' "$TMP/lf.yaml" > "$TMP/schema.yaml"
+
+"$1" fmt "$TMP/schema.yaml" > "$TMP/output.txt"
+
+cat << 'EOF' > "$TMP/expected_output.txt"
</file context>

Comment thread test/format/fail_yaml_multidocument_stdin.clitest
}
EOF

RUN fmt schemas STDIN /dev/null IN . INTO result.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This run checks only the empty default output, not which directory inputs fmt processed. Add --verbose and assert the expected output for both files.

(Based on your team's feedback about capturing verbose command output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/pass_yaml_directory.clitest, line 16:

<comment>This run checks only the empty default output, not which directory inputs `fmt` processed. Add `--verbose` and assert the expected output for both files.

(Based on your team's feedback about capturing verbose command output.) </comment>

<file context>
@@ -0,0 +1,40 @@
+}
+EOF
+
+RUN fmt schemas STDIN /dev/null IN . INTO result.txt EXPECTING 0
+
+WRITE expected.txt UNTIL EOF
</file context>

const: bar
EOF

RUN lint schema.yaml --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This only checks the default progress marker; run with --verbose and assert both streams to catch regressions in lint/fix reporting.

(Based on your team's feedback about verbose test output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/lint/pass_lint_fix_yaml_comments.clitest, line 14:

<comment>This only checks the default progress marker; run with `--verbose` and assert both streams to catch regressions in lint/fix reporting.

(Based on your team's feedback about verbose test output.) </comment>

<file context>
@@ -0,0 +1,34 @@
+    const: bar
+EOF
+
+RUN lint schema.yaml --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0
+
+WRITE expected_file_0.txt UNTIL EOF
</file context>

title: I should not be moved up
EOF

RUN lint schema.yaml --fix --format STDIN /dev/null IN . INTO result_0.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This success case checks only stderr, so unexpected stdout can go unnoticed; run it with --verbose and assert both streams.

(Based on your team's feedback about capturing stdout and stderr in verbose tests.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/lint/pass_lint_fix_format_yaml.clitest, line 11:

<comment>This success case checks only stderr, so unexpected stdout can go unnoticed; run it with `--verbose` and assert both streams.

(Based on your team's feedback about capturing stdout and stderr in verbose tests.) </comment>

<file context>
@@ -0,0 +1,52 @@
+title: I should not be moved up
+EOF
+
+RUN lint schema.yaml --fix --format STDIN /dev/null IN . INTO result_0.txt EXPECTING 0
+
+WRITE expected_file_0.txt UNTIL EOF
</file context>

title: Hello World
EOF

RUN fmt schema.yml STDIN /dev/null IN . INTO result.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: Run this case with --verbose and assert the expected output on both streams; the current assertion misses regressions in formatter status output.

(Based on your team's feedback about capturing verbose command output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/pass_yml.clitest, line 7:

<comment>Run this case with `--verbose` and assert the expected output on both streams; the current assertion misses regressions in formatter status output.

(Based on your team's feedback about capturing verbose command output.) </comment>

<file context>
@@ -0,0 +1,20 @@
+title: Hello World
+EOF
+
+RUN fmt schema.yml STDIN /dev/null IN . INTO result.txt EXPECTING 0
+
+WRITE expected.txt UNTIL EOF
</file context>

enum: [ foo ]
EOF

RUN lint api.yaml --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This test omits --verbose, so it cannot catch regressions in lint's verbose output; run it verbosely and assert the expected stdout and stderr.

(Based on your team's feedback about verbose test output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/lint/pass_lint_openapi_fix_yaml.clitest, line 18:

<comment>This test omits `--verbose`, so it cannot catch regressions in lint's verbose output; run it verbosely and assert the expected stdout and stderr.

(Based on your team's feedback about verbose test output.) </comment>

<file context>
@@ -0,0 +1,42 @@
+      enum: [ foo ]
+EOF
+
+RUN lint api.yaml --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0
+
+WRITE expected_file_0.txt UNTIL EOF
</file context>

title: I should not be moved up
EOF

RUN lint schema.custom --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This test checks only the default . status, so it misses regressions in verbose processing output for custom-extension YAML. Add --verbose and assert the complete output streams.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/lint/pass_lint_fix_custom_extension_yaml.clitest, line 11:

<comment>This test checks only the default `.` status, so it misses regressions in verbose processing output for custom-extension YAML. Add `--verbose` and assert the complete output streams.</comment>

<file context>
@@ -0,0 +1,28 @@
+title: I should not be moved up
+EOF
+
+RUN lint schema.custom --fix STDIN /dev/null IN . INTO result_0.txt EXPECTING 0
+
+WRITE expected_file_0.txt UNTIL EOF
</file context>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 16 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/format/fail_json_multidocument_stdin.clitest">

<violation number="1" location="test/format/fail_json_multidocument_stdin.clitest:7">
P2: This test checks only the human-readable error, leaving the `--json` path for multi-document stdin untested. Add a matching `fmt - --json` invocation and assert its structured error.

(Based on your team's feedback about JSON variants for error tests.)</violation>
</file>

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

EOF

// Not supported
RUN fmt - STDIN stdin_0 IN . INTO result.txt EXPECTING 3

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This test checks only the human-readable error, leaving the --json path for multi-document stdin untested. Add a matching fmt - --json invocation and assert its structured error.

(Based on your team's feedback about JSON variants for error tests.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/fail_json_multidocument_stdin.clitest, line 7:

<comment>This test checks only the human-readable error, leaving the `--json` path for multi-document stdin untested. Add a matching `fmt - --json` invocation and assert its structured error.

(Based on your team's feedback about JSON variants for error tests.) </comment>

<file context>
@@ -0,0 +1,14 @@
+EOF
+
+// Not supported
+RUN fmt - STDIN stdin_0 IN . INTO result.txt EXPECTING 3
+
+WRITE expected.txt UNTIL EOF
</file context>

Comment thread test/CMakeLists.txt Outdated
@augmentcode

augmentcode Bot commented Sep 24, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: This PR adds YAML round-trip support to schema formatting and lint autofixes.
Changes:

  • Updates the Core dependency with YAML parsing and serialization enhancements.
  • Preserves YAML comments, scalar styles, document markers, anchors, tags, flow formatting, BOMs, and line endings.
  • Routes fmt and lint --fix through preserved YAML metadata when reading and writing schemas.
  • Enables YAML and YML files, custom/no extensions, directory scans, and stdin for these workflows.
  • Rejects multi-document YAML where a single in-place output is required.
  • Updates CLI help text to advertise the newly supported YAML behavior.
  • Adds coverage for formatting, checking, lint fixes, comments, indentation, CRLF, and OpenAPI YAML.
Technical Notes: JSON output continues to use the existing pretty-printer, while YAML output uses the round-trip serializer and avoids rewriting unchanged files.

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

// document root sits one level further out than the leftmost column.
// See https://yaml.org/spec/1.2.2/#8111-block-indentation-indicator
content_indent = this->block_indent_ == SIZE_MAX
? explicit_indent - 1

@augmentcode augmentcode Bot Sep 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A root document node has indentation level 0, so an explicit |2 requires two leading content spaces under YAML §8.1.1.1. Subtracting one makes valid input such as |2\n text\n retain one leading space in its parsed value, rather than parsing it as "text\n".

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

input.data(),
std::min(lexer.bom_length() + parser.position(), input.size())};
roundtrip.byte_order_mark = lexer.bom_length() > 0;
roundtrip.carriage_returns = document.find("\r\n") != document.npos;

@augmentcode augmentcode Bot Sep 24, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A YAML line break may be a lone \r, which the lexer already treats as a line break, but this only records CRLF and therefore fmt/lint --fix rewrites CR-only YAML with LF endings. That violates the new round-trip preservation behavior for a valid input presentation.

Severity: medium

Fix This in Augment

🤖 Was this useful? React with 👍 or 👎, or 🚀 if it prevented an incident/outage.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 15 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/lint/pass_lint_stdin_multidocument.clitest">

<violation number="1" location="test/lint/pass_lint_stdin_multidocument.clitest:19">
P2: This test checks only text diagnostics, leaving JSON reporting for multi-document stdin untested. Add an equivalent `--json` invocation and assert its structured output.

(Based on your team's feedback about JSON variants for error tests.)</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/input.h Outdated
Comment thread src/input.h Outdated
EOF

// Validation failure
RUN lint - STDIN stdin_input IN . INTO result_0.txt EXPECTING 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This test checks only text diagnostics, leaving JSON reporting for multi-document stdin untested. Add an equivalent --json invocation and assert its structured output.

(Based on your team's feedback about JSON variants for error tests.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/lint/pass_lint_stdin_multidocument.clitest, line 19:

<comment>This test checks only text diagnostics, leaving JSON reporting for multi-document stdin untested. Add an equivalent `--json` invocation and assert its structured output.

(Based on your team's feedback about JSON variants for error tests.) </comment>

<file context>
@@ -0,0 +1,36 @@
+EOF
+
+// Validation failure
+RUN lint - STDIN stdin_input IN . INTO result_0.txt EXPECTING 2
+
+WRITE expected_0.txt UNTIL EOF
</file context>

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 25 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/format/pass_yaml_anchors.clitest">

<violation number="1" location="test/format/pass_yaml_anchors.clitest:12">
P3: This empty-output assertion skips verbose diagnostics, so it cannot catch regressions in the command's verbose output. Run `fmt` with `--verbose` and assert the expected stdout and stderr lines.

(Based on your team's feedback about verbose test output.)</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

Comment thread src/input.h Outdated
Comment thread test/format/fail_without_extension_yaml_multidocument.clitest Outdated
last: *name
EOF

RUN fmt schema.yaml STDIN /dev/null IN . INTO result.txt EXPECTING 0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3: This empty-output assertion skips verbose diagnostics, so it cannot catch regressions in the command's verbose output. Run fmt with --verbose and assert the expected stdout and stderr lines.

(Based on your team's feedback about verbose test output.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/format/pass_yaml_anchors.clitest, line 12:

<comment>This empty-output assertion skips verbose diagnostics, so it cannot catch regressions in the command's verbose output. Run `fmt` with `--verbose` and assert the expected stdout and stderr lines.

(Based on your team's feedback about verbose test output.) </comment>

<file context>
@@ -0,0 +1,32 @@
+  last: *name
+EOF
+
+RUN fmt schema.yaml STDIN /dev/null IN . INTO result.txt EXPECTING 0
+
+WRITE expected.txt UNTIL EOF
</file context>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti

jviotti commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

@cubic-dev-ai review

@cubic-dev-ai

cubic-dev-ai Bot commented Sep 24, 2026

Copy link
Copy Markdown

@cubic-dev-ai review

@jviotti I have started the AI code review. It will take a few minutes to complete.

@jviotti

jviotti commented Sep 24, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Sep 24, 2026

Copy link
Copy Markdown

This pull request is abnormally large and would use a significant amount of tokens to review. If you still wish to review it, comment "augment review" and we will review it.

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 77 files

Requires human review: Auto-approval blocked because this review re-detected 1 unresolved issue already reported by Cubic.

Re-trigger cubic

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 issue found across 5 files (changes from recent commits).

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="test/validate/fail_yaml_multi_empty_document.clitest">

<violation number="1" location="test/validate/fail_yaml_multi_empty_document.clitest:21">
P2: This failure test checks only human-readable output, leaving the JSON error representation for an empty YAML document untested. Add a corresponding `validate --json` invocation and assert its structured output.

(Based on your team's feedback about JSON variants for failure tests.)</violation>
</file>

Tip: Review your code locally with the cubic CLI to iterate faster.

Re-trigger cubic

EOF

// Validation failure
RUN validate schema.json instance.yaml STDIN /dev/null IN . INTO result_0.txt EXPECTING 2

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: This failure test checks only human-readable output, leaving the JSON error representation for an empty YAML document untested. Add a corresponding validate --json invocation and assert its structured output.

(Based on your team's feedback about JSON variants for failure tests.)

View Feedback

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At test/validate/fail_yaml_multi_empty_document.clitest, line 21:

<comment>This failure test checks only human-readable output, leaving the JSON error representation for an empty YAML document untested. Add a corresponding `validate --json` invocation and assert its structured output.

(Based on your team's feedback about JSON variants for failure tests.) </comment>

<file context>
@@ -0,0 +1,41 @@
+EOF
+
+// Validation failure
+RUN validate schema.json instance.yaml STDIN /dev/null IN . INTO result_0.txt EXPECTING 2
+
+WRITE expected_0.txt UNTIL EOF
</file context>

Signed-off-by: Juan Cruz Viotti <jv@jviotti.com>
@jviotti
jviotti merged commit 0698e15 into main Sep 24, 2026
16 checks passed
@jviotti
jviotti deleted the yaml-changes branch September 24, 2026 20:03
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.

1 participant