Skip to content

Commit fed84ba

Browse files
Nick Sullivanclaude
andcommitted
Add pre-commit hooks, CI workflow, and auto-fix existing files
Set up pre-commit with: large file check, merge conflict detection, symlink validation, YAML check, trailing whitespace, tab removal, smart quote fix, bidi control detection, Ruff (lint + format), Prettier (HTML/CSS/JS/JSON/YAML), and actionlint. Also removed broken symlink to .claude/commands/generate-llms-txt.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 6cf0b6a commit fed84ba

6 files changed

Lines changed: 89 additions & 10 deletions

File tree

.cursor/commands/generate-llms-txt.md

Lines changed: 0 additions & 1 deletion
This file was deleted.

.github/workflows/pre-commit.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
jobs:
9+
pre-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: actions/setup-python@v5
14+
with:
15+
python-version: "3.12"
16+
- uses: pre-commit/action@v3.0.1

.github/workflows/update-stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Update GitHub Stats
33
on:
44
schedule:
55
# Run every Sunday at midnight UTC
6-
- cron: '0 0 * * 0'
6+
- cron: "0 0 * * 0"
77
workflow_dispatch: # Allow manual trigger
88

99
permissions:
@@ -19,7 +19,7 @@ jobs:
1919
- name: Set up Python
2020
uses: actions/setup-python@v5
2121
with:
22-
python-version: '3.12'
22+
python-version: "3.12"
2323

2424
- name: Run stats update
2525
env:

.mcp.json

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,7 @@
22
"mcpServers": {
33
"context7": {
44
"command": "npx",
5-
"args": [
6-
"-y",
7-
"@upstash/context7-mcp@latest"
8-
]
5+
"args": ["-y", "@upstash/context7-mcp@latest"]
96
}
107
}
11-
}
8+
}

.pre-commit-config.yaml

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# Pre-commit hooks for technick.ai
2+
# Install: pre-commit install
3+
# Run manually: pre-commit run --all-files
4+
5+
exclude: '\.git/|__pycache__/|\.pyc'
6+
7+
repos:
8+
- repo: https://github.com/pre-commit/pre-commit-hooks
9+
rev: v6.0.0
10+
hooks:
11+
- id: check-added-large-files
12+
name: Block large files
13+
args: [--maxkb=500]
14+
- id: check-ast
15+
name: Validate Python syntax
16+
- id: check-merge-conflict
17+
name: Detect merge conflicts
18+
- id: check-symlinks
19+
name: Validate symlinks
20+
- id: check-yaml
21+
name: Validate YAML syntax
22+
args: [--allow-multiple-documents]
23+
- id: trailing-whitespace
24+
name: Trim whitespace
25+
26+
- repo: https://github.com/Lucas-C/pre-commit-hooks
27+
rev: v1.5.5
28+
hooks:
29+
- id: remove-tabs
30+
name: Replace tabs with spaces
31+
32+
- repo: https://github.com/sirosen/texthooks
33+
rev: 0.7.1
34+
hooks:
35+
- id: fix-smartquotes
36+
name: Fix smart quotes
37+
- id: forbid-bidi-controls
38+
name: Forbid bidirectional text (security)
39+
40+
# Ruff replaces flake8, pylint, isort and more
41+
- repo: https://github.com/astral-sh/ruff-pre-commit
42+
rev: v0.14.5
43+
hooks:
44+
- id: ruff
45+
name: Fix Python issues (Ruff)
46+
args: [--fix]
47+
- id: ruff-format
48+
name: Format Python (Ruff)
49+
50+
# Prettier for HTML, CSS, JS, JSON, YAML
51+
- repo: https://github.com/rbubley/mirrors-prettier
52+
rev: v3.6.2
53+
hooks:
54+
- id: prettier
55+
name: Format with Prettier
56+
types_or: ["html", "css", "javascript", "json", "yaml"]
57+
exclude: |
58+
(?x)^(
59+
.*\.min\.(js|css)
60+
)$
61+
62+
- repo: https://github.com/rhysd/actionlint
63+
rev: v1.7.8
64+
hooks:
65+
- id: actionlint
66+
name: Check GitHub Actions

scripts/update_stats.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66

77
import json
88
import subprocess
9-
import sys
109
from datetime import datetime
1110
from pathlib import Path
1211

@@ -48,7 +47,9 @@ def get_monthly_commits(email: str, year: int, month: int) -> int | None:
4847
else:
4948
end = f"{year}-{month + 1:02d}-01"
5049

51-
data = gh_api(f"search/commits?q=author-email:{email}+committer-date:{start}..{end}&per_page=1")
50+
data = gh_api(
51+
f"search/commits?q=author-email:{email}+committer-date:{start}..{end}&per_page=1"
52+
)
5253
if data and "total_count" in data:
5354
return data["total_count"]
5455
return None

0 commit comments

Comments
 (0)