question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Allow setting line length, when setting `black` as autoformatter

See original GitHub issue

Problem Description

When setting black as autoformatter, the line-length (and the vertical ruler) are set and fixed to 88. Related: #14082

What steps reproduce the problem?

  1. set Preferences -> Completion and linting -> Code formatting -> Choose the code formatting provider to black
  2. Preferences -> Completion and linting -> Code style -> Maximum allowed line length is auto. set to 88
  3. can’t change this Maximum allowed line length

What is the expected output? What do you see instead?

Preset of 88 for black is fine, but since black provides the -l option (link), the maximum line length should be changeable.

Versions

  • Spyder version: 4.2.0

Dependencies

  • black

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
ccapranicommented, Aug 20, 2021

My apologies @ccordoba12 , and thanks so much for your efforts.

0reactions
ccordoba12commented, Aug 20, 2021

Hey @ccaprani, we’re aware this problem resurfaced again (see issue #14558). We’ll try to fix it in our next version (5.2.0), to be released at the end of September.

Read more comments on GitHub >

github_iconTop Results From Across the Web

VSCode: Setting line lengths in the Black Python code formatter
In VSCode, go 'Code -> Preferences -> Settings' and search for "python formatting black args".
Read more >
In python, how to tweak Black formatter, if possible?
Black explains the --line-length setting in more detail here: ... Black defaults to 88 characters per line, which happens to be 10% over...
Read more >
The Black code style - Black 22.12.0 documentation
Line length #. You probably noticed the peculiar default line length. Black defaults to 88 characters per line, which happens to be 10%...
Read more >
Using Black To Auto Format Your Python | HackerNoon
Note that Black defaults to 88 characters for its line length, but you can change that using the “-l” or “- -line-length” option....
Read more >
How to Auto-Format Your Python Code with Black
Change Number of Characters per Line. Note that Black defaults to 88 characters for its line length, but you can change that using...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found