dnanhkhoa / nb_black

A simple extension for Jupyter Notebook and Jupyter Lab to beautify Python code automatically using black.
MIT License
367 stars 41 forks source link

Configuring nb_black as a pre-commit hook #21

Open mbaudin47 opened 4 years ago

mbaudin47 commented 4 years ago

I commonly use black as a pre-commit git hook. To do this, I create the file .pre-commit-config.yaml with the following content:

repos:
  - repo: https://github.com/ambv/black
    rev: stable
    hooks:
    - id: black
      language_version: python3.7

It would be extremely convenient to have the same feature with nb_black.