Skip to content

Commit ad9da4b

Browse files
Natasha ChetwyndNatasha Chetwynd
authored andcommitted
Added to styling guide
1 parent 835d594 commit ad9da4b

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

CONTRIBUTING.md

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,22 @@ We suggest you make sure all of your commits are atomic (one feature per commit)
1515

1616
## Coding conventions
1717

18-
Start reading our code to get a feel for it:
1918

20-
* We use [PEP8](https://www.python.org/dev/peps/pep-0008/). Autoformatters for PEP8, for instance [autopep8](https://pypi.org/project/autopep8/), can easily ensure compliance.
21-
* We use docstrings and we try to (loosely) follow [`numpy`'s docstring standards](https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard).
22-
* This is open source software. Consider the people who will read your code, and make it look nice for them.
23-
19+
We use the industry standard [PEP 8](https://www.python.org/dev/peps/pep-0008/) styling guide within the `codonPython` package. **Therefore, it’s imperative that you use the coding standards found within PEP 8 when creating or modifying any code within the `codonPython` package**. Autoformatters for PEP8, for instance [autopep8](https://pypi.org/project/autopep8/), can easily ensure compliance. The reason we use PEP 8 coding standards is to make sure there is a layer of consistency across our codebase. This reduces the number of decisions that you need to make when styling your code, and also makes code easier to read when switching between functions etc.
20+
21+
While you are creating code, we recommend that you understand the style guide standards for the following topics:
22+
23+
* [Code layout](https://www.python.org/dev/peps/pep-0008/#code-lay-out) – Indentation, tabs or spaces, maximum line length, blank lines, source file encoding, imports & module level Dunder name
24+
* [String quotes](https://www.python.org/dev/peps/pep-0008/#string-quotes)
25+
* [Whitespace in expressions and statements](https://www.python.org/dev/peps/pep-0008/#whitespace-in-expressions-and-statements) – Pet Peeves, alternative recommendations
26+
* [When to use trailing commas](https://www.python.org/dev/peps/pep-0008/#when-to-use-trailing-commas)
27+
* [Comments](https://www.python.org/dev/peps/pep-0008/#comments) – Block comments, inline comments & documentation strings (docstrings)
28+
* [Naming conventions](https://www.python.org/dev/peps/pep-0008/#naming-conventions) – Naming styles, naming conventions, names to avoid, ASCII compatibility, package and module names, class names, type variable names, exception names, global variable names, function and variable names, function and method arguments, method names and instance variables, constants & designing for inheritance
29+
* [Programming recommendations](https://www.python.org/dev/peps/pep-0008/#programming-recommendations) – Function annotations & variable annotations
30+
31+
We also use docstrings and we try to (loosely) follow [`numpy`'s docstring standards](https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard).
32+
33+
Start reading our code to get a feel for it but most importantly, remember that this is open source software - consider the people who will read your code, and make it look nice for them.
34+
2435
:clinking_glasses: Thank you!
2536
Team codon

0 commit comments

Comments
 (0)