Join the Kedro community

Updated 2 months ago

Running type checkers on Kedro projects

Is there a recommended way to run type checkers (e.g. MyPy) on Kedro projects?

M
D
2 comments

We don't really have a recommended way, but you should be able to use it like usual. In Kedro itself we have a Makefile with the following command:

lint:
	pre-commit run -a --hook-stage manual $(hook)
	mypy kedro --strict --allow-any-generics --no-warn-unused-ignores

Which is run as part of builds.

In the past (before "tools" were optional), I would just override the kedro lint command in the CLI to include additional checks, like MyPy. Now, assuming you've added the "lint" tool, you can do the same.

Add a reply
Sign up and join the conversation on Slack