spacetelescope / DRESSCode

DRESSCode (Data Reduction of Extended SWIFT Sources Code)
https://spacetelescope.github.io/DRESSCode/
BSD 3-Clause "New" or "Revised" License
8 stars 0 forks source link

GitHub action to check linting & formatting #1

Closed falkben closed 3 years ago

falkben commented 3 years ago

add a readme section about this, and update dependencies

falkben commented 3 years ago

pre-commit hooks would be helpful, in addition/instead of github action https://ljvmiranda921.github.io/notebook/2018/06/21/precommits-using-black-and-flake8/

mdecleir commented 3 years ago

Do I understand correctly that the idea is to require that every contributed code has been run through flake8 and black before committing? I am familiar with black, not so much with flake8. Could you briefly explain me what the difference is?

falkben commented 3 years ago

yea, black is for formatting

flake8 does linting. it looks for errors in code. for example: undefined variables being used. https://flake8.pycqa.org/en/latest/

another similar tool to flake8 would be pylint, if you are familiar with that

mdecleir commented 3 years ago

Aha, I was not familiar with the term "linting". Thanks!

This would be a great addition to the repo!