Skip to content

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 2 commits into from
Dec 4, 2020

Conversation

lukpueh
Copy link
Member

@lukpueh lukpueh commented Dec 3, 2020

Fixes #1128

Description of the changes being introduced by the pull request:
Document why we chose to henceforth use the Google Python style guide with minimal refinements.

Please verify and check that the pull request fulfills the following
requirements
:

  • The code follows the Code Style Guidelines
  • Tests have been added for the bug fix or new feature
  • Docs have been added for the bug fix or new feature

Copy link
Member

@joshuagl joshuagl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good, thanks @lukpueh. I pointed out a couple of minor nits, but I'm OK with the ADR as is.

(Apologies for being nit-picky about English.)

@trishankatdatadog
Copy link
Member

Good idea. Could we also use pylint, flake8, and black?

@lukpueh
Copy link
Member Author

lukpueh commented Dec 4, 2020

Thanks for the comments, you two! No need to apologize, @joshuagl, I do appreciate language corrections, and our style guide actually encourages them.

lukpueh and others added 2 commits December 4, 2020 10:39
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 <[email protected]>
Co-authored-by: Joshua Lock <[email protected]>
Similar instructions are in the style guide preamble, but we repeat
it here for emphasis.

Signed-off-by: Lukas Puehringer <[email protected]>
@lukpueh
Copy link
Member Author

lukpueh commented Dec 4, 2020

@joshuagl, I squashed your suggestions into my commit. @trishankatdatadog, I added another commit to mention linters and formatters and general style guide usage/transition instructions. Would either of you mind taking another look? Thanks!

Copy link
Member

@trishankatdatadog trishankatdatadog left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

@trishankatdatadog
Copy link
Member

Hmm, I do have some reservations regarding hanging vs aligned indents in function arguments, but whatever, I can live with it.

@lukpueh
Copy link
Member Author

lukpueh commented Dec 4, 2020

Hmm, I do have some reservations regarding hanging vs aligned indents in function arguments, but whatever, I can live with it.

What do you mean? Our new guide specifically favors aligned indent, which is what you seemed very passionate above.

@trishankatdatadog
Copy link
Member

What do you mean? Our new guide specifically favors aligned indent, which is what you seemed very passionate above.

My bad, I missed the tweak to the Google guide. Keep calm and carry on 💯 💯

@lukpueh lukpueh merged commit 771592a into theupdateframework:develop Dec 4, 2020
sechkova added a commit to sechkova/tuf that referenced this pull request Feb 17, 2021
Ensure that the newly added files' docstrings adhere to the
recently adopted code style guideline (theupdateframework#1232).

Small code style improvements in comments and imports.

Signed-off-by: Teodora Sechkova <[email protected]>
sechkova added a commit to sechkova/tuf that referenced this pull request Feb 23, 2021
Ensure that the newly added files' docstrings adhere to the
recently adopted code style guideline (theupdateframework#1232).

Small code style improvements in comments and imports.

Signed-off-by: Teodora Sechkova <[email protected]>
sechkova added a commit to sechkova/tuf that referenced this pull request Feb 24, 2021
Ensure that the newly added files' docstrings adhere to the
recently adopted code style guideline (theupdateframework#1232).

Small code style improvements in comments and imports.

Signed-off-by: Teodora Sechkova <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Decide on style guideline
3 participants