From fde06e6a15279d994c266d8f062fc2e392150d43 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 10 Aug 2023 14:31:54 -0400 Subject: [PATCH] docs: pull Python check parts out of PGH (#261) Signed-off-by: Henry Schreiner --- docs/pages/guides/style.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/pages/guides/style.md b/docs/pages/guides/style.md index ab5d1c3e..ce9f1fec 100644 --- a/docs/pages/guides/style.md +++ b/docs/pages/guides/style.md @@ -651,17 +651,13 @@ corrections if you have a lot of them when first adding the check. {% rr PC170 %} This is a repository with a [collection of pre-commit extra hooks](https://github.com/pre-commit/pygrep-hooks) that protect against some common, easy to detect, mistakes. You can pick and -choose the hooks you want from the repo; here are some common ones: +choose the hooks you want from the repo; here are some common ones for +Restructured Text: ```yaml - repo: https://github.com/pre-commit/pygrep-hooks rev: "v1.10.0" hooks: - - id: python-check-blanket-noqa - - id: python-check-blanket-type-ignore - - id: python-no-log-warn - - id: python-no-eval - - id: python-use-type-annotations - id: rst-backticks - id: rst-directive-colons - id: rst-inline-touching-normal @@ -676,7 +672,18 @@ called `mypy_error_report.txt`, then run `pipx run mypy_clean_slate -a`. [codespell]: https://github.com/codespell-project/codespell -Note that if you are using Ruff, you don't need the `python-*` hooks above. +{: .note } + +> Note that if you are not using Ruff's "PGH" code, there are `python-*` hooks +> also: +> +> ```yaml +> - id: python-check-blanket-noqa +> - id: python-check-blanket-type-ignore +> - id: python-no-log-warn +> - id: python-no-eval +> - id: python-use-type-annotations +> ``` ## Clang-format (C++ only)