Bug#922423: initscripts: formatting of scripts

Mark Hindley mark at hindley.org.uk
Mon Mar 17 11:23:22 GMT 2025


On Fri, Feb 15, 2019 at 05:27:26PM +0000, Dmitry Bogatov wrote:
> Package: initscripts
> Severity: wishlist
> 
> initscripts currently quite inconsistent in programming style and
> formatting, using mix of tabs and spaces, test and [ ] and so on.

I agree we should do this for forky cycle. Can we agree the style we want?

As a starter, I suggest (debian/src/README.style)

Shell script style
==================

Scripts should follow the style produced by shfmt(1) utilising the -ci and -s options. That is

 - tab indented
 
 - case indented
 
 - ';' rather than a newline between conditional test and 'then'

 - no space before redirection operators

In addition:-

 - prefer '[ ]' to test(1) or builtin


Comments? Changes?

Mark



More information about the Debian-init-diversity mailing list