{"id":32861288,"url":"https://github.com/avnercohen/yamllint-rs","last_synced_at":"2026-01-20T16:54:10.136Z","repository":{"id":322801802,"uuid":"1090472287","full_name":"AvnerCohen/yamllint-rs","owner":"AvnerCohen","description":"A linter for YAML files, in rust.","archived":false,"fork":false,"pushed_at":"2025-11-06T11:10:49.000Z","size":117,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-11-06T13:05:43.623Z","etag":null,"topics":["lint","linter","rust","rust-crate","yaml"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AvnerCohen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-05T17:59:10.000Z","updated_at":"2025-11-06T11:10:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/AvnerCohen/yamllint-rs","commit_stats":null,"previous_names":["avnercohen/yamllint-rs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/AvnerCohen/yamllint-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvnerCohen%2Fyamllint-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvnerCohen%2Fyamllint-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvnerCohen%2Fyamllint-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvnerCohen%2Fyamllint-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AvnerCohen","download_url":"https://codeload.github.com/AvnerCohen/yamllint-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AvnerCohen%2Fyamllint-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":283418034,"owners_count":26832617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-11-08T02:00:06.281Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lint","linter","rust","rust-crate","yaml"],"created_at":"2025-11-08T21:01:04.898Z","updated_at":"2025-11-08T21:02:12.586Z","avatar_url":"https://github.com/AvnerCohen.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# yamllint-rs\n\nA YAML linter written in Rust, inspired by the Python [yamllint](https://github.com/adrienverge/yamllint) package.\n\n## Credits\n\nThis project is a Rust implementation of [yamllint](https://github.com/adrienverge/yamllint) by [Adrien Vergé](https://github.com/adrienverge). The original yamllint serves as the reference implementation for all rules, configurations, and behavior. This Rust version aims to provide the same functionality with improved performance through parallel processing and native compilation.\n\n## Features\n\n- **Fast YAML linting** powered by Rust with parallel processing\n- **23 configurable rules** covering formatting, content, and YAML-specific features\n- **Automatic fixes** for fixable issues with `--fix` flag\n- **Configuration support** with automatic discovery of `.yamllint` files\n- **Compatible** with original yamllint configuration format\n- **Git-aware** processing that respects `.gitignore` files\n- **Colored output** with automatic detection of terminal capabilities\n- **Command-line interface** with flexible options\n- **Library API** for integration into Rust projects\n\n## Installation\n\n### From Source\n\n```bash\ngit clone https://github.com/AvnerCohen/yamllint-rs\ncd yamllint-rs\ncargo build --release\n```\n\n### Using Cargo\n\n```bash\ncargo install yamllint-rs\n```\n\n### Using Docker\n\nyamllint-rs is available as a Docker image on Docker Hub. No installation required - just run it directly:\n\n```bash\n# Lint a single file\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:latest file.yaml\n\n# Lint multiple files\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:latest file1.yaml file2.yaml\n\n# Recursive directory processing\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:latest --recursive .\n\n# Verbose output\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:latest --verbose file.yaml\n\n# Use custom config file\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:latest --config .yamllint.yaml file.yaml\n\n# Automatically fix fixable issues\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:latest --fix file.yaml\n\n# Use specific version\ndocker run --rm -v $(pwd):/work -w /work yamllint-rs:v0.1.1 file.yaml\n```\n\n**Note:** Replace `yamllint-rs` with your Docker Hub username/organization if the image is published under a different namespace (e.g., `yourusername/yamllint-rs:latest`).\n\n## Usage\n\n### Command Line\n\n```bash\n# Lint a single file\nyamllint-rs file.yaml\n\n# Lint multiple files (processed in parallel)\nyamllint-rs file1.yaml file2.yaml file3.yaml\n\n# Recursive directory processing\nyamllint-rs --recursive directory/\n\n# Verbose output\nyamllint-rs --verbose file.yaml\n\n# Use custom config file\nyamllint-rs --config .yamllint.yaml file.yaml\n\n# Automatically fix fixable issues\nyamllint-rs --fix file.yaml\n\n# Set output format (standard, colored, or auto)\nyamllint-rs --format colored file.yaml\n\n# Disable progress updates\nyamllint-rs --no-progress --recursive directory/\n\n# Combine options\nyamllint-rs -r --verbose --fix directory/\n```\n\n### Command-Line Options\n\n- `files` - YAML file(s) to lint (positional arguments)\n- `-r, --recursive` - Process directories recursively\n- `-v, --verbose` - Enable verbose output\n- `-c, --config \u003cpath\u003e` - Path to configuration file\n- `--fix` - Automatically fix fixable issues\n- `-f, --format \u003cformat\u003e` - Output format: `standard`, `colored`, or `auto` (default: `auto`)\n- `--no-progress` - Disable progress updates during processing\n\n### Configuration\n\nyamllint-rs automatically discovers configuration files by searching for `.yamllint` in the current directory and parent directories. You can also specify a custom path with `--config`.\n\n```bash\n# Automatic discovery (searches for .yamllint in current and parent dirs)\nyamllint-rs file.yaml\n\n# Explicit config file\nyamllint-rs --config custom-config.yaml file.yaml\n```\n\nThe tool supports both the original yamllint configuration format and the native format. See the [Rules.md](Rules.md) file for detailed rule documentation.\n\nExample `.yamllint` configuration:\n\n```yaml\nrules:\n  line-length:\n    max: 120\n  indentation:\n    spaces: 4\n    ignore: |\n      *.template.yaml\n      generated/\n  truthy:\n    allowed-values: ['true', 'false', 'yes', 'no']\n```\n\n### Library API\n\n```rust\nuse yamllint_rs::{FileProcessor, ProcessingOptions, OutputFormat};\n\n// Process a single file\nlet options = ProcessingOptions {\n    recursive: false,\n    verbose: false,\n    output_format: OutputFormat::Colored,\n    show_progress: true,\n};\n\nlet processor = FileProcessor::with_default_rules(options);\nlet result = processor.process_file(\"path/to/file.yaml\")?;\n\nfor (issue, rule_name) in result.issues {\n    println!(\"{}:{} - {} ({})\", \n        issue.line, \n        issue.column, \n        issue.message, \n        rule_name\n    );\n}\n\n// Process directory recursively\nlet processor = FileProcessor::with_default_rules(options);\nlet issue_count = processor.process_directory(\"directory/\")?;\n\n// Use custom configuration\nuse yamllint_rs::{load_config, discover_config_file};\n\nif let Some(config_path) = discover_config_file() {\n    let config = load_config(config_path)?;\n    let processor = FileProcessor::with_config(options, config);\n    processor.process_file(\"file.yaml\")?;\n}\n\n// Fix mode\nlet processor = FileProcessor::with_fix_mode(options);\nprocessor.process_file(\"file.yaml\")?;\n```\n\n## Development\n\n```bash\n# Build the project\ncargo build\n\n# Build optimized release binary\ncargo build --release\n\n# Run tests\ncargo test\n\n# Run with debug output\ncargo run -- --verbose file.yaml\n\n# Format code\ncargo fmt\n\n# Run clippy linter\ncargo clippy\n\n# Run benchmarks\ncargo bench\n```\n\n## Features in Detail\n\n### Parallel Processing\n\nyamllint-rs processes multiple files in parallel for better performance. Files are automatically processed in parallel when:\n- Multiple files are specified on the command line\n- Recursive directory processing finds multiple YAML files\n\n### Automatic Fixes\n\nMany rules support automatic fixes. When using `--fix`, the tool will:\n1. Apply all fixable corrections\n2. Write the fixed content back to the file\n3. Report remaining non-fixable issues\n\n### Git Integration\n\nWhen processing directories recursively, yamllint-rs respects `.gitignore` files using the `ignore` crate, automatically skipping files that would be ignored by Git.\n\n### Output Formats\n\n- **auto** (default): Automatically detects terminal capabilities and NO_COLOR environment variable\n- **colored**: Always use colored output with ANSI codes\n- **standard**: Plain text output without colors\n\n## Supported Rules\n\nyamllint-rs supports all 23 rules from the original yamllint. See [Rules.md](Rules.md) for complete documentation.\n\n### Enabled by Default\n- braces, brackets, colons, commas, hyphens\n- line-length, indentation, trailing-spaces\n- comments, comments-indentation\n- document-start\n- empty-lines, new-lines\n- new-line-at-end-of-file\n- key-duplicates, anchors\n- truthy\n\n### Disabled by Default\n- document-end\n- quoted-strings\n- empty-values\n- float-values\n- octal-values\n- key-ordering\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favnercohen%2Fyamllint-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Favnercohen%2Fyamllint-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Favnercohen%2Fyamllint-rs/lists"}