The issue is that you need =80 instead of 80 after --line-length for version 1.38.1 and above:

--line-length=80  

Answer from Pavel Hanpari on Stack Overflow
🌐
DEV Community
dev.to › adamlombard › vscode-setting-line-lengths-in-the-black-python-code-formatter-1g62
VSCode: Setting line lengths in the Black Python code formatter - DEV Community
March 20, 2024 - In VSCode, go 'Code -> Preferences -> Settings' and search for "python formatting black args". Add two separate arguments, in this order: --line-length and n, where "n" is your desired number of allowed characters per line:
Discussions

Python devs that use Black for formatting. When I format with VSCode's black, it ignores the problem of very long lines and formats this way. Does it happen to anyone else?
Black defaults to 88 characters, even though PEP8 is 79 characters and most linters default to that value. You can either adjust your black settings or linter settings to make everything agree. More on reddit.com
🌐 r/vscode
18
30
May 22, 2022
Black Fails to Format Single String Longer Than Line Length Limit
Describe the bug A Python file containing a single string assignment longer than the line length limit is not reformatted. To Reproduce Take long_line.py: long = "This is a long line that is l... More on github.com
🌐 github.com
28
November 2, 2020
visual studio code - VSCode Python Formatting - Stack Overflow
I use VSCode and when I format the Python code with Black formatter (installed an extension) list's elements are printed one on each line. What's the problem? From this: a = [17, 24, 91, 96, 67, -2... More on stackoverflow.com
🌐 stackoverflow.com
Black formatter doesn't do anything
Running without --diff --quiet reformats the file and is reflected in VSCode. ... Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python) > /usr/bin/python3 -m black --line-length 80 --diff --quiet /depot/build/tools/install... More on github.com
🌐 github.com
27
October 2, 2019
🌐
GitHub
github.com › microsoft › vscode-black-formatter › issues › 310
--line-length argument not working · Issue #310 · microsoft/vscode-black-formatter
September 11, 2023 - I've installed the Black Formatter extension and updated my settings, but for some reason, the line lengths aren't updated on save. My settings.json: Black Formatter output log: Code in que...
Author   sHermanGriffiths
🌐
GitHub
yellowduck.be › posts › vscode-setting-line-lengths-in-the-black-python-code-formatter
🔗 VSCode: Setting line lengths in the Black Python code formatter
In VSCode, go 'Code -> Preferences -> Settings' and search for "python formatting black args". Add two separate arguments, in this order: --line-length and n, where "n" is your desired number of allowed characters per line.
🌐
Safjan
safjan.com › home › note › change black line length
Change black line length - Krystian Safjan's Blog
August 31, 2022 - In the second line, 100 is the desired limit for the maximum line length. You can add the information to the formatting section of settings.json which can be found in the project's .vscode directory · { "python.formatting.provider": "black", ...
Find elsewhere
🌐
Visual Studio Code
code.visualstudio.com › docs › python › formatting
Formatting Python in VS Code
November 3, 2021 - Formatting makes source code easier to read by human beings. By enforcing particular rules and conventions such as line spacing, indents, and spacing around operators, the code becomes more visually organized and comprehensible. You can view an example on the autopep8 page.
🌐
DEV Community
dev.to › facepalm › how-to-set-formatting-and-linting-on-vscode-for-python-using-black-formatter-and-flake8-extensions-322o
How to Set Formatting and Linting on VSCode for Python using Black Formatter and Flake8 Extensions - DEV Community
October 12, 2023 - If you want VSCode to format on save, you need to write this: { "editor.defaultFormatter": "ms-python.black-formatter", "editor.formatOnSave": true, // new } You can enforce a line length by passing an argument to Black Formatter: { // ...
🌐
GitHub
github.com › microsoft › vscode-black-formatter › discussions › 287
Black Settings · microsoft/vscode-black-formatter · Discussion #287
Something went wrong. There was an error while loading. Please reload this page. ... You can add "black-formatter.args": ["--line-length", "100"] to either your user settings or workspace settings.
Author   microsoft
🌐
Medium
williamhayes.medium.com › vscode-python-formatting-problems-540b9808dade
VSCode Python Formatting Problems | by William Hayes, PhD | Medium
April 5, 2020 - Output 4 resulted from the following argument entry in VSCode using --line-length=100 Basically, if VSCode sees a space in your argument, it’s going to quote it, which naturally breaks black.
🌐
Read the Docs
black.readthedocs.io › en › stable › the_black_code_style › current_style.html
The Black code style - Black 26.3.0 documentation
If you’re paid by the lines of code you write, you can pass --line-length with a lower number. Black will try to respect that. However, sometimes it won’t be able to without breaking other rules. In those rare cases, auto-formatted code will exceed your allotted limit.
🌐
Orchestra
getorchestra.io › guides › how-to-install-black-formatter-on-vs-code
How to Install Black Formatter on VS Code | Orchestra
February 10, 2026 - In the search bar, type "format on save" and check the option "Editor: Format On Save." This ensures your code is automatically formatted every time you save a file. ... If you want to customize how Black formats your code, you can create a pyproject.toml file in your project's root directory. This file can include settings such as line length:
🌐
GitHub
github.com › psf › black › issues › 1802
Black Fails to Format Single String Longer Than Line Length Limit · Issue #1802 · psf/black
November 2, 2020 - One possible solution is to break on the <line length limit minus 1> character and parenthesize if it is not already inside parentheses: long = ( "This is a long line that is longer than 88 characters.
Author   kennytrytek-wf
🌐
Dzx1025
dzx1025.com › p › python-formatter-setting-in-vscode
Python Formatter setting in VSCode
April 2, 2024 - While using Black Formatter in ... "90" ] } Before:\nAfter:\nAbout the best line length number, refer to Black document.\nIn general, 90-ish seems like the wise choice.\n...
🌐
Stack Overflow
stackoverflow.com › questions › 77236631 › vscode-python-formatting
visual studio code - VSCode Python Formatting - Stack Overflow
If you want to change the line-length in order to have this particular statement on a single line, use Black's --line-length argument in your VS Code configuration: "black-formatter.args": [ "--line-length", "119" ]
🌐
Ghostwriter
ghostwriter.wiki › coding-style-guide › style-guide
Overview - Ghostwriter Documentation
Add the following settings to VSCode’s settings.json: Copy · Ask AI · "editor.formatOnSave": true, "python.formatting.provider": "black", "python.formatting.blackArgs": [ "--line-length", "90" ], VSCode will now use Black to format all Python ...
🌐
GitHub
github.com › microsoft › vscode-python › issues › 7645
Black formatter doesn't do anything · Issue #7645 · microsoft/vscode-python
October 2, 2019 - { "python.pythonPath": "/usr/bin/python3", // Where to pick up PYTHONPATH from "python.envFile": "${workspaceFolder}/.vscode/depot.env", // Lint python with flake8 (pyflakes + style) "python.linting.enabled": true, "python.linting.pylintEnabled": false, "python.linting.flake8Enabled": true, "python.linting.flake8Args": [ //flake8 and black define the length differently "--max-line-length=81", ], // Format python with black line length 80 "python.formatting.provider": "black", "python.formatting.blackArgs": [ "--line-length", "80" ], "[python]": { "editor.formatOnSave": true, "editor.formatOnSaveTimeout": 5000, }, }
Author   dfarley1
🌐
GitHub
github.com › psf › black › issues › 4148
Formatting of long lines only work when line-length is specified · Issue #4148 · psf/black
January 11, 2024 - Using Black Formatter extension on vs code which uses v23.10.1 for some reason I get no line formatting by default (of 79 characters) however things work when I declare line-length and any value (including the default of 79) I feel like ...
Author   howardwu1