mirror of
https://github.com/Cantera/cantera.git
synced 2025-02-25 18:55:29 -06:00
Adopt PEP-8 for whitespace recommendations
This commit is contained in:
parent
7df2adbab9
commit
8c23917b79
@ -55,10 +55,14 @@
|
|||||||
* Avoid introducing trailing whitespace
|
* Avoid introducing trailing whitespace
|
||||||
* Limit line lengths to 88 characters when possible
|
* Limit line lengths to 88 characters when possible
|
||||||
* Write comments to explain non-obvious operations
|
* Write comments to explain non-obvious operations
|
||||||
* Use whitespaces to improve code readability (examples: after commas; before and
|
* Use whitespaces to improve code readability. Examples: after commas; before and
|
||||||
after mathematical operators (`+`/`-`/`*`/`/` except `^`), binary operators
|
after binary operators (`&&`/`||`/...), and comparisons (`<`/`>`/`==`/...); before and
|
||||||
(`&&`/`||`/...), and comparisons (`<`/`>`/`==`/...); before and after equality
|
after equality signs `=` unless used for the assignment of a default parameter. For
|
||||||
signs `=` unless used for the assignment of a default parameter)
|
mathematical operators (`+`/`-`/`*`/`/` except `^`), whitespace should be added around
|
||||||
|
the operators with the lowest priority (examples: `x + y + z`, `x*2 - 1`, or
|
||||||
|
`(a+b) * (a-b)`). For additional guidance, refer to
|
||||||
|
[Python PEP-8](https://peps.python.org/pep-0008/#whitespace-in-expressions-and-statements),
|
||||||
|
where recommendations can be extrapolated to other programming languages
|
||||||
* Do not go out of your way to change formatting in otherwise unmodified code
|
* Do not go out of your way to change formatting in otherwise unmodified code
|
||||||
* Write 'for example', 'such as', or 'that is' instead of using the Latin
|
* Write 'for example', 'such as', or 'that is' instead of using the Latin
|
||||||
abbreviations 'i.e.' and 'e.g.'.
|
abbreviations 'i.e.' and 'e.g.'.
|
||||||
|
Loading…
Reference in New Issue
Block a user