-
-
Notifications
You must be signed in to change notification settings - Fork 39
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
False positive for ruff
I001
(isort) when there is a function/class definition after the imports cell
#806
Comments
thanks @felix-cw for the report, will take a look |
Right, so # %%NBQA-CELL-SEPb4b132
import os
# %%NBQA-CELL-SEPb4b132
cwd = os.getcwd()
x = np.arange(1, 10)
# %%NBQA-CELL-SEPb4b132
import foo
# %%NBQA-CELL-SEPb4b132
class Foo:
...
# %%NBQA-CELL-SEPb4b132
import foo
# %%NBQA-CELL-SEPb4b132
def foo():
... The following passes I may need to preprocess the temporary Python file before passing it to |
one solution could be to pass autopep8 with only codes E3 selected first this'd be a pretty big change, and I'll need to test it out thoroughly first. it might even warrant a 2.0 release. but it might be the right thing to do |
@felix-cw this should be solved in version 1.7.0, would appreciate it if you could check - thanks 🙏 |
@MarcoGorelli Thanks so much for working on this. I'll make sure to have a look later on and let you know on here. |
I hope you don't mind, but I use |
of course! @all-contributors please add @felix-cw for infra |
I've put up a pull request to add @felix-cw! 🎉 |
This bug is similar to #796 (thank you very much for fixing that!).
It arises when running
nbqa ruff
As in #796, there is a false positive error message of
and
--fix
does not change the notebook, even though it reports it as fixed.My minimal notebook has the following cells:
If I add the
--diff
option, it wants to insert a newlineThe text was updated successfully, but these errors were encountered: