Skip to content

Add YAML and Markdown linting tools (yamllint, markdownlint) #108

@jaeyeom

Description

@jaeyeom

Summary

Add linting tools for common configuration and documentation formats (YAML and Markdown).

Tools to Add

1. yamllint (YAML Linter)

  • Purpose: Linter for YAML files checking syntax and cosmetic problems
  • Use cases: Ansible playbooks, Kubernetes manifests, CI/CD configs, docker-compose
  • Installation:
    • macOS: brew install yamllint
    • Debian: apt install yamllint or pip install yamllint
    • Termux: pip install yamllint
  • Usage: yamllint <file.yaml> or yamllint .
  • Config: .yamllint.yml or .yamllint.yaml

2. markdownlint-cli (Markdown Linter)

  • Purpose: Style checker and lint tool for Markdown files
  • Use cases: README files, documentation, wikis
  • Installation:
    • macOS: brew install markdownlint-cli
    • Debian/Termux: npm install -g markdownlint-cli
  • Usage: markdownlint <file.md> or markdownlint '**/*.md'
  • Config: .markdownlint.json or .markdownlint.yaml

Implementation Notes

1. Add to packages_data.go

{
    command: "yamllint",
    platforms: map[PlatformName]InstallMethod{
        PlatformDarwin:     BrewInstallMethod{Name: "yamllint"},
        PlatformDebianLike: PackageInstallMethod{Name: "yamllint"},
        PlatformTermux:     PipInstallMethod{Name: "yamllint"},
    },
},
{
    command: "markdownlint",
    platforms: map[PlatformName]InstallMethod{
        PlatformDarwin:     BrewInstallMethod{Name: "markdownlint-cli"},
        PlatformDebianLike: NpmInstallMethod{Name: "markdownlint-cli"},
        PlatformTermux:     NpmInstallMethod{Name: "markdownlint-cli"},
    },
    Imports: []Import{{Playbook: "setup-npm"}},
},

2. Create setup-config-tools.yml grouping playbook

---
# setup-config-tools.yml - Configuration and documentation format tools
- import_playbook: yamllint.yml       # YAML linting
- import_playbook: markdownlint.yml   # Markdown linting
# Note: prettier (already in playbooks) can also format YAML and Markdown

3. Add to all.yml

- import_playbook: setup-config-tools.yml

Integration with Existing Tools

  • prettier (already in playbooks): Can format both YAML and Markdown
  • yamllint: Focuses on linting (catching errors, enforcing style rules)
  • markdownlint: Focuses on Markdown-specific rules (headings, lists, links)

Together they provide complete tooling:

  • Use prettier for formatting
  • Use yamllint/markdownlint for catching issues

Acceptance Criteria

  • Add yamllint playbook
  • Add markdownlint playbook
  • Create setup-config-tools.yml grouping playbook
  • Update all.yml to import config tools group
  • Test on macOS
  • Test on Debian/Ubuntu
  • Test on Termux

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions