Commit Graph

57 Commits

Author SHA1 Message Date
Seung Wan Yoo
32230e6f5c
fix: bug where the doublestar operation had inconsistent formatting. (#4154)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-05 05:33:11 -08:00
Brandon J
7edb50f5a0
fix: additional newline added to docstring when the previous line length is less than the line length limit minus 1 (#4185)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-05 04:56:07 -08:00
cobalt
632f44bd68
docs: Refactor pycodestyle/Flake8 compatibility docs (#4194)
Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-02-01 22:00:41 -08:00
Jelle Zijlstra
9728b8e9b8
Move hug_parens_with_braces_and_square_brackets into the unstable style (#4198)
Primarily because of #4036 (a crash) but also because of the feedback
in #4098 and #4099.
2024-02-01 21:58:51 -08:00
Jelle Zijlstra
cca3c0fd9f
Test that preview/unstable features are documented (#4187)
In #4096 I added a list of current preview/unstable features to the docs. I think
this is important for publicizing what's in our preview style. This PR adds an
automated test to ensure the list stays up to date in the future.
2024-01-30 22:22:38 -08:00
cobalt
8bf04549ff
Consistently add trailing comma on typed parameters (#4164)
Signed-off-by: RedGuy12 <61329810+RedGuy12@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-01-27 13:55:22 -08:00
Jelle Zijlstra
4f47cac192
Add --unstable flag (#4096) 2024-01-25 17:00:47 -08:00
cobalt
e7e122e9ff
docs: Move fmt: off docs (#4090) 2023-12-09 17:44:15 -08:00
tungol
89e28ea66f
Permit standalone form feed characters at the module level (#4021)
Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-11-20 20:44:33 -08:00
Yilei Yang
11da02da72
Handle more huggable immediately nested parens/brackets. (#4012)
Fixes #4011
2023-11-18 11:47:05 -08:00
Henri Holopainen
ddfecf06c1
Hug parens also with multiline unpacking (#3992) 2023-10-30 08:35:26 -07:00
Shantanu
c712d57ca9
Add trailing comma test case for hugging parens (#3991) 2023-10-27 12:17:54 -07:00
Gabriel Perren
caef19689b
Update current_style.md (#3990)
Fix small typo
2023-10-27 11:54:31 -07:00
Surav Shrestha
7bfa35cca8
docs: fix typos in change log and documentations (#3985) 2023-10-26 21:26:47 -07:00
Ikko Eltociear Ashimine
f7174bfc43
Fix typo in future_style.md (#3979)
parantheses -> parentheses
2023-10-26 09:43:42 -07:00
Henri Holopainen
878937bcc3
[2213] Add support for single line format skip with other comments on the same line (#3959) 2023-10-25 09:47:21 -07:00
Henri Holopainen
1d4c31aa58
[925] Improve multiline dictionary and list indentation for sole function parameter (#3964) 2023-10-25 08:35:37 -07:00
Henri Holopainen
882d8795c6
Fix merging implicit multiline strings that have inline comments (#3956)
* Fix test behaviour

* Add new test cases

* Skip merging strings that have inline comments

* Don't merge lines with multiline strings with inline comments

* Changelog entry

* Document implicit multiline string merging rules

* Fix PR number
2023-10-19 20:09:33 -07:00
Shantanu
e9356c1ff0
Document disabling E704 (#3888)
Linking #3887
2023-09-13 00:40:41 -07:00
rax
6123b4ac26
Document shebang comment behaviour (#3787) 2023-07-11 12:16:43 -07:00
Alwyn Kik
35722dff62
Max line length with bugbear (#3731)
* Make phrasing for flake8 users more concise

max-line-length should be 80 with flake8-bugbear
Fixes #3716

* Re-add rationale and an explanation for

disabling E203

* Run pre-commit
2023-06-12 12:20:31 -07:00
Jelle Zijlstra
3decbd6db9
Document each configuration option in more detail (#2839) 2023-05-24 19:55:12 -07:00
Harutaka Kawamura
a552f7096a
Fix an example for 'Improved parentheses management' in the (future of the) Black code style (#3635) 2023-04-03 06:56:59 -07:00
dependabot[bot]
3a9d6f0a5f
Bump myst-parser from 0.18.1 to 1.0.0 in /docs (#3601)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Richard Si <sichard26@gmail.com>
2023-03-19 18:52:40 -04:00
Aneesh Agrawal
4a063a9f8d
Improve multiline string handling (#1879)
Co-authored-by: Olivia Hong <ohong@lyft.com>
Co-authored-by: Olivia Hong <24500729+olivia-hong@users.noreply.github.com>
2023-03-07 11:52:19 -08:00
Richard Si
e506c46f7b
Rename design label to style because it's clearer (#3547) 2023-02-04 22:51:46 -05:00
Yilei "Dolee" Yang
ea5293b036
Document the future style changes introduced in #3489 and #3440 (#3541) 2023-02-04 22:30:47 -05:00
Jelle Zijlstra
c4bd2e31ce
Draft for Black 2023 stable style (#3418) 2023-01-31 15:39:56 -08:00
Yilei "Dolee" Yang
d950f15987
Update document now that paren wrapping CMs on Python 3.9+ is implemented (#3520) 2023-01-23 21:38:30 -08:00
Yilei "Dolee" Yang
f758010340
Documentation: clarify the state of multiple context managers (#3488)
Clarify that the backslash & paren-wrapping formatting for multiple
context managers aren't yet implemented.
2023-01-14 12:51:59 -05:00
sckarlin
27932494bc
Wordsmith current_style.md (#3383)
"realtime" doesn't make sense in this context.
2022-11-14 07:31:43 -08:00
Maximilian Cosmo Sitter
c23a5c15aa
Clarify that Black runs with --safe by default (#3378) 2022-11-10 10:14:48 -05:00
Yilei "Dolee" Yang
4abc0399b5
Enforce empty lines before classes/functions with sticky leading comments. (#3302)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-10-25 18:03:24 -07:00
KotlinIsland
0359b85b58
Preserve crlf line endings in blackd (#3257)
Co-authored-by: KotlinIsland <kotlinisland@users.noreply.github.com>
2022-10-04 13:10:11 -07:00
Blandes22
4c99900236
Make context manager examples in future style docs consistent (#3274) 2022-09-22 20:19:31 -07:00
Tom Fryers
04bce6ad2e
Improve order of paragraphs on line splitting (#3270)
These two paragraphs were tucked away at the end of the section, after
the diversion on backslashes. I nearly missed the first paragraph and
opened a nonsense issue, and I think the second belongs higher up with
it too.
2022-09-14 22:31:26 -04:00
James Salvatore
095fe0d649
docs: adds ExitStack alternative to future_style.md (#3247)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-08-31 21:25:13 -07:00
Richard Si
7757078ecd
Improve & update release process to reflect recent changes (#3242)
- Formalise release cadence guidelines
- Overhaul release steps to be easier to follow and more thorough
- Reorder changelog template to something more sensible
- Update release automation docs to reflect recent improvements (notably
  the addition of in-repo mypyc wheel builds)

Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-08-31 14:46:48 -07:00
Jelle Zijlstra
7af77d1cf1
Stability policy: permit exceptional changes for unformatted code (#3155) 2022-07-06 13:33:07 -04:00
Felix Hildén
eb5d175c9c
Update preview style docs to include recent changes (#3136)
Covers GH-2926, GH-2990, GH-2991, and GH-3035.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-06-27 16:24:34 -04:00
Sagi Shadur
4bb7bf2bdc
Remove newline after code block open (#3035)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-06-11 09:55:01 +03:00
Felix Hildén
62c2b167bc
Docs: clarify fmt:on/off requirements (#2985) (#3048) 2022-05-07 17:58:10 -07:00
Gunung P. Wibisono
3dea6e3635
Convert index.rst and license.rst to markdown (#2852)
Co-authored-by: Richard Si <63936253+ichard26@users.noreply.github.com>
2022-03-30 13:43:46 -07:00
Jelle Zijlstra
5379d4f3f4
stub style: remove some possible future changes (#2940)
Fixes #2938.

All of these suggested future changes are out of scope for an autoformatter and should be handled by a linter instead.
2022-03-21 15:20:41 -07:00
Felix Hildén
df0aeeeee0
Formalise style preference description (#2818)
Closes #1256: I reworded our style docs to be more explicit about the style we're aiming for and how it is changed (or isn't).
2022-01-28 16:49:43 -08:00
Richard Si
6417c99bfd
Hug power operators if its operands are "simple" (#2726)
Since power operators almost always have the highest binding power in expressions, it's often more readable to hug it with its operands. The main exception to this is when its operands are non-trivial in which case the power operator will not hug, the rule for this is the following:

> For power ops, an operand is considered "simple" if it's only a NAME, numeric CONSTANT, or attribute access (chained attribute access is allowed), with or without a preceding unary operator. 

Fixes GH-538.
Closes GH-2095.

diff-shades results: https://gist.github.com/ichard26/ca6c6ad4bd1de5152d95418c8645354b

Co-authored-by: Diego <dpalma@evernote.com>
Co-authored-by: Felix Hildén <felix.hilden@gmail.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-01-24 19:13:34 -08:00
Felix Hildén
6e97c5f47c
Deprecate ESP and move the functionality under --preview (#2789) 2022-01-20 15:42:07 -08:00
Felix Hildén
8c22d232b5
Create --preview CLI flag (#2752) 2022-01-19 17:34:52 -08:00
Felix Hildén
799f76f537
Normalise string prefix order (#2297)
Closes #2171
2022-01-13 09:59:43 -08:00
Richard Si
e401b6bb1e
Remove Python 2 support (#2740)
*blib2to3's support was left untouched because: 1) I don't want to touch
parsing machinery, and 2) it'll allow us to provide a more useful error
message if someone does try to format Python 2 code.
2022-01-10 04:16:30 -08:00