Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow extra_keys as an argument when using a pre-commit hook #119

Closed
likewei92 opened this issue Mar 4, 2020 · 6 comments
Closed

Allow extra_keys as an argument when using a pre-commit hook #119

likewei92 opened this issue Mar 4, 2020 · 6 comments

Comments

@likewei92
Copy link

Current extrakeys is only configurable through git config (--global) filter.nbstripout.extrakeys. It would be great if we can configure this when using nbstripout as part of a pre-commit hook as well!

@kynan
Copy link
Owner

kynan commented May 9, 2020

Just to double check: do you mean pass those in as a command line argument like --extra-keys ?

@kynan kynan added this to the 0.3.8 milestone May 9, 2020
@kynan kynan added the state:waiting Waiting for response for reporter label May 9, 2020
@kynan kynan modified the milestones: 0.3.8, 0.3.9 Jun 6, 2020
@likewei92
Copy link
Author

@kynan sorry for the delayed reply - I meant being able to specify extrakeys in .pre-commit-config.yaml, though I think if you supported it in the command line you would be able to specify it in the yaml file as well (through args)

@kynan
Copy link
Owner

kynan commented Jun 24, 2020

Thanks, I'll have a look whether we want to support either or both.

@kynan
Copy link
Owner

kynan commented Jun 28, 2020

Can you give me some examples of extra keys you want to pass on the command line? And do you have an example notebook I could use to test?

@kynan kynan closed this as completed in 9f7d9f5 Jun 28, 2020
@kynan
Copy link
Owner

kynan commented Jun 28, 2020

I've implemented --extra-keys. You can use them with pre-commit e.g. as follows:

repos:
- repo: https://github.com/kynan/nbstripout
  rev: fe88889c2a68efebd48a3bf8fe909b6788d62305
  hooks:
    - id: nbstripout
      args: [--extra-keys=metadata.celltoolbar]

Feel free to reopen if this doesn't meet your needs.

kynan added a commit that referenced this issue Jun 28, 2020
@likewei92
Copy link
Author

That works, thanks!

@kynan kynan added resolution:fixed and removed help wanted state:waiting Waiting for response for reporter labels Apr 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants