Skip to content

Add YAML and .properties file format support#5

Closed
BLemine wants to merge 1 commit into
mainfrom
claude/add-yaml-properties-support-NdyMl
Closed

Add YAML and .properties file format support#5
BLemine wants to merge 1 commit into
mainfrom
claude/add-yaml-properties-support-NdyMl

Conversation

@BLemine

@BLemine BLemine commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Summary

Extends envguard to support YAML and Java .properties file formats in addition to .env files. This enables the tool to work with Spring Boot and Quarkus configuration files, with automatic format detection based on file extensions.

Key Changes

  • New parsers: Added ParseYAML() and ParseProps() functions to handle YAML and .properties formats
    • YAML parser flattens nested keys using dot notation (e.g., spring.datasource.url)
    • Properties parser handles standard key=value format with comment and empty line support
  • Format detection: Implemented DetectFormat() to infer file format from extension (.yml/.yaml → YAML, .properties → Props, default → Env)
  • Unified parsing: Added ParseAs() function that routes to the appropriate parser based on format
  • CLI updates: Added --format flag to check, sync, and validate commands for explicit format specification
  • Sync improvements: Updated sync logic to use format-appropriate line formatters (key= for properties/env, key: for YAML)
  • Documentation: Added comprehensive README section with Spring Boot and Quarkus examples
  • Example files: Added application.yml.example and application.properties.example as reference configurations

Implementation Details

  • YAML flattening uses recursive traversal with dot-notation prefixes for nested objects and numeric indices for arrays
  • Format detection defaults to "env" for unknown extensions, allowing flexibility with non-standard filenames when format is explicitly specified
  • The envLineFormatter() helper ensures synced files use the correct syntax for their format
  • All existing .env functionality remains unchanged; new formats are opt-in via explicit flags or file extensions

https://claude.ai/code/session_012vYQmPywDQDJSz25oVrcSd

@BLemine BLemine added the enhancement New feature or request label Apr 19, 2026
@BLemine BLemine closed this Apr 19, 2026
@BLemine BLemine deleted the claude/add-yaml-properties-support-NdyMl branch April 19, 2026 04:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants