Skip to content
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

ruff format ignores notebooks unless specified #12185

Closed
Wazarr opened this issue Jul 4, 2024 · 3 comments
Closed

ruff format ignores notebooks unless specified #12185

Wazarr opened this issue Jul 4, 2024 · 3 comments

Comments

@Wazarr
Copy link

Wazarr commented Jul 4, 2024

Hi,

I have noticed when using the CLI that doing ruff format . ignores Jupyter notebooks.
I believe this a deviation from black, which effectively formats notebooks with black ., with the right dependencies installed.

It's only possible to format notebooks when the filename is provided, which forces me to iterate over files to format all my notebooks.
I have looked at the documentation and other issues, and I'm on the latest version of Ruff (v0.5.0).

Would it be possible to add an option to fix this issue?
Thanks

@MichaReiser
Copy link
Member

Can you try using extend-include = ["*.ipynb"] in your configuration? This way, notebooks should also be included when running ruff check (doc)

@Wazarr
Copy link
Author

Wazarr commented Jul 4, 2024

Apologies, only looked at CLI.
Thanks for the quick answer.

@Wazarr Wazarr closed this as completed Jul 4, 2024
@MichaReiser
Copy link
Member

No worries. The notebook documentation is fairly hidden away. We do have an issue with improving the discoverability.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants