forked from astral-sh/ruff
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## Summary Fix panic reported in astral-sh#12428. Where a string would sometimes get split within a character boundary. This bypasses the need to split the string. This does not guarantee the correct formatting of the docstring, but neither did the previous implementation. Resolves astral-sh#12428 ## Test Plan Test case added to fixture
- Loading branch information
1 parent
0532436
commit 3a742c1
Showing
4 changed files
with
33 additions
and
9 deletions.
There are no files selected for viewing
8 changes: 8 additions & 0 deletions
8
crates/ruff_linter/resources/test/fixtures/pydoclint/DOC501.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# https://github.com/astral-sh/ruff/issues/12428 | ||
def parse_bool(x, default=_parse_bool_sentinel): | ||
"""Parse a boolean value | ||
bool or type(default) | ||
Raises | ||
`ValueError` | ||
ê>>> all(parse_bool(x) for x in [True, "yes", "Yes", "true", "True", "on", "ON", "1", 1]) | ||
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 4 additions & 0 deletions
4
...napshots/ruff_linter__rules__pydoclint__tests__docstring-missing-exception_DOC501.py.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
--- | ||
source: crates/ruff_linter/src/rules/pydoclint/mod.rs | ||
--- | ||
|