nbQA-dev / nbQA

Run ruff, isort, pyupgrade, mypy, pylint, flake8, and more on Jupyter Notebooks
https://nbqa.readthedocs.io/en/latest/index.html
MIT License
1.04k stars 41 forks source link

False positive for `ruff` `I001` (isort) #796

Closed felix-cw closed 1 year ago

felix-cw commented 1 year ago

The issue arises when running nbqa ruff

In this case, there seems to always be a false positive error message of

I001 [*] Import block is un-sorted or un-formatted

The --fix option does not change the notebook, but reports it as fixed anyway

Found 1 error (1 fixed, 0 remaining).

I use a notebook with the following two cells

import os

import numpy as np
cwd = os.getcwd()
x = np.arange(1, 10)

My versions: python 3.9.15 nbqa 1.6.1 ruff 0.0.247

MarcoGorelli commented 1 year ago

thanks @felix-cw for the report, fix incoming

MarcoGorelli commented 1 year ago

@all-contributors please add @felix-cw for bugs

allcontributors[bot] commented 1 year ago

@MarcoGorelli

I've put up a pull request to add @felix-cw! :tada: