black
black copied to clipboard
The uncompromising Python code formatter
### Description This is one possible fix for: https://github.com/psf/black/issues/3040 I have added the `--project-root` command line argument which can be used to force black to evaluate paths relative to that...
**Describe the bug** black does not exclude files in git submodules when full filename is passed **To Reproduce** I created an example project with a git submodule to test. The...
Current output of `black`: ```python self.assertEqual( [ ( "", (), dict( description="((a descriptive description)) #expected-title-tag", tags={ "ORIGxNAL_AUTHOR": "expected-user", "TOOL": "//expected/tool", }, reviewers=["[email protected]"], ), ) ] ) ``` I would estimate...
### Description Added a new feature in preview mode: *Black* now knows how to trim trailing whitespaces inside f-strings. For example the following code: ```python print(f"there are { 2 }...
Running Black on the following code makes no changes: ```python ( "whatever" == "a very long string broken across two lines. " "If you put this on one line it...
**Describe the bug** If a line that exceeds the character limit has parameter comments, the function won't be moved to a new line inside parentheses. Without parameter comments, Black will...
**Describe the bug** Black's --preview mode produces invalid code in the first pass, causing second pass to fail. **To Reproduce** For example, take this code: ```python some_dict = { "something_something":...
**Describe the style change** Currently, black does not add a space after unary operators like unpacking, but does around binary operators. When operator hugging seems to contradict precedence, should black...
My problem is that sometimes I'm editing some code in a project that doesn't use Black (heresy, I know). Sometimes I'll type some code, or paste into the source something...
The following snippet makes black fail with "Black produced code that is not equivalent to the source.". ``` import typing as t class Named(t.Protocol): # fmt: off @property def title(self)...