From owner-svn-src-all@freebsd.org Fri Jan 11 20:12:55 2019 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2FEBE149B9E4; Fri, 11 Jan 2019 20:12:55 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from shxd.cx (mail.shxd.cx [64.201.244.140]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id C72EC84CF7; Fri, 11 Jan 2019 20:12:54 +0000 (UTC) (envelope-from devin@shxd.cx) Received: from [74.217.198.10] (port=60700 helo=[10.1.7.18]) by shxd.cx with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1gi3Aj-000MlQ-0c; Fri, 11 Jan 2019 12:12:53 -0800 Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 11.5 \(3445.9.1\)) Subject: Re: svn commit: r342945 - in head: tools/build/mk usr.sbin/bluetooth usr.sbin/bluetooth/bluetooth-config From: Devin Teske In-Reply-To: <201901111916.x0BJGcLG022599@pdx.rh.CN85.dnsmgr.net> Date: Fri, 11 Jan 2019 12:12:51 -0800 Cc: Devin Teske , Warner Losh , Lars Engels , src-committers , svn-src-all@FreeBSD.org, svn-src-head@FreeBSD.org Content-Transfer-Encoding: quoted-printable Message-Id: <12293ACC-4C9C-4BFB-A04B-85D43AFA0837@FreeBSD.org> References: <201901111916.x0BJGcLG022599@pdx.rh.CN85.dnsmgr.net> To: rgrimes@FreeBSD.org X-Mailer: Apple Mail (2.3445.9.1) Sender: devin@shxd.cx X-Rspamd-Queue-Id: C72EC84CF7 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.99)[-0.988,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 11 Jan 2019 20:12:55 -0000 > On Jan 11, 2019, at 11:16 AM, Rodney W. Grimes = wrote: >=20 >>> On Jan 11, 2019, at 10:36 AM, Rodney W. Grimes = wrote: >>>=20 >>>> On Fri, Jan 11, 2019 at 10:10 AM Rodney W. Grimes < >>>> freebsd@pdx.rh.cn85.dnsmgr.net> wrote: >>>>=20 >>>>>> On Fri, Jan 11, 2019 at 08:04:33AM -0800, Rodney W. Grimes wrote: >>>>>>> The style of this .sh does not match the normal style of >>>>>>> such things in base, especially with respect to long lines >>>>>>> and indentation. >>>>>>=20 >>>>>> Do we have a style guide for shell scripts in base? How should >>>>>> indentation look like? >>>>>=20 >>>>> Not that I can locate, but I can state that almost all >>>>> of the base code uses tab indenting and limited to 80 >>>>> column widths, independent of c, sh, make, etc. >>>>>=20 >>>>=20 >>>> We have a style.Makefile, style, style.mdoc and style.lua man = pages. Maybe >>>> it's time for style.sh, eh? >>>=20 >>> Yes please! >>>=20 >>=20 >> If we can agree to be professional and collegial, ... >>=20 >> I'll start with chapters from the Style section of my book: >> = https://freebsdfrau.gitbooks.io/serious-shell-programming/content/style/aw= k.html >> = >=20 > If you can mdoc that and Surely. > take what applies to /bin/sh. >=20 It *exclusively* applies to /bin/sh (as does my entire book). > Might be easier to start with one of the other style.foo pages though. I already did. Started with style(9), going back to mdoc would be easy. > And we don't want to go to far and put all of our sh code > out of conformance. The Style entry in my book is based on my FreeBSD sh code. > For one variable being $foo or ${foo} > is varied greatly, IMHO the rule should be that the file just > be consistent through out, and that one or the other is the > prefered style, but either is acceptable. >=20 I talked about this at BSDCan in June. $foo is preferred (there *is* a difference) and, as you say, if a file is consistently ${foo} then it is fine. --=20 Devin=