diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 71b50d5..e220435 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -65,6 +65,7 @@ jobs: - name: Install uv uses: astral-sh/setup-uv@v7 + # Keep in sync ruff version with .pre-commit-config.yaml - name: Run Ruff Linter run: | uvx ruff@0.14.5 check . @@ -90,6 +91,7 @@ jobs: uv build uv pip install dist/*.whl + # Keep in sync mypy version with .pre-commit-config.yaml - name: Run Mypy Type Checker run: | uvx mypy@1.18.2 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..71ba1f7 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,32 @@ +repos: + # Ruff for linting and formatting + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.14.5 # Keep in sync with GitHub Actions workflow + hooks: + # Run the linter + - id: ruff + args: [--fix] + # Run the formatter + - id: ruff-format + + # mypy for type checking + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.18.2 # Keep in sync with GitHub Actions workflow + hooks: + - id: mypy + args: [--config-file=pyproject.toml] + files: ^(language_tool_python|tests)/ + + # Standard pre-commit hooks + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v6.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-added-large-files + args: [--maxkb=1000] + - id: check-json + - id: check-toml + - id: mixed-line-ending + args: [--fix=lf] diff --git a/MANIFEST.in b/MANIFEST.in index 27dfe33..5b07d17 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -5,6 +5,7 @@ recursive-include language_tool_python *.py *.toml include language_tool_python/py.typed prune .github/ +prune .mypy_cache/ prune .pytest-cache/ prune .ruff_cache/ prune env/ @@ -16,12 +17,17 @@ prune ENV/ prune env.bak/ prune venv.bak/ prune docs/ +prune htmlcov/ prune tests/ +exclude .coverage exclude .gitignore +exclude .pre-commit-config.yaml exclude .readthedocs.yaml +exclude CHANGELOG.md exclude CONTRIBUTING.md exclude coverage-badge.svg +exclude coverage.xml exclude make.bat exclude Makefile exclude pytest.ini