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>
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>
Black 22.3.0 fixespsf/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>
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>
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>