Skip to content

Conversation

@pomcho555
Copy link
Owner

Summary

  • Implemented complete RSP (Raw String Peeler) CLI tool as specified in specs/README.md
  • Added CLI interface with clap for the peel command
  • Implemented YAML parsing and string unescaping functionality
  • Added custom error handling and proper output formatting
  • Created documentation and test data

Features

  • CLI Interface: rsp peel <file> with optional -o output flag
  • YAML Processing: Parses ConfigMaps and processes escaped strings in data section
  • Smart Detection: Automatically processes keys ending with .yaml, .yml, .json, .toml
  • String Unescaping: Handles \n, \t, \r, \", \\ escape sequences
  • Pipe Syntax: Converts multiline strings to YAML pipe (|) format
  • Error Handling: Comprehensive error types for IO, YAML parsing, and processing errors

Test Plan

  • Basic functionality: cargo run -- peel tests/test_data/sample_configmap.yaml
  • Help commands: cargo run -- --help and cargo run -- peel --help
  • Version command: cargo run -- --version
  • Output to file: cargo run -- peel input.yaml -o output.yaml
  • Build verification: cargo build and cargo build --release

🤖 Generated with Claude Code

pomcho555 and others added 2 commits July 27, 2025 00:47
This commit adds a complete Rust CLI tool that converts escaped strings
embedded in YAML ConfigMaps into properly formatted multi-line strings
using YAML's pipe (|) syntax.

Features:
- CLI interface with clap supporting peel command
- YAML parsing and processing with serde_yaml
- String unescaping for newlines, tabs, quotes, and backslashes
- Automatic detection of files by extension (.yaml, .yml, .json, .toml)
- Output to stdout or specified file with -o option
- Comprehensive error handling with custom error types
- Sample test data and documentation

The tool successfully transforms hard-to-read escaped JSON/YAML/TOML strings
into human-readable format as specified in specs/README.md.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@pomcho555 pomcho555 self-assigned this Jul 26, 2025
This commit adds extensive testing coverage and automated CI/CD as specified
in the updated requirements:

**Test Suite (31 tests total):**
- Unit tests (tests/peeler_tests.rs): Core functionality, string processing,
  file handling, and YAML serialization
- Integration tests (tests/cli_tests.rs): CLI commands, argument parsing,
  file I/O, and error conditions
- Edge case tests (tests/edge_cases_tests.rs): Malformed input, large strings,
  unicode content, binary files, and unexpected scenarios

**CI/CD Pipeline (.github/workflows/ci.yml):**
- Build verification on ubuntu-latest
- Complete test suite execution
- Code formatting checks (rustfmt)
- Linting with clippy (zero warnings)
- Security audit with cargo-audit
- Release build verification

**Infrastructure:**
- Added library structure (src/lib.rs) for test imports
- Made key methods public for unit testing
- Added tempfile dependency for test isolation
- Updated documentation with testing instructions

All tests pass successfully, providing robust coverage for both normal
operation and edge cases.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@pomcho555 pomcho555 added documentation Improvements or additions to documentation enhancement New feature or request labels Jul 26, 2025
pomcho555 and others added 10 commits July 27, 2025 01:36
This commit addresses all CI/CD pipeline failures by fixing:

**Formatting Issues:**
- Applied cargo fmt --all to ensure consistent code formatting
- Fixed line endings and spacing throughout codebase

**Clippy Warnings:**
- Added Default trait implementations for Cli and Peeler structs
- Removed needless borrows in function calls (.args(&[...]) → .args([...]))
- Removed needless borrows in HashMap lookups (.get(&key) → .get(key))
- Collapsed nested if-let patterns for better readability
- Fixed all clippy warnings to pass --deny warnings

**Local CI Verification:**
- Verified all checks pass locally as specified in development guidelines
- Build: ✅ cargo build --verbose
- Tests: ✅ cargo test --all --verbose (31/31 tests passing)
- Format: ✅ cargo fmt --all -- --check
- Lint: ✅ cargo clippy --all-targets --all-features -- -D warnings
- Audit: ✅ cargo audit (no vulnerabilities)

All local checks now mirror the GitHub Actions CI pipeline exactly,
ensuring smooth integration and preventing CI failures.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fixed 3 clippy warnings about format strings that can use inline variables:
- Updated println\! in output file path display
- Updated print\! for stdout output
- Updated format\! in YAML key serialization

All tests passing (31/31) and clippy warnings resolved.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
Fixed all uninlined format argument warnings in test files:
- tests/cli_tests.rs: Updated write\! macros to use inline variables
- tests/edge_cases_tests.rs: Updated format\! macro to use inline variables
- tests/peeler_tests.rs: Updated write\! macros to use inline variables

All 31 tests passing and no Clippy warnings remaining.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add peel_stdin() method to Peeler for reading from stdin
- Make file argument optional in CLI, defaulting to stdin when not provided
- Add comprehensive tests for stdin functionality with and without output files
- Support pipe operations: cat file.yaml | rsp peel
- Maintain backward compatibility with existing file input
- Update help text to indicate stdin usage when file not provided

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
- Add TOC placeholder section to README.md
- Add contents: write permissions to TOC workflow
- Fix TARGET_PATHS to only include existing README.md file

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <[email protected]>
@pomcho555 pomcho555 merged commit 894ac18 into main Jul 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants