Skip to content
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

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

boegel
Copy link
Member

@boegel boegel commented Feb 24, 2017

@boegel boegel changed the title skeleton for section of 'code' style for easyconfigs (WIP) include style guide for easyconfigs (WIP) Feb 27, 2017
@boegel boegel changed the title include style guide for easyconfigs (WIP) include style guide for easyconfigs (REVIEW) Mar 20, 2017
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`.
Copy link
Member

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`).
Copy link
Member

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`
Copy link
Member

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.
Copy link
Member

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,
Copy link
Member

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
Copy link
Member

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
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants