With the default pylint, it was inconvenient because the code was not formatted as expected, so I will summarize how to change the detailed settings to your liking.
Not required if already installed.
sudo apt install -y python-pip
flake8: Code check (error warning) autopep8: Code formatting
pip install flake8 autopep8
Open setting.json
from VS Code settings and add a note in{}
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.formatting.autopep8Args": [
"--max-line-length", "500",
"--ignore", "E501",
],
"python.linting.flake8Args": [
"--ignore=E501,E266,E302",
]
}
"python.linting.pylintEnabled": false Disable pylint "python.linting.flake8Enabled": true Enable flake8 "--max-line-length", "500" Changed the character limit of one line of autopep8 to 500 (substantially none) "--ignore", "E501" Remove the character limit for one line of autopep8 I think either one of the above is good, but I'm putting it in for the time being "--ignore=E501,E266,E302" E501: Lifting the character limit on one line of flake8 E266: Removed warning when flake8 has too many #s E302: Removes warning when there are no line breaks between functions or classes
You should be able to use it with Ctrl
+ Shift
+ ʻI`. If you can't use it, please check if the Python version that introduced flake8 etc. with pip and the Python version of VS Code are the same.
https://qiita.com/psychoroid/items/2c2acc06c900d2c0c8cb https://qiita.com/ciloholic/items/9de9391f8457dc9bc60c
Recommended Posts