From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on atuin.qyliss.net X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 Received: from atuin.qyliss.net (localhost [IPv6:::1]) by atuin.qyliss.net (Postfix) with ESMTP id 82D1428E80; Thu, 10 Nov 2022 13:40:28 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id E735928E7D; Thu, 10 Nov 2022 13:40:26 +0000 (UTC) Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by atuin.qyliss.net (Postfix) with ESMTPS id 1CC2128DF5 for ; Thu, 10 Nov 2022 13:40:23 +0000 (UTC) Received: by mail-lj1-x235.google.com with SMTP id u11so1180462ljk.6 for ; Thu, 10 Nov 2022 05:40:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=h9A4rkQixUdZe6hkMdQeVyiUt+4Hsicb86a9lh3c1jg=; b=aTNRVOsgkQxdv/KWfjHKUP/PnvmOhLtm+AMv+CwyZccfHVxpTf23FpFKr7W4ozkT+V ZBgKk3HbCNks60L1kQRosV8Havlavk2/dSiTmAolstd0KTLvcK8nix1n0KrxzyQut2r7 GMkj7qhx993t59xOGfHv6aJw/mHu0QMkK0k1Uh+1P3DZZAL5Xo7phZkZ+N0DX4VcG9QG EPU2V2iE/m8hWojf87x1+hgzLdTyde7FCooDZs2/uhyYerLVZkzwQiznapiyPSUtheh6 Cg/EeAggk7WmGZFIZ4fZrNs7IGNbv1vybSHFIEMj7cCqjXiKCKhO/fvMKhRtECcV/JDz XloQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h9A4rkQixUdZe6hkMdQeVyiUt+4Hsicb86a9lh3c1jg=; b=nTVK7GA38qgwX5LNLlFWaEVYcVTrDF0JY9I9TRkg+MiYTRtDDfoK3yyrK5JNYXo7mQ pxEFK3E5RE9P2FvTpwlF6qsER5CXjmbTDjbXp8HXI+pYtC/vGwXWSIHh3InVlhUuXnud tr1D4u+PAXY74WLmgWnU6SwMywwyxmm+v2sb4hEBLZ3Zv9u6joigDreYivL+Ox65C9CN kOQs9Y8XuoMr6MTkJ/39W5WH3kP0Ni/98vcjhXFTsAl4IzCrGOyHeb4x4Fr9fXdCKasE zVwTJ0w1/VsO/A3Rrvhd26KU+D7/T1mszBFBQ8vw+VSiWuPnChZW27ZZBnAqmmCv6cZp aghg== X-Gm-Message-State: ACrzQf08dH0iligdSPIaoDyTZtLTY1onomBp/i0V5IB+b92fIF7QreQA TIyTfjPn3bzFlmjaDECJiWCKgLCQV+gp1A== X-Google-Smtp-Source: AMsMyM4ztkHjFkbtD6pXs3kbU7GB1OCSFHAPpvSWcU5fbUq0HhSdz9cnFn9W5hud4714zvmX4X0EzQ== X-Received: by 2002:a2e:a162:0:b0:277:1caf:679e with SMTP id u2-20020a2ea162000000b002771caf679emr9245441ljl.115.1668087622340; Thu, 10 Nov 2022 05:40:22 -0800 (PST) Received: from buamix (86-60-162-79.dynamic.lounea.fi. [86.60.162.79]) by smtp.gmail.com with ESMTPSA id a5-20020a19ca05000000b004a62ff61b3dsm2749254lfg.252.2022.11.10.05.40.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 05:40:21 -0800 (PST) Date: Thu, 10 Nov 2022 15:40:20 +0200 From: Henri Rosten To: Alyssa Ross Subject: Re: [PATCH 2/2] release.nix: run shellcheck on build scripts Message-ID: <20221110134020.GB1064381@buamix> References: <20221110112219.459660-1-alyssa.ross@unikie.com> <20221110112219.459660-2-alyssa.ross@unikie.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221110112219.459660-2-alyssa.ross@unikie.com> Message-ID-Hash: VTBXHXBJGSPLGLFQP3OZCT75HZZO2EWI X-Message-ID-Hash: VTBXHXBJGSPLGLFQP3OZCT75HZZO2EWI X-MailFrom: henri.rosten@unikie.com X-Mailman-Rule-Hits: header-match-devel.spectrum-os.org-0 X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-config-1 CC: devel@spectrum-os.org X-Mailman-Version: 3.3.5 Precedence: list List-Id: Patches and low-level development discussion Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Thu, Nov 10, 2022 at 11:22:20AM +0000, Alyssa Ross wrote: > This will make the binary cache build (which I expect to become more > CI-like over time) fail if shellcheck doesn't pass on any shell > scripts found in the tree. This will help ensure we are sticking to > POSIX shell features and following shell scripting best practices. > > At present, only scripts with names ending in ".sh" are processed, as > we don't have any others, and discovering extensionless scripts would > be quite a bit more complex. We can worry about that when the time > comes. > > Signed-off-by: Alyssa Ross Reviewed-by: Henri Rosten > --- > nix/checks.nix | 24 ++++++++++++++++++++++++ > release.nix | 2 ++ > 2 files changed, 26 insertions(+) > create mode 100644 nix/checks.nix > > diff --git a/nix/checks.nix b/nix/checks.nix > new file mode 100644 > index 0000000..9eb261f > --- /dev/null > +++ b/nix/checks.nix > @@ -0,0 +1,24 @@ > +# SPDX-License-Identifier: MIT > +# SPDX-FileCopyrightText: 2022 Unikie > + > +{ config ? import ../nix/eval-config.nix {} }: > + > +{ > + recurseForDerivations = true; > + > + shellcheck = config.pkgs.callPackage ( > + { lib, runCommand, shellcheck }: > + runCommand "spectrum-shellcheck" { > + src = lib.cleanSourceWith { > + filter = path: type: > + type == "directory" || builtins.match ''.*[^/]\.sh'' path != null; > + src = lib.cleanSource ../.; > + }; > + > + nativeBuildInputs = [ shellcheck ]; > + } '' > + shellcheck $src/**/*.sh > + touch $out > + '' > + ) {}; > +} > diff --git a/release.nix b/release.nix > index 91a843b..3ecf8a7 100644 > --- a/release.nix > +++ b/release.nix > @@ -12,5 +12,7 @@ > { > doc = import ./Documentation { inherit config; }; > > + checks = import nix/checks.nix { inherit config; }; > + > combined = import img/combined/run-vm.nix { inherit config; }; > } > -- > 2.35.1 >