[PYTHON] The story that yapf did not work in vscode

Symptoms

autopep8 and black work in vscode, but only yapf does not work

Conclusion

~ / .config / yapf / style was an empty file.

Write appropriately

~/.config/yapf/style


[style]
based_on_style = pep8
spaces_before_comment = 4

Verification

Open the command palette with ctrl + shift + p in vscode and check Show logs> window> python It looks like > ~ / .local / bin / yapf --diff ~ / test.py, so try the same on your terminal.

$ yapf --diff ~/test.py
// yapf: Unable to find section [style] in ~/.config/yapf/style

The lack of [style] is the cause of the error, so if you add it, it will work.

Recommended Posts

The story that yapf did not work in vscode
The story that `while queue` did not work in python
The story that 2D list replacement did not work in python
The story that sendmail that can be executed in the terminal did not work with cron
The story of debugging in the local environment because the compilation did not work with Read the Docs
The story of the release work of the application that Google does not tell
The story of exclude / include that Serverless Framework beginners misunderstood (did not understand) in beginner Pythonista
Results that did not get caught in the search with this word
About the case that the speaker did not make sound in Ubuntu LTS 20.04
The story that fits in with pip installation
[Python] Tensorflow 2.0 did not support Python 3.8, so the story of downgrading Python
The story that the version of python 3.7.7 was not adapted to Heroku
The story that Pathlib could not access the folder containing the half-width space
The story of the "hole" in the file
A story that didn't work when I tried to log in with the Python requests module
The story of an error in PyOCR
[VScode] autopep8 format does not work [Python]
The story that FastAPI may take supremacy
The story that scipy suddenly stopped loading
The story that XGBoost was finally installed
A story that did not end with exit when turning while with pipe input
A story that sometimes does not work if pip is up to date
I was in trouble because the behavior of docker container did not change
Download the top n Google image searches
Examples and solutions that the Python version specified in pyenv does not run
The story that 5GHz band access point could not be created on Ubuntu
Delete vertices that meet the conditions in networkx
Pipfile is not created in the current directory
After installing php7.2, the php command does not work
The story of finding the optimal n in N fist
The story of reading HSPICE data in Python
The story of viewing media files in Django
The one that displays the progress bar in Python
PyQtGraph may not be available in the interpreter.
[Jinja2] Solution to the problem that variables added in the for statement are not inherited
Note that I was addicted to npm script not passing in the verification environment
About the matter that the contents of Python print are not visible in docker logs
[Pyhton] I want to solve the problem that tkinter does not work on MacOS11
Solve the problem that CSS is not reflected during web application development in Flask
Solved the problem that the image was not displayed in ROMol when loaded with PandasTools.LoadSDF.
There is a pattern that the program did not stop when using Python threading
A solution to the problem that files containing [and] are not listed in glob.glob ()
When writing to a csv file with python, a story that I made a mistake and did not meet the delivery date
A story that I did not know how to load a mixin when making a front with the django app [Beginners learn python with a reference book in one hand]