thoth-station / thoth-ops-infra

Infrastructure project to have collections of container images.
GNU General Public License v3.0
0 stars 9 forks source link

Should we use mypy with pre-commit or with pytest images ? #75

Open VannTen opened 1 year ago

VannTen commented 1 year ago

Is your feature request related to a problem? Please describe. I notice we use two ways of running mypy, via pre-commit, and via the thoth-pytest* image. We should remove one of those two, for the sake of consistency (+ less maintenance).

Here is my understanding of the two alternatives:

pre-commit:

separate image (same as pytest):

Any prefs ? @goern @harshad16

goern commented 1 year ago

I'd rate "local dev" as a huge pro, therefor I would prefer the pre-commit alternative

/kind documentation /priority important-soon

VannTen commented 1 year ago

/sig devsecops

VannTen commented 1 year ago

Actually, it looks like pytest has a --mypy option. So we could run it as one pytest test. One benefit is that it will complain when it will use types hints from installed dependency (should they not be in types-all) whereas pre-commit will not install anything from the repository.

(for example, compare the difference in output on current master of thoth-station/adviser bewteen pipenv run pytest and pre-commit run --all-files mypy` )