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

Exclude jupyter notebooks from the pretty-format-json check by default #937

Closed
wants to merge 1 commit into from

Conversation

connortann
Copy link

@connortann connortann commented Jul 26, 2023

This PR proposes excluding Jupyter notebooks by default from the pretty-format-json hook.

A recent PR added jupyter notebooks (.ipynb) files as a json type, on the grounds that notebooks are stored as JSON files:
pre-commit/identify#401

Whilst this makes sense for the check-json hook, it causes some problems with the pretty-format-hook as described in this comment. Jupyter notebooks are conventionally saved with an indent of 1, whereas the pretty-format-hook uses a default indent of 4.

A proposed solution is just to exclude jupyter notebooks from the pretty-format-hook by default, which I think is broadly consistent with previous behaviour before PR above was added.

@connortann connortann changed the title Exclude jupyter types from the pretty-format-json check Exclude jupyter notebooks from the pretty-format-json check by default Jul 26, 2023
@asottile
Copy link
Member

no thanks, if someone wants to exclude particular types they can do so I'm their config rather than making that choice for everyone here

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

Successfully merging this pull request may close these issues.

2 participants