Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Pull request overview
Adds configurable lint rule selection to marimo check via config ([tool.marimo.lint]) and CLI overrides, including support for per-file PEP 723 script metadata.
Changes:
- Introduces
LintConfig(select/ignore) and a rule resolution mechanism (resolve_rules) to filter enabled lint rules. - Threads
lint_configthroughRuleEngine/Linter, adds CLI flags--select/--ignore, and supports PEP 723 file-level lint config merging. - Adds unit/integration tests and a PEP 723 fixture file demonstrating
[tool.marimo.lint].
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
marimo/_config/config.py |
Adds LintConfig and exposes it under MarimoConfig/PartialMarimoConfig. |
marimo/_lint/rule_selector.py |
New rule selection implementation (select/ignore, prefix matching, sorted output). |
marimo/_lint/rule_engine.py |
Accepts lint_config in create_default() and filters rules accordingly. |
marimo/_lint/linter.py |
Wires lint_config into linting pipeline; adds per-file PEP 723 config support. |
marimo/_lint/__init__.py |
Adds resolve_lint_config() helper and passes lint config into run_check(). |
marimo/_cli/cli.py |
Adds marimo check --select/--ignore options and passes resolved lint config into lint runner. |
marimo/_ai/_tools/tools/lint.py |
Notes TODO for applying session lint config in AI tool path. |
tests/_lint/utils.py |
Extends lint test helper to accept lint_config. |
tests/_lint/test_rule_selector.py |
Adds unit tests for rule selection behavior. |
tests/_lint/test_lint_config_integration.py |
Adds integration tests for config propagation + PEP 723 config reading. |
tests/_lint/test_files/empty_cell_with_lint_config.py |
Adds a PEP 723 metadata fixture demonstrating lint ignore configuration. |
| from marimo._config.manager import ScriptConfigManager | ||
|
|
||
| try: | ||
| file_config = ScriptConfigManager(file_path).get_config( | ||
| hide_secrets=False | ||
| ) |
There was a problem hiding this comment.
_rule_engine_for_file() re-reads the file from disk via ScriptConfigManager even though the notebook contents were already read earlier in get_notebook_status(). For large repos this adds avoidable I/O per file. Consider parsing the PEP 723 block from load_result.contents (or passing the already-read text into ScriptConfigManager / a helper) so each file is only read once.
- Fix mypy [assignment] error in _lint/__init__.py (wrong ignore code) - Regenerate packages/openapi/api.yaml and src/api.ts
Bundle ReportChanges will increase total bundle size by 52 bytes (0.0%) ⬆️. This is within the configured threshold ✅ Detailed changes
Affected Assets, Files, and Routes:view changes for bundle: marimo-esmAssets Changed:
|
mscolnick
left a comment
There was a problem hiding this comment.
nice work! I think (if not already done) it would be good to relax the empty cell rule to allow for comments. That was the main reason some people wanted configuration in the first place
|
Thanks! Will followup |
📝 Summary
Closes #8341
Adds configuration entry points changes for lint rule selection. Example: