MetOffice / PyPRECIS

PyPRECIS is the python based training environment for Met Office PRECIS training courses.
BSD 3-Clause "New" or "Revised" License
20 stars 2 forks source link

Add linting to ensure worksheets are PEP8 compliant #163

Open JoshuaWiggs opened 1 year ago

JoshuaWiggs commented 1 year ago

Need to add some form of linting to ensure that all the python contained within the jupyter notebooks is PEP8 compliant and hence conforms to best practice. It is thought that this can be accomplished using black, which already has a built in jupyter hook. Ideally these checks would be automatically preformed either using pre-commit or github actions, ensuring that all future development is compliant.

hsteptoe commented 1 year ago

Could also consider adding codespell, flake8 and pycln?

As we're open source, we can also use the pre-commit CI https://github.com/marketplace/pre-commit-ci which is slightly more user friendly in applying the pre-commit checks IMO, but requires setting up actions.

JoshuaWiggs commented 1 year ago

Added basic checking with pre-commit and black-jupyter, but should do something more sophisticated as suggested by @hsteptoe.