Skip to content

Commit

Permalink
Always run flake8 through pre-commit, and with doctests (home-assista…
Browse files Browse the repository at this point in the history
…nt#28490)

* Enable flake8 doctests everywhere

* Always run flake8 through pre-commit
  • Loading branch information
scop authored Nov 6, 2019
1 parent d9edd42 commit bb37bc3
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
{
"label": "Flake8",
"type": "shell",
"command": "flake8 homeassistant tests",
"command": "pre-commit run flake8 --all-files",
"group": {
"kind": "test",
"isDefault": true
Expand Down
2 changes: 1 addition & 1 deletion script/lazytox.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ async def pylint(files):

async def flake8(files):
"""Exec flake8."""
_, log = await async_exec("flake8", "--doctests", *files)
_, log = await async_exec("pre-commit", "run", "flake8", "--files", *files)
res = []
for line in log.splitlines():
line = line.split(":")
Expand Down
2 changes: 1 addition & 1 deletion script/lint
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ printf "%s\n" $files
echo "================"
echo "LINT with flake8"
echo "================"
flake8 --doctests $files
pre-commit run flake8 --files $files
echo "================"
echo "LINT with pylint"
echo "================"
Expand Down
1 change: 1 addition & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ norecursedirs = .git testing_config

[flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
doctests = True
# To work with Black
max-line-length = 88
# E501: line too long
Expand Down

0 comments on commit bb37bc3

Please sign in to comment.