Repository navigation
style: normalise indentation in shell scripts - #1193
Merged
Merged
Conversation
Configure beautysh with the style that is already predominant in the
tree: 4 spaces per nesting level, hard tabs turned off (tool.beautysh:
indent_size = 4, tab = false). Given a 4-column tab width, the mixed
"\t + 4 spaces" lines align exactly with the 2-level space indent,
which corroborates a 4-column indent unit. By leading-whitespace line
counts across the scripts touched here, spaces dominate (237 lines)
over tabs (198) and tab/space mixes (50).
Status of each script before the reformat, counting non-blank lines
that carry leading whitespace (sp = space-indented, tab = tab-indented,
mix = tab + spaces on the same line):
| File | sp | tab | mix | Remark |
|------------------------------------|------|------|-----|---------------------------------------------|
| cmd-or-msg | 2 | 0 | 0 | uniform spaces |
| maybe-make-man | 8 | 8 | 8 | 4sp blocks + tab case-arms |
| mkgitver | 15 | 5 | 3 | 4sp blocks + tab arms |
| old_versions/build_static.sh | 39 | 0 | 0 | uniform spaces |
| packaging/prep-auto-dir | 12 | 12 | 2 | 4sp blocks + tab case-arms |
| packaging/smart-make | 14 | 2 | 0 | 4sp blocks + tab arms |
| packaging/solaris/build_pkg.sh | 0 | 0 | 0 | flat |
| prepare-source | 17 | 21 | 4 | 4sp blocks + tab case-arms |
| rsync-ssl | 98 | 98 | 31 | 4sp blocks + tab case-arms |
| rsync-web/backup.txt | 1 | 0 | 0 | flat, 1 six-space continuation line |
| rsync-web/bin/badge-update | 0 | 0 | 0 | flat |
| rsync-web/bin/upload | 3 | 0 | 0 | uniform spaces |
| rsync-web/rsync-debug | 0 | 0 | 0 | flat |
| support/deny-rsync | 3 | 0 | 0 | uniform spaces |
| support/install_deps_ubuntu.sh | 0 | 0 | 0 | flat |
| support/instant-rsyncd | 2 | 43 | 2 | uniform tabs, counted lines are heredoc content |
| support/lsh.sh | 17 | 3 | 0 | 4sp blocks with tab shorthand |
| support/rsync-no-vanished | 3 | 2 | 0 | 4sp blocks with tab shorthand |
| support/rsync-slash-strip | 5 | 4 | 0 | 4sp blocks with tab shorthand |
The tab-indented lines are mostly case-arm bodies (one tab per arm
level, the old shorthand for a nesting step) and their nested
continuation lines ("\t + 4 spaces"); the remaining tabs are single
second-level bodies in lsh.sh, rsync-no-vanished, rsync-slash-strip
and mkgitver. instant-rsyncd is the only script written fully in
tabs; its leading whitespace is kept intact since it is internally
consistent.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
qual: Select 4-space indentation for the sh scripts.
Configure beautysh with the style that is already predominant in the
tree: 4 spaces per nesting level, hard tabs turned off (tool.beautysh:
indent_size = 4, tab = false). Given a 4-column tab width, the mixed
"\t + 4 spaces" lines align exactly with the 2-level space indent,
which corroborates a 4-column indent unit. By leading-whitespace line
counts across the scripts touched here, spaces dominate (237 lines)
over tabs (198) and tab/space mixes (50).
Status of each script before the reformat, counting non-blank lines
that carry leading whitespace (sp = space-indented, tab = tab-indented,
mix = tab + spaces on the same line):
The tab-indented lines are mostly case-arm bodies (one tab per arm
level, the old shorthand for a nesting step) and their nested
continuation lines ("\t + 4 spaces"); the remaining tabs are single
second-level bodies in lsh.sh, rsync-no-vanished, rsync-slash-strip
and mkgitver. instant-rsyncd is the only script written fully in
tabs; its leading whitespace is kept intact since it is internally
consistent.