New Python style requirements

!3217 has just been merged, which adds a Python code formatting check to the first stage automated testing pipe line.

(Brief notes have been added to Guidelines for code formatting - GROMACS 2023-dev-20221022-fd97a15 documentation and Automatic source code formatting - GROMACS 2023-dev-20221022-fd97a15 documentation)

The enforced style is a somewhat strict interpretation of PEP-8, as applied by the Black tool, which emphasizes readability, reproducibility, and low diff noise. There is a command line tool and integrations for many editors. Please have a look at the docs for details.

I don’t think it would be a big win to add black as a required tool for all developers, and it is trivial enough to set up and use that I hesitate to add it to But I might add some sort of optional snippet to the pre-commit hook if I get annoyed by my own forgetfulness before uploading MRs.

Note that some files are excluded from the automated testing. See .black.toml · main · GROMACS / GROMACS · GitLab, and black --config .black.toml . to replicate what the automated check does.

1 Like