Files
kicad-mcp-server/.pre-commit-config.yaml
Eugene Mikhantyev 2c35ff40a7 chore: enforce LF line endings via gitattributes, editorconfig, pre-commit
Introduces a three-layer defence against CRLF/LF drift:

- `.gitattributes` normalizes all text files to LF on commit and checkout;
  Windows-native scripts (*.bat, *.cmd, *.ps1) explicitly keep CRLF.
- `.editorconfig` instructs editors (VS Code, JetBrains, vim, etc.) to save
  with LF by default so the problem is prevented at the source.
- `mixed-line-ending --fix=lf` hook in pre-commit catches anything that
  slips through and auto-fixes it before commit.

No file contents are normalized in this commit — that follows in a
separate `git add --renormalize .` commit for easier review.
2026-04-18 15:20:20 +01:00

63 lines
1.5 KiB
YAML

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
args: ["--fix=lf"]
- id: check-yaml
- id: check-json
- id: check-added-large-files
args: ["--maxkb=500"]
- id: check-merge-conflict
- repo: https://github.com/psf/black
rev: 26.3.1
hooks:
- id: black
language_version: python3
args: [--config=pyproject.toml]
- repo: https://github.com/pycqa/isort
rev: 8.0.1
hooks:
- id: isort
args: [--settings-path=pyproject.toml]
- repo: local
hooks:
- id: prettier
name: prettier
entry: npx prettier --write --ignore-unknown
language: node
types_or: [javascript, ts, json, yaml, markdown]
exclude: ^(dist/|package-lock\.json|\.venv/|python/)
- repo: https://github.com/pycqa/flake8
rev: "7.3.0"
hooks:
- id: flake8
files: ^python/
args: [--config=.flake8]
- repo: https://github.com/pre-commit/mirrors-mypy
rev: "v1.19.1"
hooks:
- id: mypy
files: ^python/
exclude: ^python/commands/board\.py$
args: [--config-file=pyproject.toml]
additional_dependencies:
- types-requests
- pytest
- repo: local
hooks:
- id: eslint
name: eslint
entry: npx eslint --fix
language: node
types: [ts]
files: ^src/