Add CI check to fail on whitespace-only changes with label bypass#18717
Add CI check to fail on whitespace-only changes with label bypass#18717harupy merged 8 commits intomlflow:masterfrom
Conversation
| @@ -1,5 +1,6 @@ | |||
| """ | |||
| Install binary tools for MLflow development. | |||
|
|
|||
|
|
||
| foo |
| def check(file_content: str) -> bool: | ||
| """ | ||
| Returns True if the file contains a shebang line at the beginning. | ||
|
|
There was a problem hiding this comment.
Pull Request Overview
This PR adds a new script to detect files where all changes consist only of blank lines, helping to reduce unnecessary commit history noise. The PR ironically demonstrates this functionality by including both intentional blank line changes (in documentation) and what appears to be an unintentional comment addition.
- Adds
dev/check_blank_lines.pyscript to detect blank line-only changes in PRs - Integrates the check into the GitHub Actions lint workflow
- Makes minor documentation formatting changes (blank lines added/removed)
Reviewed Changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| dev/check_blank_lines.py | New script that fetches PR diffs from GitHub API and identifies files with only blank line changes |
| .github/workflows/lint.yml | Adds new workflow step to run blank line checker and grants pull-requests read permission |
| dev/clint/src/clint/rules/os_environ_delete_in_test.py | Adds blank line and "foo" comment to docstring |
| dev/clint/src/clint/rules/no_shebang.py | Removes blank line from docstring |
| bin/install.py | Adds blank line to module docstring |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
/resolve Ignore ✅ Workflow completed successfully. Claude OutputPerfect! All PR review comments have been successfully resolved: SummaryI've addressed all 5 unresolved review comments from PR #18717:
All changes have been committed locally with DCO sign-off, and all pre-commit hooks passed successfully. The commit is ready but has not been pushed to the remote repository, as per the instructions. |
This adds a CI check that flags files where all changes are blank lines, helping avoid unnecessary commit history noise. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Added blank lines to test the CI check 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
- Always exit with 0 (non-blocking warning) - Remove sys.exit() and unused sys import - Use walrus operator for github_token and files 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
- Rename check_blank_lines.py to check_whitespace_only.py for accuracy - Change from warnings to errors, failing the check by default - Add bypass with "allow-whitespace-only" label (uses ::warning instead) - Update workflow to trigger on label changes (labeled/unlabeled events) - Simplify code by removing redundant comments and docstrings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
2c7b4ef to
d65e617
Compare
Extract common request logic into github_api_request() helper function, reducing urllib.request.urlopen calls from two to one. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
Add back the reference to GitHub Actions workflow commands documentation for the :: syntax. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: harupy <17039389+harupy@users.noreply.github.com>
- Remove extra blank line in bin/install.py docstring - Add back blank line in dev/clint/src/clint/rules/no_shebang.py docstring - Remove "foo" text and extra blank lines in dev/clint/src/clint/rules/os_environ_delete_in_test.py docstring Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
…flow#18717) Signed-off-by: harupy <17039389+harupy@users.noreply.github.com> Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: harupy <17039389+harupy@users.noreply.github.com>
🛠 DevTools 🛠
Install mlflow from this PR
For Databricks, use the following command:
Related Issues/PRs
Related to #18667
What changes are proposed in this pull request?
Adds
dev/check_whitespace_only.pythat detects and fails on files where all changes are whitespace-only. This prevents unnecessary commit history noise.allow-whitespace-onlylabel to bypass the check (errors → warnings)How is this PR tested?
Does this PR require documentation update?
Release Notes
Is this a user-facing change?
What component(s), interfaces, languages, and integrations does this PR affect?
Components
area/build: Build and test infrastructure for MLflowHow should the PR be classified in the release notes? Choose one:
rn/none- No description will be included. The PR will be mentioned only by the PR number in the "Small Bugfixes and Documentation Updates" sectionShould this PR be included in the next patch release?
🤖 Generated with Claude Code