ensure_newline
Ensure files end with POSIX-compliant newline characters. Supports check, fix, and validate modes for development or CI/CD.
Instructions
Validate and fix POSIX newline compliance. Checks if files end with proper newline characters. Modes: check (report only), fix (auto-correct), validate (error if non-compliant for CI/CD).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Working directory (defaults to project root) | |
| mode | Yes | check=report only, fix=auto-correct, validate=error if non-compliant | |
| exclude | No | Patterns to exclude (e.g., ['node_modules/**', '*.min.js']) | |
| patterns | Yes | Glob patterns for files to check (e.g., ['src/**/*.ts', '*.md']) | |
| fileTypes | No | File types to process (e.g., ['*.ts', '*.go', '*.md']) | |
| skipBinary | No | Skip binary files automatically (default: true) | |
| maxFileSizeMB | No | Maximum file size to process in MB (default: 10) |