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.01k stars 39 forks source link

`nbqa-ruff` uses outdated JSON schema #824

Closed janosh closed 1 year ago

janosh commented 1 year ago
$ pre-commit run --all-files
nbqa-ruff................................................................Failed
- hook id: nbqa-ruff
- exit code: 2

~/.cache/pre-commit/repo7oua9kz1/py_env-python3.11/lib/python3.11/site-packages/autopep8.py:182: DeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
  from lib2to3.pgen2 import tokenize as lib2to3_tokenize
error: TOML parse error at line 58, column 5
   |
58 |     "FLY", # flynt
   |     ^^^^^
Unknown rule selector: `FLY`

Related: https://github.com/astral-sh/ruff/issues/4529

Probably just needs a version bump.

MarcoGorelli commented 1 year ago

hey @janosh

yeah ruff isn't pinned by nbqa, you should be able to pin it by setting it in additional_dependencies, like additional_dependencies: [ruff==0.0.272]

janosh commented 1 year ago

I'm confused. Without pin, how come it doesn't default to the latest version?

MarcoGorelli commented 1 year ago

I guess because you installed it some time ago, before the latest release was out, and pre-commit cached that ruff version

janosh commented 1 year ago

Makes sense, thank you!