Last active
September 11, 2024 06:47
-
-
Save habi/27db69df1b79b7563b53e06f12018573 to your computer and use it in GitHub Desktop.
`pycodestyle` all Jupyter notebooks in a folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for i in *.ipynb | |
# Tell us what we are doing | |
do echo Checking $i | |
# Convert the Jupyter notebook to .py and run through pycodestyle | |
jupyter nbconvert $i --to script && pycodestyle *.py --ignore=E501,E402,W391,W503 --show-source; | |
# Remove the converted file, thanks to https://stackoverflow.com/a/12152997 | |
echo Removing "${i%.*}.py" | |
rm "${i%.*}.py" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment