Skip to content

Fix array item rendering in LineYamlErrorRenderer#2904

Merged
predic8 merged 1 commit intomasterfrom
yaml-error-array-indent
Apr 8, 2026
Merged

Fix array item rendering in LineYamlErrorRenderer#2904
predic8 merged 1 commit intomasterfrom
yaml-error-array-indent

Conversation

@christiangoerdes
Copy link
Copy Markdown
Collaborator

@christiangoerdes christiangoerdes commented Apr 8, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Improved error message formatting and indentation for YAML configurations, with enhanced handling of array elements to provide clearer error visualization.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 4bb241be-c0ea-4bda-b76b-d044320fd7de

📥 Commits

Reviewing files that changed from the base of the PR and between cd97d5d and e1bfdda.

📒 Files selected for processing (1)
  • annot/src/main/java/com/predic8/membrane/annot/yaml/error/LineYamlErrorRenderer.java

📝 Walkthrough

Walkthrough

The YAML error renderer's markLinesWithPrefix method was updated to properly handle array element markers. When an error marker indicates an array element (line starts with - ), the renderer now preserves the list dash in the output by applying the marker's indentation followed by the dash, rather than using the previously computed indentation for non-array cases.

Changes

Cohort / File(s) Summary
YAML Error Rendering
annot/src/main/java/com/predic8/membrane/annot/yaml/error/LineYamlErrorRenderer.java
Updated first content line handling after error marker detection to preserve array element dashes (- ) when marker line represents a list item, using marker indentation; non-array cases continue using previously computed indentation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

A dash preserved in YAML's way,
Where errors mark the list's array,
The indentation finds its place,
Each element shown with proper grace! 🐰✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: fixing array item rendering behavior in the LineYamlErrorRenderer class.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch yaml-error-array-indent

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@christiangoerdes christiangoerdes linked an issue Apr 8, 2026 that may be closed by this pull request
@membrane-ci-server
Copy link
Copy Markdown

This pull request needs "/ok-to-test" from an authorized committer.

@christiangoerdes christiangoerdes marked this pull request as ready for review April 8, 2026 10:23
@christiangoerdes
Copy link
Copy Markdown
Collaborator Author

/ok-to-test

@predic8 predic8 merged commit b52c345 into master Apr 8, 2026
5 checks passed
@predic8 predic8 deleted the yaml-error-array-indent branch April 8, 2026 13:29
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.

YAML error indicator

2 participants