black icon indicating copy to clipboard operation
black copied to clipboard

The uncompromising Python code formatter

Results 577 black issues
Sort by recently updated
recently updated
newest added

### 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...

C: configuration
C: file collection

**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...

T: bug
C: file collection

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...

T: enhancement
T: style

### 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...

T: bug
F: strings
F: linebreak
C: preview style

**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...

T: bug
F: comments
F: linebreak

**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":...

T: bug
C: invalid code
F: strings

**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...

T: design
F: parentheses

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...

T: enhancement
C: integrations

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)...

T: bug
F: fmtoff