Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run checks locally #160

Closed
centreboard opened this issue Mar 24, 2021 · 5 comments · Fixed by #172
Closed

Run checks locally #160

centreboard opened this issue Mar 24, 2021 · 5 comments · Fixed by #172

Comments

@centreboard
Copy link
Collaborator

The PR checks run linting, type checks and tests.

- name: Run linter
run: python3 -m pylint wheatley/**/*.py
- name: Run typechecker
run: python3 -m mypy wheatley --pretty --disallow-incomplete-defs --disallow-untyped-defs
- name: Run unit tests
run: python3 -m pytest
- name: Run integration tests
run: ./doctests
- name: Run fuzzer
run: ./fuzz

mypy and pylint are in the requirements, we just need a way of running these commands locally on Linux or Windows machines.
To cope with venvs, perhaps a python script that could be invoked? Looks like mypy and pylint both can be called from python
https://github.com/python/mypy/blob/master/docs/source/extending_mypy.rst
http://pylint.pycqa.org/en/latest/user_guide/run.html

@kneasle
Copy link
Owner

kneasle commented Mar 25, 2021

Running from python sounds like a good plan. Actually, what we could probably do is to make a python script which reads .github/workflows/main.yml and executes the shell commands. This way, there's no possibility for divergence between the two checking methods and we can keep the workflow split up into a separate job per check (which makes it nice and easy to find out what's failed).

@centreboard
Copy link
Collaborator Author

To combine them it would be better to have the github workflow call the python script

@kneasle
Copy link
Owner

kneasle commented Mar 25, 2021

True, but it would make the PR check into one monolithic job, which would make detecting what fails very pesty. At the moment, it's really easy to see which job fails:

2021-03-25_14-20-33_1920x1080

@centreboard
Copy link
Collaborator Author

I was imagining a script which ran all checks by default, or add an argument to run only specified

- name: Run linter 
  run: python3 ./runchecks.py --linter
- name: Run typechecker 
  run: python3 ./runchecks.py --types
- name: Run unit tests 
  run: python3 ./runchecks.py --unittests

@kneasle
Copy link
Owner

kneasle commented Mar 25, 2021

Oooh - OK yes that would make much more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants