Skip to content

Instantly share code, notes, and snippets.

@S-Stephen
Created February 3, 2021 19:48
Show Gist options
  • Save S-Stephen/08d46078fcc653fc56adc10563fd6705 to your computer and use it in GitHub Desktop.
Save S-Stephen/08d46078fcc653fc56adc10563fd6705 to your computer and use it in GitHub Desktop.
python flake8 linting on file save VSC copy into .vscode/settings.json pip install flake8
{
"python.linting.pylintEnabled": false,
"python.linting.flake8Enabled": true,
"python.linting.flake8Args": ["--ignore=E24,W504", "--verbose"],
"python.linting.enabled": true,
"python.lintOnSave": true
}
@S-Stephen
Copy link
Author

To run the linting before commit and before it is run in your github action, add this config to your VSCode settings file:

In the root directory (top level folder) of your repository this into your VScode settings file (.vscode/settings.json)

You will need to install flake8 (one of?);

$pip install flake8
$conda install flake8
$pipenv install flake8

Everytime you save a python file linting will be checked (see 'PROBLEMS' tab in the terminal window), clear these issue before commiting / pushing your files - no more flake8 errors in your github actions!

Further reading: https://code.visualstudio.com/docs/python/linting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment