From 004d6d770d75cd69044e82d1a8aca25deedcd058 Mon Sep 17 00:00:00 2001 From: glrs <5999366+glrs@users.noreply.github.com> Date: Fri, 4 Oct 2024 13:27:45 +0200 Subject: [PATCH] Add linting (ruff & mypy) and pre-commit hook configurations --- .pre-commit-config.yaml | 17 +++++++++++++++++ pyproject.toml | 19 +++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 .pre-commit-config.yaml create mode 100644 pyproject.toml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..fb2c2b9 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,17 @@ +repos: + - repo: https://github.com/astral-sh/ruff-pre-commit + rev: v0.6.8 + hooks: + - id: ruff + args: [ --fix, --exit-zero ] + + - repo: https://github.com/psf/black + rev: 24.8.0 + hooks: + - id: black + language_version: python3.11 + + - repo: https://github.com/pre-commit/mirrors-mypy + rev: v1.11.2 + hooks: + - id: mypy diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..bc6a79b --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,19 @@ +[tool.ruff] +select = [ + "E4", + "E7", + "E9", + "F", + "I", + "UP" +] +ignore = [ + "E402", + "E501", + "E722", + "E741" +] + +[tool.mypy] +ignore_missing_imports = true +follow_imports = "skip" \ No newline at end of file