Skip to content

style: normalise indentation in shell scripts - #1193

Merged
steadytao merged 1 commit into
RsyncProject:masterfrom
mdeweerd:qual/beautysh-4space
Nov 22, 2026
Merged

steadytao merged 1 commit into
RsyncProject:masterfrom
mdeweerd:qual/beautysh-4space

Conversation

@mdeweerd

@mdeweerd mdeweerd commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

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):

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.

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.
@steadytao steadytao changed the title qual: Select 4-space indentation for the sh scripts. style: normalise indentation in shell scripts Nov 22, 2026
@steadytao steadytao added the Style Small changes such as typo fixing or readability changes, or non-performance refactoring label Nov 22, 2026
@steadytao steadytao added this to the 4.0.0 milestone Nov 22, 2026
@steadytao
steadytao merged commit 8491f22 into RsyncProject:master Nov 22, 2026
79 of 82 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Style Small changes such as typo fixing or readability changes, or non-performance refactoring

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants