Skip to content
Snippets Groups Projects
Unverified Commit bb37bc32 authored by Ville Skyttä's avatar Ville Skyttä Committed by GitHub
Browse files

Always run flake8 through pre-commit, and with doctests (#28490)

* Enable flake8 doctests everywhere

* Always run flake8 through pre-commit
parent d9edd425
No related branches found
No related tags found
No related merge requests found
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
{ {
"label": "Flake8", "label": "Flake8",
"type": "shell", "type": "shell",
"command": "flake8 homeassistant tests", "command": "pre-commit run flake8 --all-files",
"group": { "group": {
"kind": "test", "kind": "test",
"isDefault": true "isDefault": true
......
...@@ -120,7 +120,7 @@ async def pylint(files): ...@@ -120,7 +120,7 @@ async def pylint(files):
async def flake8(files): async def flake8(files):
"""Exec flake8.""" """Exec flake8."""
_, log = await async_exec("flake8", "--doctests", *files) _, log = await async_exec("pre-commit", "run", "flake8", "--files", *files)
res = [] res = []
for line in log.splitlines(): for line in log.splitlines():
line = line.split(":") line = line.split(":")
......
...@@ -15,7 +15,7 @@ printf "%s\n" $files ...@@ -15,7 +15,7 @@ printf "%s\n" $files
echo "================" echo "================"
echo "LINT with flake8" echo "LINT with flake8"
echo "================" echo "================"
flake8 --doctests $files pre-commit run flake8 --files $files
echo "================" echo "================"
echo "LINT with pylint" echo "LINT with pylint"
echo "================" echo "================"
......
...@@ -21,6 +21,7 @@ norecursedirs = .git testing_config ...@@ -21,6 +21,7 @@ norecursedirs = .git testing_config
[flake8] [flake8]
exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build exclude = .venv,.git,.tox,docs,venv,bin,lib,deps,build
doctests = True
# To work with Black # To work with Black
max-line-length = 88 max-line-length = 88
# E501: line too long # E501: line too long
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment