From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id B637B13672; Thu, 02 Oct 2025 09:52:12 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 993) id 457581365B; Thu, 02 Oct 2025 09:52:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DMARC_MISSING,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS autolearn=unavailable autolearn_force=no version=4.0.1 Received: from fhigh-a8-smtp.messagingengine.com (fhigh-a8-smtp.messagingengine.com [103.168.172.159]) by atuin.qyliss.net (Postfix) with ESMTPS id 98A7A13659 for ; Thu, 02 Oct 2025 09:52:08 +0000 (UTC) Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id C5B8C1400107; Thu, 2 Oct 2025 05:52:07 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-10.internal (MEProxy); Thu, 02 Oct 2025 05:52:07 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alyssa.is; h=cc :content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm1; t=1759398727; x=1759485127; bh=YfM+Mj66Tc S3aeyLgQtgAgwQPYjfq83c3wJQ90upHVk=; b=I/Xtf5MkJnbZYAHB4xHq1WRQOK PABv3TrTDvPJjIAYNmAuFGbRUouaIaQMSV/rhx+VrF+tUKryIA66DeJIjLF/yoJE DMnREeG4m3hVLC/pO3LEeXivTR8P70fZSNOGnrV9U3DRAmnAQ6EovtujjaYSofK4 uHuosumiVVRT9xbH93eJxwIYvYQy7g3QqwWKF7KQHCwqwwnD04k7mV1ixquBktkN AFr9q4j3nrKTUVtmjkFKz9AGq21FsWToI+sHaXIxTT+A/zvoim9tmK5b8jDUqpEq PKNY4vra1xEeFkfyRklFYyYjhR7Ok0NOG2JkFGhQrzwLAdZ2mYneUUKKmOXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t= 1759398727; x=1759485127; bh=YfM+Mj66TcS3aeyLgQtgAgwQPYjfq83c3wJ Q90upHVk=; b=aFQeRn89pTvh7oKf3jyf0k9enAf1l8lxqgJYI+zuiy+Dcjpv6cN iJb5GFc4N9GHylzE7dZzsaAhbyPh/T7DbyeDMXBUqSB7hu1PDG/P3zw4V8WwM0fk nnnjCplLh660EqQ7pedtafu0yqBrPi0zk0/DAEFbIYzileqPA/DK/N9q487oBzAZ FJSyBQDiyJm/kLjliMSRwRajwKOMbBLe+vMkluXFZ8Q5IEizTRsVTzCwgeJvANvo o/sDY64CPO7uIr+xwXThq7SgX5ITHEITBKjkPiyk1Q1TRxccQDiQ+eHnLCJBh80S OiLX2diw0x4q3ZyrWRiUV44ytfTimAEjbHQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdekheejtdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefhvffujghffffkgggtsehgtderredttddtnecuhfhrohhmpeetlhihshhsrgcutfho shhsuceohhhisegrlhihshhsrgdrihhsqeenucggtffrrghtthgvrhhnpeellefgkefhle ehieeuffejhfffgefhleekhfeileeuteevieekkeevieeguefgjeenucffohhmrghinhep ghhithhhuhgsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhephhhisegrlhihshhsrgdrihhspdhnsggprhgtphhtthhopedvpdhmohgu vgepshhmthhpohhuthdprhgtphhtthhopeguvghmihhosggvnhhouhhrsehgmhgrihhlrd gtohhmpdhrtghpthhtohepuggvvhgvlhesshhpvggtthhruhhmqdhoshdrohhrgh X-ME-Proxy: Feedback-ID: i12284293:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 2 Oct 2025 05:52:07 -0400 (EDT) Received: by mbp.qyliss.net (Postfix, from userid 1000) id 83BB95F7350D; Thu, 02 Oct 2025 11:52:05 +0200 (CEST) From: Alyssa Ross To: Demi Marie Obenour , devel@spectrum-os.org Subject: Re: [PATCH 1/2] scripts: format with shfmt In-Reply-To: <0234f9af-a92b-4a43-ae7e-12c48f3795c4@gmail.com> References: <20251001102838.7086-1-hi@alyssa.is> <20251001102838.7086-2-hi@alyssa.is> <0234f9af-a92b-4a43-ae7e-12c48f3795c4@gmail.com> Date: Thu, 02 Oct 2025 11:52:03 +0200 Message-ID: <87o6qpwrzw.fsf@alyssa.is> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" Message-ID-Hash: SGVREI7AD3UY5TU2KC4OL5YFNSDTOTPV X-Message-ID-Hash: SGVREI7AD3UY5TU2KC4OL5YFNSDTOTPV X-MailFrom: hi@alyssa.is X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-devel.spectrum-os.org-0; header-match-devel.spectrum-os.org-1; header-match-devel.spectrum-os.org-2; header-match-devel.spectrum-os.org-3; header-match-devel.spectrum-os.org-4; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Demi Marie Obenour writes: > On 10/1/25 06:27, Alyssa Ross wrote: >> This is actually a treewide shfmt run, but I guess nothing outside of >> scripts/ has any formatting issues. >>=20 >> Signed-off-by: Alyssa Ross >> --- >> scripts/dist-cloud-hypervisor.sh | 4 +- >> scripts/format-uuid.sh | 2 +- >> scripts/make-erofs.sh | 8 +-- >> scripts/run-qemu.sh | 109 ++++++++++++++++--------------- >> scripts/update-nixpkgs.sh | 4 +- >> 5 files changed, 64 insertions(+), 63 deletions(-) >>=20 >> diff --git a/scripts/dist-cloud-hypervisor.sh b/scripts/dist-cloud-hyper= visor.sh >> index 603c2df..22bcbaa 100755 >> --- a/scripts/dist-cloud-hypervisor.sh >> +++ b/scripts/dist-cloud-hypervisor.sh >> @@ -16,6 +16,6 @@ trap 'rm -rf -- "$dir"' EXIT >> mkdir -p -- "$dir/$name/LICENSES" >> cp -- LICENSES/Apache-2.0.txt LICENSES/LicenseRef-BSD-3-Clause-Google.t= xt \ >> "$dir/$name/LICENSES" >> -cat pkgs/cloud-hypervisor/*.patch > "$dir/$name/cloud-hypervisor.patch" >> -cat pkgs/cloud-hypervisor/vhost/*.patch > "$dir/$name/vhost.patch" >> +cat pkgs/cloud-hypervisor/*.patch >"$dir/$name/cloud-hypervisor.patch" >> +cat pkgs/cloud-hypervisor/vhost/*.patch >"$dir/$name/vhost.patch" >> tar -C "$dir" -czf "$name.tar.gz" -- "$name" >> diff --git a/scripts/format-uuid.sh b/scripts/format-uuid.sh >> index 497a5f2..3b38278 100755 >> --- a/scripts/format-uuid.sh >> +++ b/scripts/format-uuid.sh >> @@ -4,7 +4,7 @@ >> # SPDX-FileCopyrightText: 2022 Unikie >> # SPDX-License-Identifier: EUPL-1.2+ >>=20=20 >> -substr () { >> +substr() { >> str=3D$1 >> beg=3D$2 >> end=3D$3 >> diff --git a/scripts/make-erofs.sh b/scripts/make-erofs.sh >> index ad04844..7e46847 100755 >> --- a/scripts/make-erofs.sh >> +++ b/scripts/make-erofs.sh >> @@ -35,8 +35,8 @@ while read -r arg1; do >> # a subset of all paths, but this subset includes all of >> # the ones passed in practice other than /. >> case $arg2 in >> - (*/*) parent=3D${arg2%/*};; >> - (*) parent=3D.;; >> + */*) parent=3D${arg2%/*} ;; >> + *) parent=3D. ;; >> esac > > I *really* don't like introducing mismatched parentheses, as it > breaks parentheses matching in editors. Editors know about quoting, > but probably not about case statements. Also, at least some shells > misparse the form without the extra parentheses when inside $(...). Emacs seems to, but it's probably an exception. I would like to have soem standard, and I wouldn't mind adopting matched parentheses style, but I didn't see an option for that in shfmt, at least. If there's a way to get formatted shell scripts with matched parantheses case items, then we can both be happy, but otherwise I'm inclined to favour consistent formatting, especially because I don't think we'd be able to standardize on a syntax I suspect most shell scripters don't even know exists (I didn't) without tooling support. >> diff --git a/scripts/update-nixpkgs.sh b/scripts/update-nixpkgs.sh >> index dd1b7de..e481eb0 100755 >> --- a/scripts/update-nixpkgs.sh >> +++ b/scripts/update-nixpkgs.sh >> @@ -12,11 +12,11 @@ set -ueo pipefail >> root=3D"$(dirname "$0")/.." >> out=3D"$(mktemp -p "$root/lib" -t nixpkgs.default.nix.XXXXXXXXXX)" >>=20=20 >> -exec > "$out" >> +exec >"$out" >>=20=20 >> rev=3D"$( >> curl -fsLS "https://api.github.com/repos/NixOS/nixpkgs/branches/${1-ni= xos-unstable}" | >> - jq -r .commit.sha >> + jq -r .commit.sha > > This seems to be pointless extra indentation. I think it's probably a good thing to have a consistent way of showing that something is part of a pipeline, since it's so easy to miss the line-final |. --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEARYKAB0WIQRV/neXydHjZma5XLJbRZGEIw/wogUCaN5LQwAKCRBbRZGEIw/w ov0lAP9JmjmkUrY0ZJy+vprUMsUVxW90+pUmLrKxQzYa7WgEPwEAvMnZzf3A8IAT w4k3c8nsRsGptM0WSVa0B8PkKJId7wM= =ZSHY -----END PGP SIGNATURE----- --=-=-=--