mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-03 10:23:11 +00:00
![]() ## Summary This PR updates the `E402` rule to work at cell level for Jupyter notebooks. This is enabled only in preview to gather feedback. The implementation basically resets the import boundary flag on the semantic model when we encounter the first statement in a cell. Another potential solution is to introduce `E403` rule that is specifically for notebooks that works at cell level while `E402` will be disabled for notebooks. ## Test Plan Add a notebook with imports in multiple cells and verify that the rule works as expected. resolves: #8669 |
||
---|---|---|
.. | ||
resources/test/fixtures/jupyter | ||
src | ||
Cargo.toml |