From 8255d780c59441c4e0552ceeffc695581d295292 Mon Sep 17 00:00:00 2001 From: Burhan <62214284+Burhan-Q@users.noreply.github.com> Date: Fri, 25 Apr 2025 16:46:54 -0400 Subject: [PATCH 1/2] include note regarding `check-docstring-first` --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index c0f678fd..64d49e8c 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,20 @@ Check for files with names that would conflict on a case-insensitive filesystem #### `check-docstring-first` Checks for a common error of placing code before the docstring. +> [!NOTE] +> As raised in [#159](https://github.com/pre-commit/pre-commit-hooks/issues/159) attribute level docstrings will +> be flagged by this. A basic workaround is to wrap the docstring with `()` which will bypass this throwing and +> error, but could interfere with other libraries that parse them. + +
Example + +```python +variable = 42 +("""Attribute docstring""") +``` + +
+ #### `check-executables-have-shebangs` Checks that non-binary executables have a proper shebang. From ff3abecf93614e855c3257b7c65f1cdbc006e4b4 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Apr 2025 20:56:45 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 64d49e8c..92afd906 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Check for files with names that would conflict on a case-insensitive filesystem #### `check-docstring-first` Checks for a common error of placing code before the docstring. -> [!NOTE] +> [!NOTE] > As raised in [#159](https://github.com/pre-commit/pre-commit-hooks/issues/159) attribute level docstrings will > be flagged by this. A basic workaround is to wrap the docstring with `()` which will bypass this throwing and > error, but could interfere with other libraries that parse them.