-
Notifications
You must be signed in to change notification settings - Fork 3
Style Guide
If you'd like to contribute to Topside, please take a moment to read through this style guide. Otherwise, happy devving :)
We generally conform to PEP8 guidelines for how we format our Python code. The repository contains a custom formatting script (tools/format.sh
) - you should run this optionally before commits, and definitely before creating pull requests and/or merging to master.
When adding code, make sure to add unit tests to match! It's generally a good idea to run the full suite of unit tests before creating a PR (which can be done with the pytest
command). If you don't, CI will run it for you, but it'll take much longer. This generally shouldn't be an issue, but please don't merge to master until the CI checks complete. We'll get a Slack notification if a failing build makes it to master, though, so don't be too scared of breaking things. They're always fixable :).
Our QML code follows standard guidelines provided here.
Generally, commit messages should follow guidelines laid out by Chris Beams here. Additionally,
-
Pull requests should be squashed and merged to be added as commits to master. If the PR pertains to code inside the
topside/
directory (not the main repo), the commit message should be of the form<subsystem>: <Commit message>
, wheresubsystem
is the folder that the code is relevant to.Commit message
is the commit message as normal, following regular message guidelines (capital first letter, no period, etc).An example commit message could be
plumbing: Add solving algorithm
, for a PR that affects code inside thetopside/plumbing/
directory. Commit messages for code outside thetopside/
directory don't need to follow this format. This is mainly to ensure that changes are immediately recognizable reading commit messages from the top level of the repository. -
Version increments are done as standalone PRs. The commit message takes the form
Designate <version> release
(whereversion
is the version), for exampleDesignate 0.2.0 release
. We add GitHub tags on these commits as well (for example,v0.2.0
); these are visible under thereleases
tab.The workflow for incrementing a version is to upload to TestPyPi, create the PR, merge to master, then upload to actual PyPi. Steps for doing so are located here.