pycodestyle_magic
pycodestyle_magic copied to clipboard
Running flake8 against code in markdown cells
The flake8-markdown appears to offer support for linting code blocks in markdown files.
It would be useful if this could be applied to code blocks in notebook markdown cells, although I'm not sure how the reports could be displayed given the notebook structure (markdown cells don't have an output?), or how the code could be invoked. (The python-markdown extension might provide a useful crib in this respect?)
One possibility for the report display would be to put it into a dismissible HTML block inserted into the markdown cell just after each code block:
<div class="alert alert-danger alert-dismissible" role="alert">
<button type="button" class="close" data-dismiss="alert">x</button>
Report here...
</div>
This needs a bit more thought before I can implement this. Open for ideas/suggestions/PRs!