# New Python style requirements

**URL:** <https://gromacs.bioexcel.eu/t/new-python-style-requirements/5091>\
**Category:** Developers discussions\
**Tags:** python\
**Created:** [October 23, 2022, 1:12pm UTC](https://gromacs.bioexcel.eu/t/new-python-style-requirements/5091 "2022-10-23T13:12:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericirrgang](https://dub1.discourse-cdn.com/flex017/user_avatar/gromacs.bioexcel.eu/ericirrgang/32/438_2.png) [@ericirrgang](https://gromacs.bioexcel.eu/u/ericirrgang)\
**Post date:** [October 23, 2022, 1:12pm UTC](https://gromacs.bioexcel.eu/t/new-python-style-requirements/5091/1 "2022-10-23T13:12:44Z")

</div>

!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](https://manual.gromacs.org/nightly/dev-manual/formatting.html) and [Automatic source code formatting - GROMACS 2023-dev-20221022-fd97a15 documentation](https://manual.gromacs.org/nightly/dev-manual/code-formatting.html))

The enforced style is a somewhat strict interpretation of PEP-8, as applied by the [`Black` tool](https://black.readthedocs.io/en/stable/), 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](https://black.readthedocs.io/en/stable/) 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 `reformat_all.sh`. 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](https://gitlab.com/gromacs/gromacs/-/blob/main/.black.toml), and `black --config .black.toml .` to replicate what the automated check does.
