From 95541a64ee6174bb78baf2dc76f412018a270780 Mon Sep 17 00:00:00 2001 From: Lukas Burgholzer Date: Fri, 17 Nov 2023 23:14:33 -0700 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20add=20Scientific=20Python's=20repo-?= =?UTF-8?q?review=20(#483)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description This PR adopts Scientific Python's repo-review that is based on the [Scientific Python Development Guide](https://learn.scientific-python.org/development/) and checks the repository for common best practices. ## Checklist: - [x] The pull request only contains commits that are related to it. - [x] I have added appropriate tests and documentation. - [x] I have made sure that all CI jobs on GitHub pass. - [x] The pull request introduces no new warnings and follows the project's style guidelines. Signed-off-by: burgholzer --- .pre-commit-config.yaml | 7 +++++++ pyproject.toml | 5 ++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 404c85d91..e76c715a2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -116,3 +116,10 @@ repos: language: pygrep entry: PyBind|Numpy|Cmake|CCache|Github|PyTest|Mqt|Tum exclude: .pre-commit-config.yaml + + # Check best practices for scientific Python code + - repo: https://github.com/scientific-python/cookie + rev: 2023.11.17 + hooks: + - id: sp-repo-review + additional_dependencies: ["repo-review[cli]"] diff --git a/pyproject.toml b/pyproject.toml index 1eda0ccd0..812fb053f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -157,7 +157,6 @@ files = ["src/mqt", "test/python"] mypy_path = ["$MYPY_CONFIG_FILE_DIR/src"] python_version = "3.8" warn_unused_configs = true -show_error_codes = true enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"] strict = true disallow_untyped_defs = false @@ -217,7 +216,7 @@ extend-select = [ "UP", # pyupgrade "YTT", # flake8-2020 ] -extend-ignore = [ +ignore = [ "ANN101", # Missing type annotation for `self` in method "ANN102", # Missing type annotation for `cls` in classmethod "ISC001", # Conflicts with formatter @@ -258,7 +257,7 @@ isort.required-imports = ["from __future__ import annotations"] ] "src/mqt/core/_compat/**.py" = ["TID251"] -[tool.ruff.pydocstyle] +[tool.ruff.lint.pydocstyle] convention = "google"