From 834e627fb4f7ee9ad3193c9e2f8404a5caf1f627 Mon Sep 17 00:00:00 2001 From: Daniel Herrmann Date: Mon, 19 Aug 2024 15:54:39 +0200 Subject: [PATCH] style: add pre-commit hook for mypy --- .pre-commit-config.yaml | 4 ++++ README.md | 14 ++++++++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 028caf3..f03767c 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -18,3 +18,7 @@ repos: hooks: - id: ruff - id: ruff-format + - repo: https://github.com/pre-commit/mirrors-mypy + rev: 'v1.11.1' + hooks: + - id: mypy diff --git a/README.md b/README.md index 8790d56..fe3bb4f 100644 --- a/README.md +++ b/README.md @@ -89,11 +89,17 @@ EV_API_KEY= The client is written in pure Python, using `mkdocs` with `mkdocstrings` for documentation. Any changes or pull requests are more than welcome, but please adhere to the code style: -- Use `black` for code formatting -- Use `isort` based import sorting -- Use `ruff` based code linting +- Use `ruff` based code linting, formatting and styling +- Use `mypy` for static type checking -A pre-commit hook configuration is supplied as part of the project. +A pre-commit hook configuration is supplied as part of the project. You can run them prior to your commit using: + +```bash +pre-commit + +# Or run them for the entire project +pre-commit run --all-files +``` Please make sure that any additions are properly tested. PRs won't get accepted if they don't have test cases to cover them.