Skip to content

Rename check to skip_validation in code mode API#8803

Merged
manzt merged 1 commit intomainfrom
push-vzrlwrmxxzmp
Mar 20, 2026
Merged

Rename check to skip_validation in code mode API#8803
manzt merged 1 commit intomainfrom
push-vzrlwrmxxzmp

Conversation

@manzt
Copy link
Copy Markdown
Collaborator

@manzt manzt commented Mar 20, 2026

Agents were reaching for check=False too freely because the parameter name was innocuous and the docstring showed it as a normal usage pattern. Renaming to skip_validation makes the intent explicit and the new docstring frames it as an escape hatch rather than a routine option, which should discourage casual use.

Copilot AI review requested due to automatic review settings March 20, 2026 22:07
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 20, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Mar 20, 2026 10:18pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the internal code mode context API to make disabling validation more explicit, discouraging casual use by renaming the parameter and strengthening its documentation.

Changes:

  • Rename get_context(..., check=...) to get_context(..., skip_validation=...) and invert the default accordingly.
  • Update AsyncCodeModeContext to store/use _skip_validation instead of _check.
  • Refresh documentation and validation error hints to reference skip_validation.
Comments suppressed due to low confidence (1)

marimo/_code_mode/_context.py:886

  • In _dry_run_compile, the cycles error path still interpolates _check_false_hint, but that variable was renamed to _skip_hint above. As written, hitting new_cycles will raise a NameError instead of the intended RuntimeError message. Update the cycles error to use _skip_hint (or rename consistently).
            if new_cycles:
                raise RuntimeError(
                    f"Cycles detected: {new_cycles}{_check_false_hint}"
                )

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Agents were reaching for `check=False` too freely because the parameter
name was innocuous and the docstring showed it as a normal usage
pattern. Renaming to `skip_validation` makes the intent explicit and the
new docstring frames it as an escape hatch rather than a routine option,
which should discourage casual use.
@manzt manzt merged commit e6d2b08 into main Mar 20, 2026
43 checks passed
@manzt manzt deleted the push-vzrlwrmxxzmp branch March 20, 2026 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants