nb-clean icon indicating copy to clipboard operation
nb-clean copied to clipboard

Add `required` option to `git filter`

Open kai-tub opened this issue 2 years ago • 1 comments

Thanks for writing such a convenient tool! I personally would like it if we could have an option to add required = True to the git filter option. Optionally, I want to decide whether I want to get the output with:

[filter "nb-clean"]
	clean = nb-clean clean --preserve-cell-metadata
	required = True

Instead of

[filter "nb-clean"]
	clean = nb-clean clean --preserve-cell-metadata
	required = False # Could also use the empty line like before

The main use-case for me is that I use VSCode for quick edits (also to edit jupyter-notebooks) and when I use the vscode git-cli and have nb-clean installed in a conda/mamba environment then vscode will not use the correct environment and the cleaning is silently skipped (as vscode doesn't find the binary) I know that there are many possible options to fix it (not use conda/mamba, install nb-clean via pipx, etc.) but since it should be a minor change, maybe it could add some more convenience for similar use-cases?

I am also happy to add a tiny PR :)

Thanks!

kai-tub avatar Aug 11 '21 17:08 kai-tub

That use case sounds valuable, so I'd be happy to add this. Do you want to make a PR to add a --required flag to the add-filter subcommand? Let me know if you want any guidance!

srstevenson avatar Aug 12 '21 18:08 srstevenson

This issue was closed due to inactivity. Please reopen if still relevant.

github-actions[bot] avatar Aug 29 '23 03:08 github-actions[bot]