-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
W391 reported but not fixed in Jupyter notebook #13763
Comments
Yeah, I think we should limit this rule to individual cells and not for the concatenated content. |
The challenge here is that the rule looks at the tokens, so we'd need to basically run the |
* Enforce ruff rule RUF001 Disable the rule directly in the incriminated test file. * Enforce ruff/pyupgrade rule UP007 UP007 Use `X | Y` for type annotations * Enforce ruff/flake8-bugbear rules B028 and B904 * Exclude c-blosc from ruff linting * Ignore ruff/pycodestyle rule W391 astral-sh/ruff#13763 * Enforce ruff/flake8-logging rules (LOG) * Enforce ruff/flake8-implicit-str-concat rules (ISC) * Enforce ruff/flake8-executable rules (EXE) * Enforce ruff/flake8-future-annotations rules (FA) * Enforce ruff/flake8-return rules (RET) * Enforce ruff/flake8-slots rules (SLOT) * Add "numcodecs" to "src" The directories to consider when resolving first- vs. third-party imports. * Enforce ruff/flake8-simplify rules (SIM) * Enforce ruff/flake8-tidy-imports rules (TID) * Conflicting ruff lint rules The linter includes some rules that, when enabled, can cause conflicts with the formatter, leading to unexpected behavior. None None of these rules are included in Ruff's default configuration. However, since we have enabled some relevant rule sets, we disable these rules. * Enforce ruff/tryceratops rules (TRY) * Update ruff to 0.8.0 * Ignore ruff/flake8-simplify rule SIM105 SIM105 Use `contextlib.suppress(ImportError)` instead of `try`-`except`-`pass` * Ignore ruff/tryceratops rule TRY301 TRY301 Abstract `raise` to an inner function * Apply ruff/flake8-bugbear rule B904 B904 Within an `except` clause, raise exceptions with `raise ... from err` or `raise ... from None` to distinguish them from errors in exception handling * Apply ruff/flake8-bugbear rule B028 B028 No explicit `stacklevel` keyword argument found * Apply ruff rule RUF022 RUF022 `__all__` is not sorted
Ruff emits a W391 error, a spurious one as far as I can see, and
--fix
doesn't modify the file:The issue is associated to this line in the Jupyter Notebook:
"source": []
List of keywords you searched for before creating this issue: "W391"
A minimal code snippet that reproduces the bug.
code snippet
The command you invoked (e.g.,
ruff /path/to/file.py --fix
), ideally including the--isolated
flag.The current Ruff settings (any relevant sections from your
pyproject.toml
).The current Ruff version (
ruff --version
).The text was updated successfully, but these errors were encountered: