Open juftin opened 2 years ago
Sounds interesting, let me check it out. Only issue might be that Databricks notebooks are saved as ".py" files, so we'd have to exclude them somehow.
We might also want to check out how the core mlflow repo handles code formatting so as to be compatible with them.
Request Summary
I would like to implement a tool like pre-commit to handle auto-code formatting and quality checks. This would be very helpful for onboarding new contributors.
Let me know if this is of interest I'm happy to help implement it.
As a contributor I would like:
Implementation Details
Step 1)
Add a new
.pre-commit-config.yaml
file at the root of the repo (I'll explain below what this does)The above config file sets up a number of tools to run automatically on edited files when the
git commit
action is performed:Step 2)
Commit the above file and install pre-commit:
Run a onetime code-cleanup of everything
Step 3)
Push all of these changes up into GitHub. This can be a painful part of implementing a tool like pre-commit since there will be a massive diff - I recommend the original maintainer be the one to push those changes to retain git blame history.
Step 4)
Add some details for new contributors. I have an example here I try to re-use across GitHub: https://juftin.com/camply/contributing.html
Step 5)
Nothing, new contributors code will auto-format during commit and they'll learn an awesome tool while they're at it