... | ... | @@ -70,12 +70,31 @@ https://chris.beams.io/posts/git-commit/ |
|
|
* We recommend using [virtualenv wrapper](http://virtualenvwrapper.readthedocs.io/en/latest/) to ease shell integration
|
|
|
* To automatically activate venvs: https://github.com/kennethreitz/autoenv
|
|
|
|
|
|
To use virtualenvs with Visual Studio Code editor:
|
|
|
|
|
|
- from your terminal, while the virtualenv is activated, identify the path of the `python` executable:
|
|
|
|
|
|
```sh
|
|
|
which python
|
|
|
# Should answer something like /home/username/.local/share/virtualenvs/virtualenvname/bin/python
|
|
|
```
|
|
|
|
|
|
- in Visual Studio Code, edit your workspace settings, and paste this block, adapting of course the path with your actual value:
|
|
|
|
|
|
```json
|
|
|
{
|
|
|
"python.pythonPath": "/home/username/.local/share/virtualenvs/virtualenvname/bin/python"
|
|
|
}
|
|
|
```
|
|
|
|
|
|
### autopep8
|
|
|
|
|
|
We use [autopep8](https://github.com/hhatto/autopep8) to reformat Python code automatically, and avoid bikeshedding.
|
|
|
|
|
|
It works very well with the Visual Studio Code editor, and is enabled by default, as soon as you `pip install autopep8` in your venv.
|
|
|
|
|
|
First you must configure Visual Studio Code to work with virtualenvs (see above).
|
|
|
|
|
|
To define a limit of 120 characters per line, edit your user settings, and paste this block:
|
|
|
|
|
|
```json
|
... | ... | @@ -89,8 +108,13 @@ To define a limit of 120 characters per line, edit your user settings, and paste |
|
|
|
|
|
We use [pylint](https://pylint.readthedocs.io/en/latest/) to check code quality directly from our source code editor.
|
|
|
|
|
|
It works very well with the Visual Studio Code editor, and is enabled by default, as soon as you `pip install pylint` in your venv.
|
|
|
But you'll be annoyed by the huge amount of warnings, so edit your user settings, and paste this block:
|
|
|
It works very well with the Visual Studio Code editor.
|
|
|
|
|
|
First you must configure Visual Studio Code to work with virtualenvs (see above).
|
|
|
|
|
|
From your virtualenv in the shell, type `pip install pylint`.
|
|
|
|
|
|
By default you'll be annoyed by the huge amount of warnings, so edit your user settings, and paste this block:
|
|
|
|
|
|
```json
|
|
|
"python.linting.pylintArgs": [
|
... | ... | |