Skip to content

Conversation

@joshfried-aws
Copy link
Contributor

Enhanced YAML Boolean Parsing for CloudFormation Guard

Summary

This PR enhances the YAML loader to properly handle all standard YAML boolean values. The implementation now correctly recognizes the full range of YAML 1.1 boolean representations
including:

• true, yes, on, y (and their case variations) as boolean true
• false, no, off, n (and their case variations) as boolean false

Problem

Previously, the loader was using Rust's standard parse::() which only recognizes "true" and "false" strings. This limited functionality prevented CloudFormation Guard from correctly
parsing YAML files that use alternative boolean representations that are valid in the YAML specification.

Solution

The implementation now includes:
• A custom boolean parser that handles all YAML 1.1 boolean representations

Testing

Added extensive unit tests that verify:
• All valid YAML boolean representations are correctly parsed
• Case insensitivity is properly handled
• The parser correctly distinguishes between boolean values and other types

Copy link

@mrinaudo-aws mrinaudo-aws left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link

@racicot-amzn racicot-amzn left a comment

Choose a reason for hiding this comment

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

LGTM!

@joshfried-aws joshfried-aws merged commit e130171 into aws-cloudformation:main May 6, 2025
18 checks passed
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.

4 participants