Ensure invoke lint task & its docs are in sync

Someday the entire Pelican code base will perhaps have Black and isort
formatting applied to it, but it doesn't make sense for the linter to
check that until it's actually done. This changes the `lint` Invoke task
to run Flake8 on changed lines only, which should bring it into line
with both the current Pre-commit and CI configurations.

Also, the docs erroneously stated that `invoke tests` would also check
for code style compliance, which has herein been fixed.
This commit is contained in:
Justin Mayer 2020-11-20 16:22:39 +01:00
commit f21969a016
2 changed files with 9 additions and 8 deletions

View file

@ -70,13 +70,11 @@ def isort(c, check=False, diff=False):
@task
def flake8(c):
c.run(f"{VENV_BIN}/flake8 {PKG_PATH} tasks.py")
c.run(f"git diff HEAD | {VENV_BIN}/flake8 --diff --max-line-length=88")
@task
def lint(c):
isort(c, check=True)
black(c, check=True)
flake8(c)