-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CI: configure pre-commit with ruff and other simple checks, run pre-commit in CI #159
base: main
Are you sure you want to change the base?
Conversation
- id: check-yaml | ||
- id: check-added-large-files |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's also add these two here for things that we have not been super consistent on in the past: trailing-whitespace
, end-of-file-fixer
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually had them in originally, I removed them because of the huge amount of changes all over the place that they would require. should I commit those changes as part of this PR as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, does this affect the workshops/
folder again or also analyses/
? The former acts as more of a long term storage for material shown previously and we don't necessarily want to change it a lot, but for the latter I'd be happy to just apply all the changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that this might cause a lot of conflicts though it might be best to wait with that, it might make rebasing #158 a lot more difficult.
After some digging, I think you can specify which files to apply the hook to, like:
(from reading https://www.edwinwenink.xyz/posts/70-version_control_on_notebooks_with_precommit_and_jupytext/) |
Thank you @ekauffma , I'll take a look. Which directories should be considered? e.g. these are the notebooks under
|
Hm I'd imagine we would only want |
Trying this out as @alexander-held mentioned it might be useful.
The only issue is that jupytext processes a lot of notebooks or python scripts that it has no business processing. I did not find an obvious way to restrict jupytext to only run on certain files. We could run it "manually" on the notebooks we care about but I guess it would be more elegant to do it via the pre-commit hook.
Suggestions are welcome :D