Add lint check for workshop material (trial) - #10
Closed
cmvcordova wants to merge 5 commits into
Closed
cmvcordova wants to merge 5 commits into
cmvcordova wants to merge 5 commits into
Conversation
Checks the files a pull request changes: notebooks must be valid JSON, Python, R and shell scripts must parse, Rmd/qmd headers and chunks must be well formed. Those fail the check. Code cells that do not parse, committed error outputs and relative image paths are reported as warnings, since student notebooks contain intentional blanks. Runs on pull_request with a read-only token, separate from the checklist workflow. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
PR ChecklistPR: #10 Please confirm the following before requesting review:
Reply to this comment or check off the boxes when complete. |
Reverted in the next commit. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This reverts commit 033374d. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Test caller: points at the add-workshop-lint branch of MiCM_PR_Bot. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Member
Author
|
Rerouted to QLS-MiCM/MiCM_PR_Bot#2: the linter and a reusable workflow now live there, and workshop repos only need a thin caller. Closing this without merging. The |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Trial of a lint check for workshop material, prompted by #9, where a missing comma made the notebook invalid JSON and nothing flagged it.
What it does
On every pull request it checks the files that PR changes.
Fails the check (the file cannot be opened or run at all):
.ipynbis not valid JSON.py,.Ror.shdoes not parse.Rmd/.qmdhas a broken YAML header or a code chunk that is never closed.mlxis not a valid archiveWarns only (annotations and a job summary, check still passes):
Cell-level syntax is a warning on purpose: student notebooks contain intentional blanks.
It is a separate workflow from the PR checklist one, which is untouched. It runs on
pull_requestwith a read-only token and no secrets, so it is safe for forks.How it was tested
Run locally against the files touched by 29 past pull requests across the organisation (93 files, 16 repositories):
.Rfile containing a sentence). None on the 26 merged PRs.On a GitHub runner, in this PR (each run takes about 10 seconds):
line 21: not valid JSON, the notebook cannot be opened(run).Because this PR changes the linter itself, it lints every file in the repository; a normal PR only has its changed files checked. The temporary commit and its revert disappear with a squash merge.
Not covered
.mfiles are not checked.If the trial works, the script and workflow could move to
MiCM_PR_Botand be synced to the other workshop repositories.🤖 Generated with Claude Code