-
Notifications
You must be signed in to change notification settings - Fork 145
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
include style guide for easyconfigs (REVIEW) #311
base: develop
Are you sure you want to change the base?
Conversation
…on --check-style, add (empty) subsection on easyconfig file names
configopts += "--yet-another-option" | ||
|
||
For a parameter value that is a long list, either line wrapping can be used | ||
or each list element can be put on a separate line, see :ref:`code_style_easyconfigs_lists`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/code_style_easyconfigs_lists/code_style_easyconfigs_indentation/
?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
|
||
**Hardcoding of parameter values in multiple places must be avoided if possible**, | ||
the available easyconfig templates ``%(...)s`` must be used instead (see :ref:`avail_easyconfig_templates`). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/avail_easyconfig_templates/easyconfig_param_templates/
?
* :ref:`code_style_easyconfigs_whitespace` | ||
* :ref:`code_style_easyconfigs_indentation` | ||
* :ref:`code_style_easyconfigs_order_grouping` | ||
* :ref:`code_style_easyconfigs_hardcoding` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hardcoding
= templates_constants
?
Even though the order of the parameter definitions in easyconfig files (mostly) doesn't matter, | ||
maintaining a consistent order across easyconfig files helps to make them easier to digest at a glance. | ||
|
||
Related easyconfig parameters must grouped together, with a (single) blank included between groups of parameters. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
must be grouped?
With the above in mind it is difficult to prescribe strict rules for picking a formatting style for lists, | ||
so you will need to pick one yourself (taking into account :ref:`code_style_easyconfigs_max_line_length`). | ||
|
||
For dictionary values, it is custom to put each key-value pair on a separate line, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it is customary?
that are wrapped across multiple lines. | ||
|
||
For a long value of ``configopts``, string concatenation using '``+=```' can be used. | ||
Do make sure to include a space either and the end of all but the last partial |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
either at the end
or simply break the list across multiple lines while aligning the first list element on | ||
each line. | ||
|
||
Which formatting style you should for lists use depends on the length of the individual |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should use for lists
preview at http://boegel-eb.readthedocs.io/en/easyconfigs_style/Code_style.html