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).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"patterns": "<patterns>",
"mode": "<mode>"
},
"name": "ensure_newline"
}
}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) |