Closed tumido closed 4 years ago
@harshad16 can you please help me with the precommit error? I've tried installing a new hook to provide linting for Jupyter notebooks, but sesheta doesn't like it for some reason. Works just fine locally.
@harshad16 can you please help me with the precommit error? I've tried installing a new hook to provide linting for Jupyter notebooks, but sesheta doesn't like it for some reason. Works just fine locally.
@tumido surely, will take a look at this and get back to you on this.
@tumido flake8-nb
author here, the hook supports *.py
AND *.ipynb
since version 0.2.3
, hope like that it works. 😄
Also, you might want to run pre-commit autoupdate
, to get all hooks up to date. 😉
As for the error, the old hook used jupyter
as identifier, which files should be run, which is only supported by identify>=1.4.20
.
To support both *.py
and *.ipynb
files I couldn't use types
in the hook since the logic combines them with an AND, so after you update the revision it should all work fine.
@s-weigand love it! It works flawlessly. :raised_hands: You sir, saved us some time (and electricity) on each CI run now... What a simple change, but what difference it can make.
Thank you for your comment, I wouldn't notice your release for a bit. :smile: And thank you for flake8_nb
. It's really handy I must say. :+1:
@durandom wdyt? merge/nomerge that's the question of the day. :smile:
@tumido You are welcome and I'm glad my tool is used by someone besides me 😋
flake8-nb
: https://github.com/s-weigand/flake8-nbblack-nb
: https://github.com/tomcatling/black-nbThese 2 hooks above should in theory sufficiently replace the original
flake8
andblack
, because they are executing them anyways, but it didn't work for me - it didn't fix the issues in original "just python" files.And as a bonus, reformat and fix found violations in the template, so precommit is passing.