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:
🌐
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
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", ...
🌐
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.
Find elsewhere
🌐
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
1 month ago - 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
🌐
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 › 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
🌐
GitHub
github.com › microsoft › vscode-python › issues › 7645
Black formatter doesn't do anything · Issue #7645 · microsoft/vscode-python
April 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
🌐
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" ]
🌐
Reddit
reddit.com › r/python › how to auto-format your python with black + vscode
r/Python on Reddit: How to auto-format your Python with Black + VSCode
June 28, 2020 - AFAIK you need to provide VSCode with a formatter to use, eg. autopep8 or Black ... I haven't used autopep8 much so I can't comment. It's probably not significantly different. I like Black because it's very simple and opinionated, the only user defined configuration is the line length and quote style iirc.