Create a plugin for ruff
/flake8
that would check for bad practices specific to Kedro
#3853
Replies: 1 comment 1 reply
-
Thanks for submitting this idea @yury-fedotov! I've considered this at some point and I think it would be awesome. It looks like We could go the "easy" route and create a flake8 plugin, but frankly I'm not betting on the flake8 ecosystem long term... I could be wrong though. |
Beta Was this translation helpful? Give feedback.
-
Description
Came up with a random idea today, wanted to run by you.
Would a Kedro-related plugin for
flake8
be a thing in your opinion? And have you heard of something like that existing?Some ideas for rulesets to check are:
class
can be defined in file callednodes.py
_private
functions cannot be wrapped innode
constructornodes
- recommend leveraging modularpipeline
instead.catalog
entries (can this linter combine YAML and Python rules...?)Dataset Factories
for that.parameters
yamls (for this we probably import a rule from existing tool, likely it exists already)Context
I think this can simplify collaboration in large projects and help encourage proper usage of Kedro concepts.
Possible Implementation
Check how other plugins are made and implement something similar. There are tens of rulesets defined for
ruff
and hundreds (if not thousands?) plugins forflake8
, I'm sure there are good reference examples.Possible Alternatives
Do not do it :)
Beta Was this translation helpful? Give feedback.
All reactions