Enforce type checking in CI. Also run `poetry check`.

Signed-off-by: Daira Emma Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Emma Hopwood 2023-12-06 13:25:19 +00:00
parent 096fdf913a
commit 76ef14abf7
3 changed files with 16 additions and 6 deletions

View File

@ -1,4 +1,4 @@
name: flake8
name: lints
on: pull_request
@ -16,8 +16,15 @@ jobs:
- name: Install poetry
run: pip install --user poetry
- name: Run poetry check
run: poetry check
- name: Install dependencies
run: poetry install --no-root
- name: Run flake8
run: poetry run flake8
- name: Run pyanalyze
# `poetry run pyanalyze .` doesn't work in CI for some reason.
run: poetry run python -m pyanalyze .

View File

@ -35,12 +35,12 @@ generated documentation is <apidoc/simtfl.html>.
## Contributing
Please use `./check.sh` before submitting a PR. This currently runs `flake8`
and the unit tests locally.
Please use `./check.sh` before submitting a PR. This currently runs `flake8`,
`pyanalyze`, and the unit tests locally.
You can use `./check.sh -k <substring>` to run `flake8` and then only tests
with names matching the given substring. This will not suppress output to
stdout or stderr (but `./check.sh -bk <substring>` will).
You can use `./check.sh -k <substring>` to run `flake8`, `pyanalyze`, and then
only tests with names matching the given substring. This will not suppress
output to stdout or stderr (but `./check.sh -bk <substring>` will).
To see other options for running unit tests, use `poetry run python -m unittest -h`.

View File

@ -3,6 +3,9 @@
set -eu
cd -P -- "$(dirname -- "$(command -v -- "$0")")"
echo Running poetry check...
poetry check
echo Running flake8...
poetry run flake8