Skip to content

Commit 8255d78

Browse files
authored
include note regarding check-docstring-first
1 parent 5c514f8 commit 8255d78

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,20 @@ Check for files with names that would conflict on a case-insensitive filesystem
4848
#### `check-docstring-first`
4949
Checks for a common error of placing code before the docstring.
5050

51+
> [!NOTE]
52+
> As raised in [#159](https://github.com/pre-commit/pre-commit-hooks/issues/159) attribute level docstrings will
53+
> be flagged by this. A basic workaround is to wrap the docstring with `()` which will bypass this throwing and
54+
> error, but could interfere with other libraries that parse them.
55+
56+
<details><summary>Example</summary>
57+
58+
```python
59+
variable = 42
60+
("""Attribute docstring""")
61+
```
62+
63+
</details>
64+
5165
#### `check-executables-have-shebangs`
5266
Checks that non-binary executables have a proper shebang.
5367

0 commit comments

Comments
 (0)