chore: set up pre-commit framework with general hooks
Add .pre-commit-config.yaml with pre-commit-hooks v5.0.0 (trailing whitespace, end-of-file fixer, yaml/json checks, large file guard, merge conflict detection). Add minimal pyproject.toml. Auto-fix trailing whitespace and missing end-of-file newlines across the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,71 +1,11 @@
|
|||||||
# Pre-commit hooks configuration
|
|
||||||
# See https://pre-commit.com for more information
|
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
# Python code formatting
|
|
||||||
- repo: https://github.com/psf/black
|
|
||||||
rev: 23.7.0
|
|
||||||
hooks:
|
|
||||||
- id: black
|
|
||||||
language_version: python3
|
|
||||||
files: ^python/
|
|
||||||
|
|
||||||
# Python import sorting
|
|
||||||
- repo: https://github.com/pycqa/isort
|
|
||||||
rev: 5.12.0
|
|
||||||
hooks:
|
|
||||||
- id: isort
|
|
||||||
files: ^python/
|
|
||||||
args: ["--profile", "black"]
|
|
||||||
|
|
||||||
# Python type checking
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-mypy
|
|
||||||
rev: v1.5.0
|
|
||||||
hooks:
|
|
||||||
- id: mypy
|
|
||||||
files: ^python/
|
|
||||||
args: [--ignore-missing-imports]
|
|
||||||
|
|
||||||
# Python linting
|
|
||||||
- repo: https://github.com/pycqa/flake8
|
|
||||||
rev: 6.1.0
|
|
||||||
hooks:
|
|
||||||
- id: flake8
|
|
||||||
files: ^python/
|
|
||||||
args: [--max-line-length=100, --extend-ignore=E203]
|
|
||||||
|
|
||||||
# TypeScript/JavaScript formatting
|
|
||||||
- repo: https://github.com/pre-commit/mirrors-prettier
|
|
||||||
rev: v3.0.3
|
|
||||||
hooks:
|
|
||||||
- id: prettier
|
|
||||||
types_or: [javascript, typescript, json, yaml, markdown]
|
|
||||||
files: \.(ts|js|json|ya?ml|md)$
|
|
||||||
|
|
||||||
# General file checks
|
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
rev: v4.4.0
|
rev: v5.0.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: trailing-whitespace
|
- id: trailing-whitespace
|
||||||
- id: end-of-file-fixer
|
- id: end-of-file-fixer
|
||||||
- id: check-yaml
|
- id: check-yaml
|
||||||
- id: check-json
|
- id: check-json
|
||||||
- id: check-added-large-files
|
- id: check-added-large-files
|
||||||
args: [--maxkb=500]
|
args: ['--maxkb=500']
|
||||||
- id: check-merge-conflict
|
- id: check-merge-conflict
|
||||||
- id: detect-private-key
|
|
||||||
|
|
||||||
# Python security checks
|
|
||||||
- repo: https://github.com/PyCQA/bandit
|
|
||||||
rev: 1.7.5
|
|
||||||
hooks:
|
|
||||||
- id: bandit
|
|
||||||
args: [-c, pyproject.toml]
|
|
||||||
files: ^python/
|
|
||||||
|
|
||||||
# Markdown linting
|
|
||||||
- repo: https://github.com/igorshubovych/markdownlint-cli
|
|
||||||
rev: v0.37.0
|
|
||||||
hooks:
|
|
||||||
- id: markdownlint
|
|
||||||
args: [--fix]
|
|
||||||
|
|||||||
@@ -986,9 +986,3 @@ If you use this project in your research or publication, please cite:
|
|||||||
version = {2.2.3}
|
version = {2.2.3}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
4
pyproject.toml
Normal file
4
pyproject.toml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
[project]
|
||||||
|
name = "kicad-mcp-server"
|
||||||
|
version = "2.1.0"
|
||||||
|
requires-python = ">=3.10"
|
||||||
@@ -382,4 +382,3 @@ export function registerBoardTools(server: McpServer, callKicadScript: CommandFu
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user