Python vscode tips
install useful libs
1 2 3 4 |
|
Linting¶
Pylint¶
Powerful one, mostly a good choice.
Prospector¶
I have a project which has no depence of Django, But Prospector keep reporting Django is not available on the PYTHONPATH
for each py file, which I didn’t install on venv lib.
[Pylance]¶
For moudle developer:
Steps To fix worng Hint could not be resolved Pylance(reportMissingImports)
Shift+Ctrl+P, types setting
, find Perference: Open Settings (JSON)
add following into settings.json
1 2 3 4 |
|
flake8¶
add following into settings.json
1 2 3 |
|
Fromatting¶
black¶
add black
as default formator for vscode
1 2 3 4 5 |
|
Testing¶
Links¶
- black: https://black.readthedocs.io/
- Bandit: https://github.com/openstack/bandit
- Codacy: https://www.codacy.com/
- Dodgy: https://github.com/landscapeio/dodgy
- Draw.io: https://www.draw.io/
- Flake8: https://github.com/PyCQA/flake8
- Frosted: https://github.com/timothycrosley/frosted
- Landscape.io: https://landscape.io/
- McCabe: https://github.com/PyCQA/mccabe
- Prospector: https://github.com/landscapeio/prospector
- Pydocstyle: https://github.com/PyCQA/pydocstyle
- Pylama: https://github.com/klen/pylama
- Pylint: https://github.com/PyCQA/pylint
- Pyroma: https://github.com/regebro/pyroma
- Pyt: https://github.com/python-security/pyt
- PyTest: https://docs.pytest.org/
- PyUp.io: https://pyup.io/
- Radon: https://github.com/rubik/radon
- Safety: https://github.com/pyupio/safety
- Tox: https://github.com/tox-dev/tox
- Vulture: https://github.com/jendrikseipp/vulture