Clarification regarding "hack" #244
-
Hello, this project looks really interesting, but to me personally the use of "hack" in the README puts me off.
I propose to have this rewritten to
If you agree, I'm happy to create a PR. :) Edit: I see there are a lot of references to "hacks" in the source code. Still, the badges are quite convincing, so maybe "hack" is an understatement. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments
-
The reason why I call it a The problem is that notebooks need to be a kind of Schrödiger-state, ignored and used at the same time. Since If you have a closer look at how the properties of That said, being a |
Beta Was this translation helpful? Give feedback.
-
Ok, I understand better now, thanks for your explanation! PS.: I've decided to go with |
Beta Was this translation helpful? Give feedback.
-
Hi @StefanBrand - I'm glad you've found nbqa useful, though note that it's even more of a hack than flake8-nb 😳 |
Beta Was this translation helpful? Give feedback.
-
@MarcoGorelli I wouldn't say nbQA is a hack, but a very sophisticated parsing wrapper around the tools which it supports. At least we don't monkey patch objects at runtime there 😝 |
Beta Was this translation helpful? Give feedback.
The reason why I call it a
hack
is that theApplication
class offlake8
isn't part of the official API and it isn't supposed to be subclassed ( see this comment from the creator of flake8 )The problem is that notebooks need to be a kind of Schrödiger-state, ignored and used at the same time.
flake8
can't be used directly on a notebook, since it internally is just a big JSON file, thus this tool needs to step in file discovery and replace the paths to the*.ipynb
files with an intermediate python representation of the notebook, useflake8
on the intermediate files and map the errors back to their origin in the notebook. The only way I found to achieve this is by usingApplication
in a way…