question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make cell-magics opt-in rather than opt-out

See original GitHub issue

Currently, nbqa tries to process all cell magics except those in

https://github.com/nbQA-dev/nbQA/blob/a99e0e2413c7af340ba994f86752bb29b8b36a82/nbqa/save_source.py#L31-L51

I think we should do the opposite: never process cell magics, except for some hard-coded common ones like matplotlib inline and timeit, + add a command-line argument so users can pass extra ones they might want to process

This means deprecating nbqa_ignore_cells and instead adding nbqa_process_cells.

IMO it’s OK to make a 0.6.0 release with this breaking change in - this is a relatively new project, and it’s not like the user-base is large enough that we need to go through a deprecation cycle

cc @nbQA-dev/nbqa-core in case anyone has any comments - else I’ll try to work on during the weekend

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MarcoGorellicommented, Apr 3, 2021

Yup - have gone with erroring in #559

0reactions
s-weigandcommented, Apr 3, 2021

IMHO making the option error or at least warn that it will be ignored, and point to this issue or somewhere in the docs is the most user-friendly and yet simple solution.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ipython/magic.py at main
written as completely standalone functions rather than trying to share code. # and make a single one with convoluted logic.
Read more >
Module: core.magic — IPython 8.7.0 documentation
Each value is a dict keyed by magic name whose value is the function docstring. If a docstring is unavailable, the value of...
Read more >
IPython cell magic for C# usage in jupyter notebooks ...
Last week I noticed a blog post on how to use C# magic cells with pythonnet from IPython kernel by Xavier Dupré @sdpython...
Read more >
15 Data Science hacks to speed up analysis
We can alter or modify the ast_note_interactivity kernel option to make Jupyter do this ... Its combined editions comprise more than 60 million...
Read more >
nbqa Changelog
Processing cell-magics is now opt-in rather than opt-out. Original output from tool is always printed with ``--nbqa-diff``.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found