Skip to content

Enhance pre-commit config and modernize CI workflow#1

Merged
mrkshields merged 5 commits intomasterfrom
feat/enhance-pre-commit-and-ci
Feb 4, 2026
Merged

Enhance pre-commit config and modernize CI workflow#1
mrkshields merged 5 commits intomasterfrom
feat/enhance-pre-commit-and-ci

Conversation

@mrkshields
Copy link
Owner

@mrkshields mrkshields commented Feb 4, 2026

Summary

  • Add comprehensive validation hooks to .pre-commit-config.yaml for Shell, Fish, Python, YAML, and Vim files
  • Replace custom CI jobs with official pre-commit action in GitHub Actions workflow
  • Update README with development documentation for pre-commit usage

Changes

Enhanced Pre-commit Configuration

Added new validation hooks:

  • YAML linting (yamllint) - uses existing linters/.yamllint config
  • Shell script validation (shellcheck) - validates setup scripts and .sh files
  • Fish syntax checking - validates all .fish files
  • Python linting (flake8) - uses existing linters/.config/flake8 config
  • Vim script linting (vint) - validates .vim files and vimrc
  • Shebang checks - ensures executable scripts have proper shebangs

Modernized CI Workflow

  • Replaced separate fish-syntax-check and vimlint jobs with single pre-commit job
  • Updated to modern action versions (checkout@v4, setup-python@v5, cache@v4)
  • Uses official pre-commit/action@v3.0.1
  • Added pre-commit environment caching for faster CI runs
  • Added pull_request trigger for PR validation

Documentation

  • Added "Development" section to README with setup and usage instructions
  • Documents all configured hooks

Benefits

✅ Comprehensive validation covering all file types in the repository
✅ Consistent validation locally and in CI
✅ Faster CI runs with environment caching
✅ Reuses existing linter configurations from linters/ directory
✅ Simplified workflow maintenance (single pre-commit action vs multiple custom jobs)

Test plan

  • Verify pre-commit run --all-files passes locally
  • Verify CI workflow runs successfully on this PR
  • Confirm caching works (second CI run should be faster)

🤖 Generated with Claude Code


Note

Medium Risk
Moderate risk because it changes CI gates and adds auto-fixing linters (e.g., ruff --fix) that can rewrite files and potentially cause new CI failures until the repo conforms.

Overview
Adopts pre-commit as the primary validation layer by adding a new .pre-commit-config.yaml with broader checks (shebang/executable sanity, YAML/JSON/TOML validation, shellcheck, fish syntax via a local hook, ruff lint+format, yamllint, markdownlint, gitleaks, and conventional commit enforcement).

Simplifies and modernizes CI by replacing the prior fish/vim lint jobs with a single pre-commit GitHub Actions workflow, adding pull_request triggering, and caching ~/.cache/pre-commit.

Also removes legacy Extraterm helper scripts from .config/fish/extraterm/, tweaks linters/.yamllint to relax key-ordering and set line length to 120, updates README.md with pre-commit usage docs, and fixes minor bash correctness in setup-generic (env var export + quoting for krew installer variables).

Written by Cursor Bugbot for commit d7f427a. This will update automatically on new commits. Configure here.

Cursor Bugbot found 1 potential issue for commit d7f427a

Add comprehensive validation hooks for Shell, Fish, Python, YAML, and Vim
files. Replace custom CI jobs with official pre-commit action for consistent
validation locally and in CI.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
uses: actions/cache@v4
with:
path: ~/.cache/pre-commit
key: pre-commit-${{ hashFiles('.pre-commit-config.yaml') }}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cache key missing linter configuration files

Medium Severity

The cache key only includes .pre-commit-config.yaml, but several hooks reference external config files (linters/.yamllint and linters/.config/flake8). When these linter configs change, the cache won't invalidate, causing CI to run with stale configurations while local pre-commit runs use the updated configs. This creates inconsistent validation behavior.

Fix in Cursor Fix in Web

Mark Shields added 4 commits February 4, 2026 17:01
- fish-shop/syntax-check is a GitHub Action, not a pre-commit hook
- Replace with local hook using 'fish --no-execute'
- Replace daveparsonsdev/pre-commit-vint (mutable master ref) with local hook
- Local vint hook uses additional_dependencies to install vim-vint

[anthropic/claude-opus-4-5]
- Replace flake8 with ruff (linting + formatting)
- Remove vint (incompatible with Python 3.14)
- Remove extraterm scripts (no longer used)
- Exclude third-party files (__bass.py, ipython_config.py)
- Add check-merge-conflict, check-json, check-toml hooks
- Update README with current hook list

[anthropic/claude-opus-4-5]
- Fix bash syntax in setup-generic (was using fish 'set' syntax)
- Disable yamllint key-ordering rule (too strict)
- Increase yamllint line-length to 120
- Install fish in CI workflow for syntax checking
- Use Python 3.13 in CI (3.14 has compatibility issues)
- Improve cache key for pre-commit

[anthropic/claude-opus-4-5]
- Remove +x from config files that shouldn't be executable
- Fix markdown formatting (blank lines around headings/code blocks)

[anthropic/claude-opus-4-5]
@mrkshields mrkshields merged commit 342d612 into master Feb 4, 2026
3 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

hooks:
- id: ruff
args: ['--fix']
- id: ruff-format
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing vint hook removes Vim linting from CI

Medium Severity

The PR description claims to add "Vim script linting (vint) - validates .vim files and vimrc", but no vint hook is present in .pre-commit-config.yaml. Meanwhile, the old vimlint CI job that ran on vim/.vimrc is being removed. This causes a regression where Vim files in the repository (.vim/vimrc, .vim/autoload/pathogen.vim, etc.) are no longer validated.

Additional Locations (1)

Fix in Cursor Fix in Web

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.

1 participant