Skip to content

Commit 85afc00

Browse files
jzhuclaude
andcommitted
feat: add code quality tools and pre-commit hooks
- Add Black, Flake8, MyPy, and pre-commit to dev dependencies - Configure Black and MyPy in pyproject.toml - Add .pre-commit-config.yaml with automated quality checks - Enable consistent code formatting, linting, and type checking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 0269475 commit 85afc00

3 files changed

Lines changed: 44 additions & 2 deletions

File tree

.claude/settings.local.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,12 @@
4646
"mcp__serena__activate_project",
4747
"mcp__serena__replace_regex",
4848
"mcp__serena__create_text_file",
49-
"mcp__wikipedia-mcp__search_wikipedia"
49+
"mcp__wikipedia-mcp__search_wikipedia",
50+
"mcp__serena__check_onboarding_performed",
51+
"Bash(flake8:*)",
52+
"Bash(mypy:*)",
53+
"Bash(pre-commit install:*)",
54+
"Bash(black:*)"
5055
],
5156
"additionalDirectories": [
5257
"/home/jzhu/projects/repos/mcpm.sh",

.pre-commit-config.yaml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v4.4.0
4+
hooks:
5+
- id: trailing-whitespace
6+
- id: end-of-file-fixer
7+
- id: check-yaml
8+
- id: check-added-large-files
9+
10+
- repo: https://github.com/psf/black
11+
rev: 23.7.0
12+
hooks:
13+
- id: black
14+
15+
- repo: https://github.com/pycqa/flake8
16+
rev: 6.0.7
17+
hooks:
18+
- id: flake8
19+
args: [--max-line-length=88, --extend-ignore=E203,W503]
20+
21+
- repo: https://github.com/pre-commit/mirrors-mypy
22+
rev: v1.5.1
23+
hooks:
24+
- id: mypy
25+
additional_dependencies: [types-PyYAML]

pyproject.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ dev = [
3030
"pytest>=8.0.0",
3131
"pytest-cov>=4.1.0",
3232
"pytest-asyncio>=0.23.0",
33+
"black>=23.0.0",
34+
"flake8>=6.0.0",
35+
"mypy>=1.0.0",
36+
"pre-commit>=3.0.0",
3337
]
3438

3539
[tool.setuptools.packages.find]
@@ -49,4 +53,12 @@ version = {attr = "code_assistant_manager.__version__"}
4953

5054
[project.scripts]
5155
code-assistant-manager = "code_assistant_manager.cli:main"
52-
cam = "code_assistant_manager.cli:main"
56+
cam = "code_assistant_manager.cli:main"
57+
58+
[tool.black]
59+
line-length = 88
60+
61+
[tool.mypy]
62+
python_version = "3.9"
63+
warn_return_any = true
64+
warn_unused_configs = true

0 commit comments

Comments
 (0)