Commit Graph

5 Commits

Author SHA1 Message Date
Omar Sandoval
1c0dbcd917 pre-commit: add flake8
This has been useful to run manually before, but I haven't added it to
the CI because it was somewhat noisy. But, it reports some really useful
warnings, so let's configure it for our needs and add it to pre-commit.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-05-17 15:26:41 -07:00
Omar Sandoval
d9b8392d7f pre-commit: roll mypy back to v0.931
pre-commit/mirrors-mypy@d37f9c4f0c added
"from __future__ import annotations", which doesn't work on Python 3.6.
Python 3.6 is EOL, so it's probably time to drop it, but that should be
a different, intentional change.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-03-31 17:00:26 -07:00
Omar Sandoval
fbfe7f45ad pre-commit: update Black and mypy
Black 22.3.0 fixes psf/black#2964, which was breaking the CI with:

  ImportError: cannot import name '_unicodefun' from 'click'

mypy v0.942 doesn't complain about anything new.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-03-31 16:28:40 -07:00
Omar Sandoval
7f232a4815 pre-commit: update Black
Black 22.1.0 has some style changes: string prefixes are normalized and
spaces around the power operator are removed.

Signed-off-by: Omar Sandoval <osandov@osandov.com>
2022-02-12 13:48:49 -08:00
Stephen Brennan
ae377984d4 Add pre-commit
During PRs, lint and mypy errors can show up in the CI tests, which is
useful, but can introduce unnecessary churn on the PR as small lint
fixes are pushed. This commit adds (optional) support for pre-commit, a
tool which can be configured to run as a git pre-commit hook, running
linters on all changed code to catch issues before you push your code.

Signed-off-by: Stephen Brennan <stephen.s.brennan@oracle.com>
2022-01-14 13:31:16 -08:00