Skip to content

Conversation

@aightmunam
Copy link
Owner

Summary

This PR adds pre-commit CI integration to the dotfiles repository, enhancing code quality and consistency checks.

Changes Made

1. Added .pre-commit-config.yaml

  • Configured pre-commit hooks for multiple file types:
    • YAML: Syntax checking with check-yaml
    • TOML: Syntax checking with check-toml
    • Shell scripts: Linting with shellcheck (two implementations for comprehensive coverage)
    • Lua files: Linting with vint
    • General: End-of-file fixer, trailing whitespace removal, mixed line ending fixes

2. Updated GitHub Actions Workflow

  • Added new pre-commit job to .github/workflows/dotfiles-ci.yml
  • The job performs the following:
    • Sets up Python environment
    • Installs pre-commit
    • Runs all configured hooks on all files
  • Updated the validation job to depend on the new pre-commit job

Benefits

  • Automated quality checks: Pre-commit hooks run automatically in CI
  • Multi-format support: Covers YAML, TOML, shell, Lua, and config files
  • Consistency: Ensures all code meets quality standards before merging
  • Early detection: Catches syntax errors and formatting issues before manual review

Testing

The workflow will run automatically on this PR to verify all checks pass.

Add pre-commit configuration with hooks for YAML, TOML, shell scripts, and Lua files. This includes syntax checking, linting, and formatting hooks.
Add pre-commit job to GitHub Actions workflow. This job installs Python, sets up pre-commit, and runs all configured hooks. Updated validation job to depend on all checks including pre-commit.
Add something for linting
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants