All Questions
33 questions
0
votes
1
answer
71
views
Python black formatting only one file in project
I've installed black formatting in the venv directory of my project. In my project, I have, among other files:
.vscode/settings.json
and
djblogger/djblogger/settings/base.py
in the settings.json is ...
1
vote
1
answer
3k
views
VS code autoformat python file with autopep8 not working
So I am trying to get an auto format setup for Python files with autopep8 in VS code I tried to use the "format document with" option to set the default formatter to autopep8 however when I ...
-1
votes
2
answers
78
views
What is the feature that lets you "minimize" text in an IDE like VS Code called?
I've simply been wondering what to call it. Also, does anyone know any extensions for VS Code that would let make custom ones, not simply the automade ones.
While true and dropdown arrow
I've kept ...
1
vote
2
answers
1k
views
How to display formatted Jupyter stack trace from "full output data"
I am debugging Python code in VS Code using the Jupyter integration in interactive mode.
The stack trace I get is only partially displayed, because "Output exceeds the size limit." I would ...
0
votes
1
answer
2k
views
Using VS Code Black Formatter extension to format multiple files at once
I have the Black Formatter extension configured to format the current file on save. I want to perform a one-time-only action where I format all my python files, as opposed to just the current file. I ...
9
votes
2
answers
6k
views
How to apply formatting rules from PyCharm in VSCode?
As I understand, PyCharm uses his own set of formatting rules.
https://www.jetbrains.com/help/pycharm/configuring-code-style.html#editorconfig
Is there any faster way to apply same rules to the VSCode ...
15
votes
5
answers
11k
views
Format a Jupyter notebook on save in VSCode
I use black to automatically format all of my Python code whenever I save in VSCode. I'd like the same functionality, but within a Jupyter notebook in VSCode.
This answer shows how to right click and ...
0
votes
1
answer
2k
views
I am facing problem while installing black formatter in vs code
WARNING: The scripts black.exe and blackd.exe are installed in 'C:\Users\hp\AppData\Local\Programs\Python\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you ...
0
votes
1
answer
233
views
How to auto format python kwargs to newlines in VS Code?
In VS Code, Python: How can keyword arguments:
number = models.CharField(
max_length=10, unique=True, verbose_name=_('Contract number'))
be automatically formatted into separate lines:
...
26
votes
2
answers
31k
views
VS Code Python Formatting: Change max line-length with autopep8 / yapf / black
I am experimenting with different python formatters and would like to increase the max line length. Ideally without editing the settings.json file. Is there a way to achieve that?
2
votes
1
answer
2k
views
VSCode: how to run yapf to format on save the file
I recently installed yapf using pip and configured the settings.json file of vscode but I don't know how to run yapf formatting the current opened file on save. Any clue?
here is my settings.json file:...
0
votes
0
answers
319
views
Remove indentation is not working on my instance of Visual Studio Code
Since I am coding in python indentation is particularly essential.
Normally, I can indent and unindent blocks of code using CTRL-] and CTRL-[, respectively. However, on my new cloud installation only ...
5
votes
3
answers
3k
views
Auto save adds two empty lines between comment and function header in Python in VS code
I write code in Python in VS code. If I add comment before function and hit save button, VS code adds two empty lines:
# comment
def MyMethod():
return 0
In settings I see that I use autopep8 ...
14
votes
2
answers
43k
views
Auto format flake8 linting errors in VSCode
I'm using the flake8 linter for Python and I have many code formats issues like blank line contains whitespace flake8(W293)
I'm trying to auto fix these linting issues. I have these settings:
&...
0
votes
0
answers
124
views
Python formatter "black" stopped working?
Can't open an issue on github atm because I get a 500 error for 30minutes now when trying to create the issue.
VS Code Version: 1.59.0
OS Version: Windows 10 Professional 64bit 21H2 19043.1151
Steps ...