srstevenson / nb-clean

Clean Jupyter notebooks of outputs, metadata, and empty cells, with Git integration
https://pypi.org/project/nb-clean/
ISC License
128 stars 18 forks source link

Update README.md to make long vs short flags clearer #253

Closed DanielTsiang closed 5 months ago

DanielTsiang commented 5 months ago

Update README.md to make use of long vs short flags clearer, and fix copy-paste typo in the bottom table for ignoring notebook metadata.

I mistakenly just copy and pasted the command from the table but then was confused why it wasn't working...better to make it more foolproof 🙂

This PR addresses the following issue:

codecov[bot] commented 5 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (80640b4) 99.46% compared to head (740a78f) 99.46%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #253 +/- ## ======================================= Coverage 99.46% 99.46% ======================================= Files 3 3 Lines 187 187 ======================================= Hits 186 186 Misses 1 1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

DanielTsiang commented 5 months ago

This pull request may be merged without approvals.

Only those with write access to this repository can merge pull requests.

@srstevenson thanks for looking at my PR, could you help merge it please?

DanielTsiang commented 5 months ago

@srstevenson That makes sense, thanks for explaining!

From your reply on the issue here, I only just realised that the flag can go before or after the notebook filename (but has to go after clean or check). It wasn't obvious to me from the docs.

I personally think this:

$ nb-clean check --preserve-notebook-metadata my-notebook.ipynb

is a lot neater/simpler than this (which is how it's written in the docs), especially when using it in the CI and you're passing filenames to the check or clean command via xargs:

$ nb-clean check my-notebook.ipynb --preserve-notebook-metadata