diff options
| author | Martin Afanasjew | 2016-04-06 05:08:53 +0200 |
|---|---|---|
| committer | Martin Afanasjew | 2016-04-08 17:57:30 +0200 |
| commit | 1d9977b7c1954ee80407f23e85cb4eafe326fd6d (patch) | |
| tree | c578509d8b1216d5069002e9f43c49e1b10116bc /Library/Formula | |
| parent | 6a82bc49c764a68cf81ef96cae7ba9dbd26a702e (diff) | |
| download | brew-1d9977b7c1954ee80407f23e85cb4eafe326fd6d.tar.bz2 | |
diagnostic: prefer guard clauses for readability
Guard clauses instead of if/unless blocks make the checks easier to
understand and reduce nesting, thus improving overall readability.
This includes the following additional minor changes:
- Make indentation of commands consistent inside diagnostic messages.
- Fix minor typos and inconsistent punctuation in diagnostic messages.
- Fix here documents to always start with `<<-EOS.undent` on a new line,
followed by the message (indented once), followed by `EOS` (at the
same level like `<<-EOS.undent`).
- Always separate the check logic (and guard clauses) from the following
message by a single empty line (for consistency and readability).
- Standardize on `message` as the variable name when diagnostic messages
need to be constructed from multiple parts.
- Where easily possible, adapt check logic to stay within 80-column
limit, use more expressive variable names, and break down long
expressions into multiple statements with intermediate results.
Closes #49.
Signed-off-by: Martin Afanasjew <martin@afanasjew.de>
Diffstat (limited to 'Library/Formula')
0 files changed, 0 insertions, 0 deletions
