Skip to content

Stop rewriting % lines in runner.sh PEP8 check - #2086

Open
Don-Yin wants to merge 1 commit into
Project-MONAI:mainfrom
Don-Yin:fix-percent-formatting
Open

Don-Yin wants to merge 1 commit into
Project-MONAI:mainfrom
Don-Yin:fix-percent-formatting

Conversation

@Don-Yin

@Don-Yin Don-Yin commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Removed the sed that rewrote every line starting with % into pass # %.... It also caught continuation lines like % (losses[-1],) and caused the E999 in #1805. Jupytext already comments out magics when converting to a script, so it isn't needed.

Fixes #1805.

screenshot

Summary by CodeRabbit

  • Chores
    • Updated the PEP8 checking workflow to pass notebook-converted scripts to Flake8 without rewriting percent-prefixed lines. The existing handling of comment-line noqa directives remains unchanged.

Signed-off-by: Don Yin <Don_Yin@outlook.com>
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 730e2a63-2ba3-4f07-ad60-5f08aaca2145
Commits

Reviewing files that changed from the base of the PR and between d7c326e and cd0da8a.

Files selected for processing: 1
  • runner.sh
Files with no reviewable changes: 1
  • runner.sh

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

Walkthrough

The PEP8 check no longer rewrites percent-prefixed lines in notebook-converted scripts before running Flake8. The comment-line filter and Flake8 invocation remain unchanged.

Changes

PEP8 check

Layer / File(s) Summary
PEP8 input filtering
runner.sh
Removed the sed filter that converted percent-prefixed lines to pass # %. The remaining comment-line filter and Flake8 invocation are unchanged.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: Minimal · up to cd0da

The change preserves valid Python continuation lines without exposing notebook magics to Flake8. It is ready to merge after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: removing the rewriting of percent-prefixed lines in the runner.sh PEP8 check.
Description check Passed The description explains the change, its cause, and the linked issue. It includes a validation screenshot. It does not use the template headings or checklist, but the required change context is mostly…
Linked Issues check Passed The direct issue is #1805. It requires runner.sh to avoid introducing syntax errors while preparing Jupytext output for Flake8. In runner.sh, the PR removes the %-line sed rewrite from the Jup…
Out of Scope Changes check Passed The whole-PR diff contains one change in runner.sh. The change removes only the %-line rewrite that is identified as the cause of issue #1805. No unrelated source, test, configuration, or document…
Docstring Coverage Passed No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi…
Full details: Description check

Explanation

The description explains the change, its cause, and the linked issue. It includes a validation screenshot. It does not use the template headings or checklist, but the required change context is mostly complete.

Full details: Linked Issues check

Explanation

The direct issue is #1805. It requires runner.sh to avoid introducing syntax errors while preparing Jupytext output for Flake8. In runner.sh, the PR removes the %-line sed rewrite from the Jupytext-to-Flake8 pipeline. The remaining noqa filter and Flake8 invocation stay unchanged. This directly removes the reported transformation that corrupted valid multiline Python. Issue #1805 does not specify a required automated test.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff contains one change in runner.sh. The change removes only the %-line rewrite that is identified as the cause of issue #1805. No unrelated source, test, configuration, or documentation changes are present.

Full details: Docstring Coverage

Explanation

No eligible functions found in the changed files. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 0 functions across 0 files.

Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

runner.sh Parses Some Files Incorrectly

1 participant