blacken-docs icon indicating copy to clipboard operation
blacken-docs copied to clipboard

More general `.pre-commit-hooks.yaml` for Jupyter Notebooks

Open jamesbraza opened this issue 2 years ago • 1 comments

Description

black-jupyter integrates Jupyter notebooks into the hook's targets.

https://github.com/adamchainz/blacken-docs/blob/1.16.0/.pre-commit-hooks.yaml#L6 should be using types_or over files:

-    files: '\.(rst|md|markdown|py|tex)$'
+    # text encompasses rst, md, tex
+    types_or: [rst, markdown, tex, python, pyi, jupyter]

To discover what to input to types_or, use https://github.com/pre-commit/identify:

> identify-cli hi.rst
["file", "non-executable", "rst", "text"]

jamesbraza avatar Oct 23 '23 21:10 jamesbraza

Related: https://github.com/adamchainz/blacken-docs/issues/240

jamesbraza avatar Oct 23 '23 21:10 jamesbraza