Comments (4)
I see now that this matches the philosophy described in the README (to make diffs as small as possible). If so then feel free to close this issue.
from black.
I actually have a check not to insert a newline like you are seeing in the last line:
https://github.com/ambv/black/blob/master/black.py#L1199-L1209
I guess it doesn't work quite right. Your intuition was correct, this is not nice formatting. But almost! :-)
I'll fix this for you.
from black.
This is now fixed, thanks for your report!
from black.
Thanks for fixing it!
from black.
Related Issues (20)
- Crash on formatting `case case` syntax when line length set to be small HOT 2
- Style suggestiong: allow aligned dict values HOT 1
- Black cannot parse valid code HOT 2
- INTERNAL ERROR: Black produced invalid code: f-string: expecting '}' HOT 1
- GitHub Action: Option to parse version from pyproject.toml
- When reformatting a triple-quote string, black fails with an INTERNAL ERROR: Black produced code that is not equivalent to the source
- Empty line and `...` and "unindent does not match any outer indentation level" HOT 4
- #myomin
- Incorrectly strips tuple brackets from single entry tuple
- Standalone comments still partially broken
- Black keeps reformatting some code chunks back and forth between 2 different representations HOT 6
- formatting fails if the file is located on a network drive HOT 4
- line-length is not working as intended HOT 1
- newline after opening braces causes parser error HOT 1
- Docstrings not part of a function are incorrectly labeled as non-equivalent code HOT 1
- A bug when replacing quote variations HOT 1
- black 24.4.0 returns error when parsing valid Python fstring sentence HOT 1
- f-string internal formatting to be consistent with non-f-string formatting HOT 1
- INTERNAL ERROR HOT 1
- precommit black doesn't read from `pyproject.toml` file. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from black.