desy-ml / cheetah

Fast and differentiable particle accelerator optics simulation for reinforcement learning and optimisation applications.
https://cheetah-accelerator.readthedocs.io
GNU General Public License v3.0
25 stars 12 forks source link

Automatic `black` #183

Open jank324 opened 2 weeks ago

jank324 commented 2 weeks ago

Should we set up black to automatically format the code on commits or pushes? Right now it only checks and complains when the code is not formatted correctly.

jank324 commented 2 weeks ago

@cr-xu didn't you look into this before?

cr-xu commented 1 week ago

On a second thought, maybe requiring the contributors to install pre-commit is a better solution So... pros and cons of using GH Actions to reformat and commit: Pro:

Con:

jank324 commented 1 week ago

The cons seem to clearly outweigh the pros here. I think we should leave it as is, and maybe (a) make the contribution guidelines more comprehensive and (b) add a checkmark to PRs "I have read the contribution guidelines".