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 4CE1528232; Thu, 10 Nov 2022 11:23:45 +0000 (UTC) Received: by atuin.qyliss.net (Postfix, from userid 496) id 1F4D4281F4; Thu, 10 Nov 2022 11:23:43 +0000 (UTC) Received: from mail-ed1-x531.google.com (mail-ed1-x531.google.com [IPv6:2a00:1450:4864:20::531]) by atuin.qyliss.net (Postfix) with ESMTPS id 62A7E281F2 for ; Thu, 10 Nov 2022 11:23:39 +0000 (UTC) Received: by mail-ed1-x531.google.com with SMTP id s12so2589300edd.5 for ; Thu, 10 Nov 2022 03:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unikie.com; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/8kRBrDiePvLfe+Sugj8DJkDg1Y+eLaXgBxavlbfHhY=; b=mYyLmTzNyBKxUiR0DR0tbCJ+64gLdsPBinS/ykS9QlhXlG2Za9DZRVHL8jMyMnkGhU o2B8XWznnTL0dOmeW+v7dyZncivuaO35kx3r00jrwmEJ2pjGeK0NcaH3cWGiSCDjI1tI qokhHxSlpicK/TgTiihYzAA30AQBxVYWg8FCmeMd6zrx16uxXG+6nJwtmEEnerXfNX4J u0ms+TYKk/NaReNl6xn7qJIz4XVpZZ6aJt1XThWrPKtTwOQkGYNfy6H9HMicH5nsoSrn vSwCBZ2xPwhuK/++oMLAbvXYj3fIs3XHcZvF9vMZBGgrHUHz1hLZUtb9YG54VYc2+QGM 1weA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/8kRBrDiePvLfe+Sugj8DJkDg1Y+eLaXgBxavlbfHhY=; b=Agqvth+orkytRQuI5RqbQ0rk7wELFF4Q692fGo3jMEY6gNqNcQQ6mfsM/kWzrZkQGU 8AiF6H2Dnn5YXd6Bm9ZDh3Nt+ZEZpDbTjexP6cQ5m21kb8iEJyYzzmyC7V8i44DQKyIx t2KnKbVajk654kAta2C4pk/KE7TEu6z4E+dPH1S6rcDmU1RAmIWEVfOVq8CGKhi3zgyE 9OR0DJROFpkqp5+VztAPUyDfkeBQ77wQFW8BI/2Fk+ZlzY7CugRbmmsdquEaokyHQWgZ ixmn0BiBRNoYmXlyfBpR2GNXDT5icrM6AR9CRTu9Oc66muajWl9MH4Qze53a01+oJwVH J0kw== X-Gm-Message-State: ACrzQf3UcynPcU//0gNTGEck6AHUJXEtgXYz0h6QHp0bdUvPuxsRa8fe bmQXY7nBMnczlCUpwetuQaR6eg+WmD3uwNyY X-Google-Smtp-Source: AMsMyM64Z8X2ZSZ5Rhx1ngXSt/XQ9vuDl86+y+feSBm3u5XYGZuddQHsMPgM6Wd1yE9MvRbRW6cSrg== X-Received: by 2002:a05:6402:941:b0:45f:b9d8:9514 with SMTP id h1-20020a056402094100b0045fb9d89514mr2135403edz.204.1668079416268; Thu, 10 Nov 2022 03:23:36 -0800 (PST) Received: from x220.qyliss.net (p4feb7b57.dip0.t-ipconnect.de. [79.235.123.87]) by smtp.gmail.com with ESMTPSA id g11-20020a170906394b00b0074134543f82sm7313023eje.90.2022.11.10.03.23.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Nov 2022 03:23:34 -0800 (PST) Received: by x220.qyliss.net (Postfix, from userid 1000) id 65CFED28; Thu, 10 Nov 2022 11:23:32 +0000 (UTC) From: Alyssa Ross To: devel@spectrum-os.org Subject: [PATCH 2/2] release.nix: run shellcheck on build scripts Date: Thu, 10 Nov 2022 11:22:20 +0000 Message-Id: <20221110112219.459660-2-alyssa.ross@unikie.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221110112219.459660-1-alyssa.ross@unikie.com> References: <20221110112219.459660-1-alyssa.ross@unikie.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Message-ID-Hash: C5SQDOCJBQ4A563M6WBN4RMJBN43K5G4 X-Message-ID-Hash: C5SQDOCJBQ4A563M6WBN4RMJBN43K5G4 X-MailFrom: alyssa.ross@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: Henri Rosten 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: 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 --- 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