Make the lint and type checks actually run - #47
Merged
Conversation
`tox -e lint` ran `black .`, which reformats the files in the runner and exits 0, so the lint job could not fail. Two files were unformatted on main while CI was green. Run `black` yourself, or `tox -e lint -- .`, to apply the changes.
* `deep_merge()` and `process_nested_yaml()` annotated their arguments as `any`, the builtin function, rather than `typing.Any` * `process_nested_yaml()`: accept a `project_path` of `None`, which is what `read_nested_yaml()` hands it when the yaml lives outside a viash project * `check_links()`: the values of `.links` are urls, not lists of urls
The component tests import anndata, pandas, requests and friends inside the function that needs them, so that a task repo only has to provide the ones its own components use. None of them ship type information.
`tox.ini` has had a `type` env since the start, but nothing ran it: the test job skips every env that is not `py<version>`, and the lint job only runs `lint`. It had accumulated 25 errors.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The lint job could not fail
tox -e lintranblack .-- which reformats the files in the runner, discards the result and exits 0. Two files were unformatted onmainwhile CI was green. It now runsblack --check --diff .;tox -e lint -- .still applies the changes.The first commit is that reformat on its own, so the rest of the diff stays readable.
The type checks never ran
tox.inihas had atypeenv since the start, but nothing invoked it: the test job skips every env that is notpy<version>(--skip-env '^(?!py310).+') and the lint job only runslint. It had quietly accumulated 25 errors, so this adds atypejob alongsidelintand clears them:deep_merge()andprocess_nested_yaml()annotated their arguments asany-- the builtin function -- rather thantyping.Anyprocess_nested_yaml()did not accept aproject_pathofNone, which is whatread_nested_yaml()hands it for a yaml outside a viash projectcheck_links()said the values of.linksmay be lists of urls. They are urls -- seeLinksinschemas/schema_viash.yaml-- andcheck_url()would have choked on a listignore_missing_importsoverridetox -e lint,tox -e typeandtox run -e py310all pass.