Skip to content
Snippets Groups Projects
Verified Commit 5b10db95 authored by Nik | Klampfradler's avatar Nik | Klampfradler
Browse files

Update coding style guidelines

Closes #117.
parent 4d8d36b1
No related branches found
No related tags found
No related merge requests found
...@@ -12,22 +12,30 @@ Coding layout and style ...@@ -12,22 +12,30 @@ Coding layout and style
The coding style is defined in `PEP 8`_, with the following differences and The coding style is defined in `PEP 8`_, with the following differences and
decisions: decisions:
- The defaults of the `black`_ code formatter are used
- This implies all string literals usin double-quotes, if it does not lead
to more escaping. As proposed by `black`: "My recommendation here is to
keep using whatever is faster to type and let Black handle the transformation."
- The maximum line length is 100 characters - The maximum line length is 100 characters
- Imports are structured in five blocks, each of them sorted as defined in - Imports are structured in five blocks, each of them sorted as defined in
PEP 8: PEP 8 and the Django style guide:
1. Standard library imports 1. Standard library imports
2. Django imports 2. Django imports
3. Third-party imports 3. Third-party imports
4. Imports from other BiscuIT apps (absolute imports) 4. Imports from BiscuIT core and other apps (absolute imports)
5. Imports from the same BiscuIT app (realtive imports) 5. Imports from the same BiscuIT app (realtive imports)
- All string literals use single quotes Use `isort` to take care of this
For the layout of source trees and style recommendations specific to Django, For the layout of source trees and style recommendations specific to Django,
the `Django coding style`_ is a good source of information, together with the `Django coding style`_ is a good source of information, together with
the `Django Best Practices`_ collection. the `Django Best Practices`_ collection.
To ensure code is styled correctly, before commiting, run::
tox -e reformat
Working with the Git repository Working with the Git repository
------------------------------- -------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment