Running nbqa with flake8 complains about blank lines on notebook cells with functions
See original GitHub issueConsider a cell containing a function
# cell contents
def get_dataset():
return make_classification(
n_samples=1000, n_features=20, n_informative=15, n_redundant=5, random_state=7
)
I am getting the warnings
E302 expected 2 blank lines, found 1
.E305 expected 2 blank lines after class or function definition, found 1
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Verifying PEP8 in iPython notebook code - Stack Overflow
first load the magic in a Jupyter Notebook cell: ... seems to always have a "blank line at end of file", so I...
Read more >Configuration — nbQA 1.5.3 documentation - Read the Docs
You can configure nbQA either at the command line, or by using a pyproject.toml file. ... nbqa black my_notebook.ipynb --nbqa-process-cells add_to.
Read more >Linters — Using Automation To Support Quality Assured ...
Code in notebook code cells can be linted using various tools including ... enabled when flake8 is run from the command line, either...
Read more >We're the core team behind the popular Python autoformatter
Black allows you to write your Python code however you like, ... above a function definition, in that flake8 counts the comment as...
Read more >flake8-nb - PyPI
Flake8 based checking for jupyter notebooks. ... nbQA: Run isort, pyupgrade, mypy, pylint, flake8, mdformat, black, blacken-docs, and more on Jupyter ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure how we could consistently put the correct number of blank lines between cells…I’m tempted to just have a “suggested configs” document in which we suggest which errors to ignore for which tools. Or do you think this is solvable?
Great point. I didn’t think isort would change the file when no imports has to be sorted.