layout | status | adr | title | deciders | date |
---|---|---|---|---|---|
page |
accepted |
0003 |
Black code formatter |
Archivematica code style is inconsistent and controversial. Formatting is a distraction from content and a constant dilemma in our code review process.
The style guide described by PEP 8 is not specific enough and Python is too flexible. Every project ends up with its own style and memorizing the rules is hard.
With the recent rise of auto formatters such gofmt or Prettier, we see the value of ceding control to an opinionated tool.
- yapf - configurable formatter written by Google.
- autopep8 - relies on pycodestyle to determine what parts of the code needs to be formatted.
- black - it focuses on making formatting totally transparent to the developer.
Chosen option: "black", because: