Skip to content

Make the lint and type checks actually run - #47

Merged
rcannood merged 6 commits into
mainfrom
enforce-lint-and-types
Aug 13, 2026
Merged

Make the lint and type checks actually run#47
rcannood merged 6 commits into
mainfrom
enforce-lint-and-types

Conversation

@rcannood

Copy link
Copy Markdown
Member

The lint job could not fail

tox -e lint ran black . -- which reformats the files in the runner, discards the result and exits 0. Two files were unformatted on main while CI was green. It now runs black --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.ini has had a type env since the start, but nothing invoked it: the test job skips every env that is not py<version> (--skip-env '^(?!py310).+') and the lint job only runs lint. It had quietly accumulated 25 errors, so this adds a type job alongside lint and clears them:

  • deep_merge() and process_nested_yaml() annotated their arguments as any -- the builtin function -- rather than typing.Any
  • process_nested_yaml() did not accept a project_path of None, which is what read_nested_yaml() hands it for a yaml outside a viash project
  • check_links() said the values of .links may be lists of urls. They are urls -- see Links in schemas/schema_viash.yaml -- and check_url() would have choked on a list
  • anndata, pandas, requests, networkx, spatialdata, urllib3 and yaml have no type information, and are imported inside the function that needs them so a task repo only provides the ones its own components use. They get an ignore_missing_imports override

tox -e lint, tox -e type and tox run -e py310 all pass.

`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.
@rcannood
rcannood merged commit 03dce26 into main Aug 13, 2026
7 checks passed
@rcannood
rcannood deleted the enforce-lint-and-types branch August 13, 2026 11:09
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 this pull request may close these issues.

1 participant