Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .claude/skills/prek-precommit-hook/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
---
name: prek-precommit-hook
description: Instructions for using prek (pre-commit replacement). This skill should be used for any mention of pre-commit hooks; prek overrides standard pre-commit hooks.
---
# Prek Skill (prek-precommit-hook)

This skill provides instructions for using `prek` to manage git hooks and run checks.
It should be used for any mention of pre-commit hooks, as `prek` overrides standard pre-commit hooks in this repository.

## Commands

- `prek run`: Run hooks on changed files.
- `prek run --all-files`: Run hooks on all files in the repository.
- `prek install`: Install git hooks to run automatically on commit.
- `prek run <hook_id>`: Run a specific hook by its ID.
- `prek run --help`: Show help and available options.

## Workflow

1. **Setup**: Run `prek install` to set up git hooks.
2. **Pre-commit**: Hooks will run automatically on commit, replacing standard pre-commit behavior.
3. **Manual Check**: Run `prek run --all-files` to check everything manually.
4. **Configuration**: Hooks are configured in `prek.toml`.
49 changes: 0 additions & 49 deletions .pre-commit-config.yaml

This file was deleted.

7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ check_jq:
# Setup githooks for linting
########################################################
setup_githooks:
@echo "$(YELLOW)🔨Setting up githooks on post-commit...$(RESET)"
chmod +x .githooks/post-commit
git config core.hooksPath .githooks
@echo "$(YELLOW)🔨Setting up githooks with prek...$(RESET)"
@prek install
@echo "$(GREEN)✅Githooks set up.$(RESET)"


########################################################
Expand Down Expand Up @@ -205,6 +205,7 @@ install_tools: check_uv ## Install linting/formatting tools
@uv tool install import-linter --force
@uv tool install ty --force
@uv tool install vulture --force
@uv tool install prek --force
@echo "$(GREEN)✅Tools installed.$(RESET)"

fmt: install_tools check_jq ## Format code with ruff and jq
Expand Down
18 changes: 18 additions & 0 deletions prek.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[[repos]]
repo = "https://github.com/pre-commit/pre-commit-hooks"
rev = "v4.6.0"
hooks = [
{ id = "check-added-large-files" }
]

[[repos]]
repo = "local"
hooks = [
{ id = "lint-links", name = "Lint markdown links", entry = "make lint_links", language = "system", pass_filenames = false, always_run = true },
{ id = "make-fmt", name = "Run formatter (make fmt)", entry = "make fmt", language = "system", pass_filenames = false, always_run = true },
{ id = "ruff-check", name = "Run ruff linter", entry = "uv run ruff check", language = "system", pass_filenames = false, always_run = true },
{ id = "ruff-complexity", name = "Check cyclomatic complexity", entry = "uv run ruff check --select C901", language = "system", pass_filenames = false, always_run = true },
{ id = "ruff-tech-debt", name = "Check TODO/FIXME markers", entry = "uv run ruff check --select FIX", language = "system", pass_filenames = false, always_run = true },
{ id = "pylint-duplicate-code", name = "Detect duplicate code", entry = "uv run pylint --disable=all --enable=R0801 src common utils", language = "system", pass_filenames = false, always_run = true },
{ id = "ai-writing-check", name = "AI writing check", entry = "uv run python scripts/check_ai_writing.py", language = "system", pass_filenames = false, always_run = true }
]
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -106,5 +106,6 @@ show_missing = true

[dependency-groups]
dev = [
"prek>=0.3.3",
"pytest-check-links>=0.9.1",
]
33 changes: 29 additions & 4 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.