πYAML Linting
This repository includes comprehensive YAML linting and auto-fixing capabilities using yamllint and task automation.
Quick Start
Install Task (if not already installed)
# On macOS
brew install go-task/tap/go-task
# On Linux
sh -c "$(curl --location https://taskfile.dev/install.sh)" -- -d -b ~/.local/bin
# Or download from https://github.com/go-task/task/releasesSetup Development Environment
# Install dependencies (including yamllint)
task setupYAML Linting Commands
Using Task (Recommended)
Using the Scripts Directly
Using VS Code Tasks
Open Command Palette (
Ctrl+Shift+P/Cmd+Shift+P)Type "Tasks: Run Task"
Choose from:
Lint YAML FilesFix YAML IssuesCheck YAML (Strict)
Configuration
yamllint Configuration (.yamllint.yml)
.yamllint.yml)The repository includes a customized yamllint configuration that:
Sets line length to 120 characters (flexible for GitHub Actions)
Uses 2-space indentation
Allows common GitHub Actions truthy values (
yes,no,on,off)Ignores lock files and template directories
Provides warnings instead of errors for line length
Supported Files
The linting automatically finds and checks:
*.ymlfiles*.yamlfilesExcludes:
pnpm-lock.yaml,yarn.lock,package-lock.jsonIgnores:
node_modules,.git,venv,__pycache__
Integration
GitHub Actions
YAML linting is integrated into:
Autofix Workflow (
.github/workflows/autofix.yml) - Runs on every PR/pushDedicated YAML Lint Workflow (
.github/workflows/yaml-lint.yml) - Triggered by YAML changes
Pre-commit Integration
Add to your development workflow:
Common YAML Issues and Fixes
1. Line Length
2. Indentation
3. Truthy Values
Troubleshooting
yamllint Not Found
Permission Denied
Custom Rules
Edit .yamllint.yml to customize rules for your needs. See yamllint
documentation for
all available options.
Available Task Commands
Run task --list to see all available commands:
Last updated
Was this helpful?