-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix blank-line docstring rules for module-level docstrings #9878
Merged
Conversation
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
charliermarsh
added
bug
Something isn't working
docstring
Related to docstring linting or formatting
labels
Feb 7, 2024
charliermarsh
force-pushed
the
charlie/doc
branch
2 times, most recently
from
February 7, 2024 21:06
6493eb8
to
140ba33
Compare
charliermarsh
force-pushed
the
charlie/doc
branch
from
February 7, 2024 21:18
140ba33
to
4ccb0f3
Compare
|
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
D413 | 63 | 0 | 63 | 0 | 0 |
Linter (preview)
ℹ️ ecosystem check detected linter changes. (+0 -63 violations, +0 -0 fixes in 1 projects; 42 projects unchanged)
bokeh/bokeh (+0 -63 violations, +0 -0 fixes)
ruff check --no-cache --exit-zero --ignore RUF9 --output-format concise --preview --select ALL
- src/bokeh/driving.py:7:1: D413 [*] Missing blank line after last section ("Example") - src/bokeh/plotting/glyph_api.py:1004:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:110:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:130:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:146:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:163:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:180:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:197:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:214:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:231:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:248:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:265:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:282:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:299:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:315:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:332:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:349:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:365:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:381:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:397:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:414:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:430:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:447:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:490:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:506:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:522:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:543:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:564:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:580:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:601:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:617:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:638:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:655:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:677:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:693:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:69:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:711:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:727:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:744:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:761:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:778:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:795:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:812:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:838:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:855:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:872:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:889:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:906:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:90:9: D413 [*] Missing blank line after last section ("Examples") - src/bokeh/plotting/glyph_api.py:923:9: D413 [*] Missing blank line after last section ("Examples") ... 13 additional changes omitted for project
Changes by rule (1 rules affected)
code | total | + violation | - violation | + fix | - fix |
---|---|---|---|---|---|
D413 | 63 | 0 | 63 | 0 | 0 |
Formatter (stable)
✅ ecosystem check detected no format changes.
Formatter (preview)
✅ ecosystem check detected no format changes.
Ecosystem changes are 👍 |
Thanks! |
nkxxll
pushed a commit
to nkxxll/ruff
that referenced
this pull request
Mar 10, 2024
…#9878) ## Summary Given: ```python """Make a summary line. Note: ---- Per the code comment the next two lines are blank. "// The first blank line is the line containing the closing triple quotes, so we need at least two." """ ``` It turns out we excluded the line ending in `"""`, because it's empty (unlike for functions, where it consists of the indent). This PR changes the `following_lines` iterator to always include the trailing newline, which gives us correct and consistent handling between function and module-level docstrings. Closes astral-sh#9877.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Given:
It turns out we excluded the line ending in
"""
, because it's empty (unlike for functions, where it consists of the indent). This PR changes thefollowing_lines
iterator to always include the trailing newline, which gives us correct and consistent handling between function and module-level docstrings.Closes #9877.