Skip to content

Commit 6a02ba8

Browse files
Lukas Puehringerjoshuagl
authored andcommitted
ADR0005: Decide on python code style guide
Use Google style guide with refinements, because the Google style guide is a comprehensive, well-established style guide that is mostly based on PEP-8 and was accepted by everyone on the TUF team. There is no need to replicate these recommendations. However, we do provide a very slim document with additional refinements, in order to emphasize on items the we consider especially important, want to be handled differently, or in one specific way, where the Google guide would allow multiple. Signed-off-by: Lukas Puehringer <lukas.puehringer@nyu.edu> Co-authored-by: Joshua Lock <jlock@vmware.com>
1 parent 41f6822 commit 6a02ba8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Use Google Python style guide with minimal refinements
2+
3+
Technical Story: https://github.com/theupdateframework/tuf/issues/1128
4+
5+
## Context and Problem Statement
6+
7+
The Secure Systems Lab code style guide, which has been used for most of the
8+
code base, has become outdated. Through the upcoming rewrite, we have the
9+
chance to ignore consistency considerations with existing code style and can
10+
choose a more standard and up-to-date style guide.
11+
12+
## Decision Drivers
13+
14+
* Flaws in original Secure Systems Lab style guide
15+
* Curating a complete custom style guide is time consuming
16+
* Well-established style rules lower contribution barrier
17+
* Custom style is not supported by default in common tooling (i.e. editors
18+
and linters)
19+
20+
## Considered Options
21+
22+
* Use custom style guide
23+
* Use Google style guide with refinements
24+
25+
## Decision Outcome
26+
27+
Chosen option: "Use Google style guide with refinements", because the Google
28+
style guide is a comprehensive, well-established style guide that is mostly
29+
based on PEP-8 and was accepted by everyone on the TUF team. There is no need
30+
to replicate these recommendations. However, we do provide a very slim document
31+
with additional refinements, in order to emphasize items the we consider
32+
especially important, want to be handled differently, or in one specific way,
33+
where the Google guide would allow multiple.
34+
35+
36+
## Links
37+
* [New Slim Secure Systems Lab style guide](https://github.com/secure-systems-lab/code-style-guidelines/pull/21)
38+
* [Google Python style guide](https://google.github.io/styleguide/pyguide.html)
39+
* [PEP 8](https://www.python.org/dev/peps/pep-0008/)
40+
* [Issues in original Secure Systems Lab style guide](https://github.com/secure-systems-lab/code-style-guidelines/issues/20)

docs/adr/index.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ This log lists the architectural decisions for tuf.
99
- [ADR-0002](0002-pre-1-0-deprecation-strategy.md) - Deprecation strategy
1010
- [ADR-0003](0003-where-to-develop-TUF-1-0-0.md) - Develop TUF 1.0.0 in a subdirectory of the current TUF implementation
1111
- [ADR-0004](0004-extent-of-OOP-in-metadata-model.md) - Add classes for complex metadata attributes
12+
- [ADR-0005](0005-use-google-python-style-guide.md) - Use Google Python style guide with minimal refinements
1213

1314
<!-- adrlogstop -->
1415

0 commit comments

Comments
 (0)