srstevenson / nb-clean

Clean Jupyter notebooks for version control. Remove metadata, outputs, and execution counts with Git and pre-commit support.
https://pypi.org/project/nb-clean
ISC License
135 stars 18 forks source link

Add pre-commit hook #146

Closed carderne closed 1 year ago

carderne commented 2 years ago

Users should create a .pre-commit-config.yaml in their repo as follows:

repos:
- repo: https://github.com/srstevenson/nb-clean
  rev: 2.2.1  # needs this point release still!
  hooks:
  - id: nb-clean
    args: ['--remove-empty-cells']   # optional
  1. Note that rev needs to point to a tag that exists, and that includes this commit. (It could also just point to this commit hash.)
  2. Happy to add this as an example file to the repo, or add something to the README or just leave it.
  3. pre-commit will automatically install nb-clean by cloning this repo.
carderne commented 2 years ago

Can add the hook to this list once merged and functional.

carderne commented 2 years ago

resolves #145

codecov[bot] commented 1 year ago

Codecov Report

Merging #146 (4b04dfd) into main (0019065) will not change coverage. The diff coverage is n/a.

@@           Coverage Diff           @@
##             main     #146   +/-   ##
=======================================
  Coverage   97.95%   97.95%           
=======================================
  Files           3        3           
  Lines         147      147           
=======================================
  Hits          144      144           
  Misses          3        3           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

srstevenson commented 1 year ago

Merged locally and pushed, thanks again!