Skip to content
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

Add improved docstring processing #2885

Open
wants to merge 55 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
f263927
Add improved docstring processing
TomFryers Feb 17, 2022
be791f5
Add PR number to changelog
TomFryers Feb 17, 2022
073a55d
separate CHANGELOG section for preview style
JelleZijlstra Feb 21, 2022
52a36b5
Make fix_docstring preview parameter keyword-only
TomFryers Feb 21, 2022
3895c4d
Pretend to be in preview mode for diff-shades
TomFryers Feb 21, 2022
30e0ad3
Merge branch 'psf:main' into main
TomFryers Feb 21, 2022
0802ada
Merge remote-tracking branch 'origin/previewstyle'
TomFryers Feb 21, 2022
2541264
Revert "Pretend to be in preview mode for diff-shades"
TomFryers Feb 21, 2022
6156ea5
Merge branch 'main' of https://github.com/psf/black
TomFryers Feb 24, 2022
975767f
Blacken Black
TomFryers Feb 24, 2022
8adc896
Shorten over-long docstrings
TomFryers Feb 24, 2022
e5cdcff
Move opening quotes off own line
TomFryers Mar 2, 2022
7ed5fd2
Fix first-line indentation
TomFryers Mar 2, 2022
ebb4a32
Revert "Revert "Pretend to be in preview mode for diff-shades""
TomFryers Mar 2, 2022
a79d394
Undo temporary changes
TomFryers Mar 2, 2022
d223a97
Merge branch 'psf:main' into main
TomFryers Mar 11, 2022
ea07503
Merge remote-tracking branch 'origin/main'
TomFryers Mar 16, 2022
45a52de
Merge remote-tracking branch 'origin/main'
TomFryers Mar 25, 2022
54e8451
Merge remote-tracking branch 'origin/main'
TomFryers Mar 27, 2022
e073b63
Merge remote-tracking branch 'origin/main'
TomFryers Mar 28, 2022
76c5c13
Merge remote-tracking branch 'origin/main'
TomFryers Apr 5, 2022
06b2587
Merge branch 'main' into main
JelleZijlstra Apr 11, 2022
54976a3
Merge remote-tracking branch 'origin/main'
TomFryers Apr 22, 2022
2360449
Merge remote-tracking branch 'origin/main'
TomFryers May 5, 2022
ba84a7c
Merge remote-tracking branch 'origin/main'
TomFryers May 23, 2022
7b33820
Merge remote-tracking branch 'origin/main'
TomFryers Jun 10, 2022
8fc0430
Fix tests
TomFryers Jun 10, 2022
4b5f3c7
Fix bad single-line docstring indentation
TomFryers Jun 10, 2022
25be451
Merge remote-tracking branch 'origin/main'
TomFryers Jun 11, 2022
f51ea0a
Remove merge conflict residue
TomFryers Jun 11, 2022
b638eeb
Merge remote-tracking branch 'origin/main'
TomFryers Jul 9, 2022
5ad579a
Merge remote-tracking branch 'origin/main'
TomFryers Aug 2, 2022
08ec335
Merge remote-tracking branch 'origin/main'
TomFryers Aug 3, 2022
d72db33
Merge remote-tracking branch 'origin/main'
TomFryers Aug 17, 2022
f6d9127
Merge remote-tracking branch 'origin/main'
TomFryers Aug 30, 2022
a34724e
Blacken unblackened file
TomFryers Aug 30, 2022
0c872ce
Merge remote-tracking branch 'origin/main'
TomFryers Sep 2, 2022
b8d9c2e
Remove rogue merge marker
TomFryers Sep 2, 2022
2e71f32
Add whitespace to CHANGES.md
TomFryers Sep 2, 2022
b98a6a6
Merge remote-tracking branch 'origin/main'
TomFryers Sep 15, 2022
1595441
Merge branch 'main' into main
TomFryers Sep 26, 2022
a58d21c
Merge branch 'main' into main
TomFryers Oct 18, 2022
67cd06c
Merge branch 'main' into main
TomFryers Oct 27, 2022
3b089e3
Remove extra blank line
TomFryers Oct 27, 2022
9c6d257
Put LinesBlock docstring quotes on their own line
TomFryers Oct 27, 2022
ffaae19
Merge branch 'main' into main
TomFryers Nov 3, 2022
86d806c
Merge branch 'main' into main
TomFryers Nov 9, 2022
e5e2da6
Merge remote-tracking branch 'origin/main'
TomFryers Nov 10, 2022
9ba93f5
Use new quote style
TomFryers Nov 10, 2022
12dd417
Merge remote-tracking branch 'origin/main'
TomFryers Feb 9, 2023
34dbe7e
Fix docstring preview tests
TomFryers Feb 9, 2023
88fe1aa
Blacken Black
TomFryers Feb 9, 2023
c1f6e4a
Shorten docstring to fit in limit
TomFryers Feb 9, 2023
2f16112
Merge remote-tracking branch 'origin/main'
TomFryers Mar 31, 2024
b8c169f
Fix documentation link
TomFryers Mar 31, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Pretend to be in preview mode for diff-shades
  • Loading branch information
TomFryers committed Feb 21, 2022
commit 3895c4d5d16fedfcbc26ed123043e572a9c5de72
1 change: 1 addition & 0 deletions src/black/strings.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ def lines_with_leading_tabs_expanded(s: str) -> List[str]:

def fix_docstring(docstring: str, prefix: str, *, preview: bool) -> str:
# https://www.python.org/dev/peps/pep-0257/#handling-docstring-indentation
preview = True
if not docstring:
return ""
lines = lines_with_leading_tabs_expanded(docstring)
Expand Down