-
Notifications
You must be signed in to change notification settings - Fork 278
ADR0005: Decide on python code style guide #1232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# Use Google Python style guide with minimal refinements | ||
|
||
Technical Story: https://github.com/theupdateframework/tuf/issues/1128 | ||
|
||
## Context and Problem Statement | ||
|
||
The Secure Systems Lab code style guide, which has been used for most of the | ||
code base, has become outdated. Through the upcoming rewrite, we have the | ||
chance to ignore consistency considerations with existing code style and can | ||
choose a more standard and up-to-date style guide. | ||
|
||
## Decision Drivers | ||
|
||
* Flaws in original Secure Systems Lab style guide | ||
* Curating a complete custom style guide is time consuming | ||
* Well-established style rules lower contribution barrier | ||
* Custom style is not supported by default in common tooling (i.e. editors | ||
and linters) | ||
|
||
## Considered Options | ||
|
||
* Use custom style guide | ||
* Use Google style guide with refinements | ||
|
||
## Decision Outcome | ||
|
||
Chosen option: "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 items the we consider | ||
especially important, want to be handled differently, or in one specific way, | ||
where the Google guide would allow multiple. | ||
|
||
**Course of Action:** | ||
* Follow existing style when working on existing code (files) | ||
* Follow new style in any new code (files) | ||
* Consider providing linter and formatter configuration (e.g. pylint, flake8, | ||
black, yapf) to enforce and facilitate new style | ||
|
||
|
||
## Links | ||
* [New Slim Secure Systems Lab style guide](https://github.com/secure-systems-lab/code-style-guidelines/pull/21) | ||
* [Google Python style guide](https://google.github.io/styleguide/pyguide.html) | ||
* [PEP 8](https://www.python.org/dev/peps/pep-0008/) | ||
* [Issues in original Secure Systems Lab style guide](https://github.com/secure-systems-lab/code-style-guidelines/issues/20) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.