From patchwork Thu May 2 19:38:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13652021 Received: from mail-oa1-f46.google.com (mail-oa1-f46.google.com [209.85.160.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6AC5217BA0 for ; Thu, 2 May 2024 19:41:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.46 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678880; cv=none; b=RGCmeI9W25UVvoSmgQE9Jc27bbOyPmsrxPHLIZ/VOe3UwnHgS6OHiYfO0jEhrfznv3/3UQK8fYA39BzoXxguwtGC3PkJrEDnViwL5HNWqE8hB4Z02OUcld0p5ZQWArtAzDxXma+zMiQCFzYGZpEOuFzq3dwAAaiA1tgIFloVIiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678880; c=relaxed/simple; bh=kPWZWHrWJeIfy/w4RFmod9jplc/tZ+Emui/avpXenSo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=F40HNfdB+ttrCidUN1iM0ZoMjHmLLb9aJUlp0p38ZTcOanZyS6VrfwXriyuSTC5nu3olOy4i713Yv6LVRdvDjeii+oM1ISGktjlevfTQgnQuJubTihkNAAtMaI5ieNR86qv76Iknz5ussMv7FC4BbUgvd9xViuuouLSGVG5tVCU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=iBEScHGr; arc=none smtp.client-ip=209.85.160.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="iBEScHGr" Received: by mail-oa1-f46.google.com with SMTP id 586e51a60fabf-22fa7e4b0beso3491959fac.1 for ; Thu, 02 May 2024 12:41:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714678878; x=1715283678; darn=vger.kernel.org; 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=gDQ9+UkM02IRkgzYyXz6zpT1AsYfEg3PAFp5x/fCFqQ=; b=iBEScHGrPj5lYwoKnqKvzIL799iOYCvuXmuS+Gdlwpwaf5Kt8PqDlOyI2WyFApIBYr xh36I8COyd32/uZ1f0yq7VKsSj97Mh+wB1pqrFomKwUFooMQsnav8t+SVXJz0HQ6VP5d +BXUOkFZr20lTiGP2OWj61HvOXTvD1vFBrYojG5Puh91AZQi0F09mhJRKsJ/sk4sVPGs EyEGrhDryZyxS8vqmYivw7L7NyTClGpSP8EF8rTOUvJ1fr+rwMsbRBw2knPu3GvQYnze WWn5VAGNkgja54+1z/qCs23rpPWoGfTA+Zbo5Wy4foC1free0VRkcwDb3KXke77UuJTw ffVg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714678878; x=1715283678; 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=gDQ9+UkM02IRkgzYyXz6zpT1AsYfEg3PAFp5x/fCFqQ=; b=SzJBft5kOsZVvHVUkls86OoU+BpvTmJwX6pkPugpKznUCrxUf5bwg5NciBddWzGR0e ENj/c7q5pZbHKBnH48SU8S1EaWTWtx8y1DHSv9LhHxkYgTR+B84o1VbySRzHQTbPMRv2 mRDVSgwpnPkUTBqWqUoZ8tbyibYXyAqeQi4sc3WRUp2DnbWJ2k+ZLBzKPtFXY1NWJ/5l ukqMNJYwJXWYDMYdFhXaf6CmfLGDUT9nJo/8neqCNZopynyttmKOa/anWPQxeUODtllq WmmfjQeFFHXoe0/76kFbLRCXBHfqkz0tPfnEJntn7Kijg3IOn5b7IY6/DphgjxK+/m4U 12pA== X-Gm-Message-State: AOJu0YxOVbIQvqw3lFcdUBcAVIVLt6NOB7mWwBoCEatwsFiCQiIJ1tCh bAMqL5wWSYZbiwUtTTGKl/u4H39+SFb84LE3bSnK6swaCdrjLvsCmG9O7w== X-Google-Smtp-Source: AGHT+IFK3cEMgk0+WbkEBiddGVLUr6/6sJRTwjRsdkCGquD8xdkWFJcCi7atslDFf5V93+HeQcByww== X-Received: by 2002:a05:6870:d60a:b0:22e:7b1b:32a3 with SMTP id a10-20020a056870d60a00b0022e7b1b32a3mr976119oaq.52.1714678878090; Thu, 02 May 2024 12:41:18 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id uj12-20020a0568714e4c00b002390714e903sm297443oab.3.2024.05.02.12.41.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 12:41:17 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v2 1/5] ci: pre-collapse GitLab CI sections Date: Thu, 2 May 2024 14:38:35 -0500 Message-ID: <20240502193840.105355-2-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240502193840.105355-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> <20240502193840.105355-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Sections of CI output defined by `begin_group()` and `end_group()` are expanded in GitLab pipelines by default. This can make CI job output rather noisy and harder to navigate. Update the behavior for GitLab pipelines to now collapse sections by default. Signed-off-by: Justin Tobler --- ci/lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/lib.sh b/ci/lib.sh index 0a73fc7bd1..02e5e058dd 100755 --- a/ci/lib.sh +++ b/ci/lib.sh @@ -18,7 +18,7 @@ elif test true = "$GITLAB_CI" then begin_group () { need_to_end_group=t - printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)\r\e[0K$1\n" + printf "\e[0Ksection_start:$(date +%s):$(echo "$1" | tr ' ' _)[collapsed=true]\r\e[0K$1\n" trap "end_group '$1'" EXIT set -x } From patchwork Thu May 2 19:38:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13652022 Received: from mail-ot1-f42.google.com (mail-ot1-f42.google.com [209.85.210.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD7CB17F37D for ; Thu, 2 May 2024 19:41:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678882; cv=none; b=buyO3yf5hyD0G/e5gVrOG9WDqW4Vjj2jGDXjBQeXzmWYy61DJVRgZMQ15k1AxMyJ8mhgthtj+SEYw1QWjooZuzA98JWTDD0gABgT3E0qinRZ6nnzmN2StMO+GChq+8uzcIgieYuN7H9IEqJTReFlHE6oYFQrCjgFTGtLz0OPwwI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678882; c=relaxed/simple; bh=UahwUq9KQ+L25qWoYlDOZhfHrQ02v1DAE6Qi/vaHVgE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=MX9dC1AfB4sN1Dzskw8ACCIkCZy5e4XxsI8nAOilAXfkzA48m2PcznM5jG3TQPhaWK3FcBgVeOhV6w+0xe4rkT1jt15iD2syO73arqWv9lKyqKiOoyxiVzX2hJWAp66nf23x4Ttc8GZdZzfvryXV5uK8iJZ71Rt3ODWOesz7orM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=K2e877HD; arc=none smtp.client-ip=209.85.210.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="K2e877HD" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6ef9e381989so699398a34.0 for ; Thu, 02 May 2024 12:41:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714678879; x=1715283679; darn=vger.kernel.org; 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=7oeVL87ubFP4WWknZ8iX/rlxxUxGiJ6CGRc32QJEWXs=; b=K2e877HDw+s2JBCRc9Pn2s4JL5K9DijwhosKggJvgT4+m0FgTurJtFO9HOsaVsSxgU R2a+hyHTeLcw8E7WZXwsCIf5A7/RBh5agefK9r18eA5DUppJ0bcqv8stUnuLOOKLunpL IY5KeG8JPGcM1LVMzU1d8bFb3jg71hnGSFp0m9NOOc2pOoSMyTNPLvCl4BFQa+8H5ryz sT100V7LigQdtri+WLz74A5yRUIgvTt1E+fqRgaFS9d8wWKcpUruI/sLehED3qx5JmVn HKPGLAzlSjdDcm2Xn+O7tyNMy5iu0vhr3LxYlQcl9BXSVnb48f73CWpwuRQd7x6nh9PV +hBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714678879; x=1715283679; 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=7oeVL87ubFP4WWknZ8iX/rlxxUxGiJ6CGRc32QJEWXs=; b=mFDke0NZhIc1U1WpJL+mnP5qq7PQQK8m7RWnAPtawBuhP8K7qH7MoQG8Zkz/9gsVGm XiBNw/aRArvf567t/74WSJZ/HHWPMDQgowos8N3yHfrMz4GTtbeYlgfM8iylxudBHZy5 jJ8aEQJE9OIZNQja5Y6xrhgYH9Idj0wQ2/sYzbcqtj1NWMywS3VOF6ex+NBsmXm0Dclx Z/nizBmlDTDlGIAblVi1sU7zrKF5T3lrv9t5lBBB73UN+Os8V4K8zcmsrY5bFsCVdBbI GYQvkFl4Bhbe2kvCVGNxEPjgSKx0ZquhNszaszGhtHyiDtfCzQ38TEV5gpDSE7c8+k1G hiJA== X-Gm-Message-State: AOJu0YxVCbpeToZNG90gffLZ5009wgg0U7F6Pc0dnkfvaHy5LzGJJfoo eW5M/tU8y3iPmS2qug2PEA6soGe0ix3HwqMkLAyEkEzl8vJ6qqVed3Ldmw== X-Google-Smtp-Source: AGHT+IGonf8yMqLbHShNivqoKnFrm+dvquwsWNAP4zYrxbnIDwylpKxiqFpTfIZM/zG8jmYxBLCPjA== X-Received: by 2002:a05:6871:58b:b0:22e:c6da:6196 with SMTP id u11-20020a056871058b00b0022ec6da6196mr1023692oan.27.1714678879378; Thu, 02 May 2024 12:41:19 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id uj12-20020a0568714e4c00b002390714e903sm297443oab.3.2024.05.02.12.41.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 12:41:19 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v2 2/5] github-ci: fix link to whitespace error Date: Thu, 2 May 2024 14:38:36 -0500 Message-ID: <20240502193840.105355-3-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240502193840.105355-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> <20240502193840.105355-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the `check-whitespace` CI job detects whitespace errors, a formatted summary of the issue is generated. This summary contains links to the commits and blobs responsible for the whitespace errors. The generated links for blobs do not work and result in a 404. Instead of using the reference name in the link, use the commit ID directly. This fixes the broken link and also helps enable future generalization of the script for other CI providers by removing one of the GitHub specific CI variables used. Signed-off-by: Justin Tobler --- .github/workflows/check-whitespace.yml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index a241a63428..a3a6913ecc 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -31,14 +31,15 @@ jobs: commit= commitText= commitTextmd= - goodparent= + goodParent= while read dash sha etc do case "${dash}" in - "---") - if test -z "${commit}" + "---") # Line contains commit information. + if test -z "${goodParent}" then - goodparent=${sha} + # Assume the commit has no whitespace errors until detected otherwise. + goodParent=${sha} fi commit="${sha}" commitText="${sha} ${etc}" @@ -46,18 +47,18 @@ jobs: ;; "") ;; - *) - if test -n "${commit}" + *) # Line contains whitespace error information for current commit. + if test -n "${goodParent}" then problems+=("1) --- ${commitTextmd}") echo "" echo "--- ${commitText}" - commit= + goodParent= fi case "${dash}" in *:[1-9]*:) # contains file and line number information dashend=${dash#*:} - problems+=("[${dash}](https://github.com/${{ github.repository }}/blob/${{github.event.pull_request.head.ref}}/${dash%%:*}#L${dashend%:}) ${sha} ${etc}") + problems+=("[${dash}](https://github.com/${{ github.repository }}/blob/${commit}/${dash%%:*}#L${dashend%:}) ${sha} ${etc}") ;; *) problems+=("\`${dash} ${sha} ${etc}\`") @@ -70,15 +71,15 @@ jobs: if test ${#problems[*]} -gt 0 then - if test -z "${commit}" + if test -z "${goodParent}" then - goodparent=${baseSha: 0:7} + goodParent=${baseSha: 0:7} fi echo " From patchwork Thu May 2 19:38:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13652023 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1EF121802D7 for ; Thu, 2 May 2024 19:41:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678883; cv=none; b=nJb7NMuK1AlkUIYglgJb/z5x7sK+1JTaqrj06WtMChEGhusBdgil5gn7xFoyx3qb4AQucwIKAb7JbUZg0j+cXeLAbJagw7TdL4wTlR1MKClTvsqU0bIbzi3slNkj9GUdhI5BXgwvJwC69Pt/69PPvm/No5CbNaJOG2xW/5FNQbQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678883; c=relaxed/simple; bh=u/ob5vAmGBDDAIau2u+gbxsA79iK8gerioBTjSPyivM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=J9mR9FCUZNLb84ceKlFrXb18lhYNUevmA1/vxWgV9vJaYcFSNvM/hXjMD5Fra0lmhj6qAoR0DlCCYbhF05hMgKmxxbxNHWBY9F0/XHoD/70eVrR0t2OFkBG89wTPN4J9E7+85ShMbRqTp2Cl53RbnHgUNk29WfEAPRZmhomSjcw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Aj5/CHOg; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Aj5/CHOg" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-23d38cd0df6so1645390fac.2 for ; Thu, 02 May 2024 12:41:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714678881; x=1715283681; darn=vger.kernel.org; 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=kKYoPQITMQuAedN0mdur/i0P7Uf2CERjQNG1Fx0WYJg=; b=Aj5/CHOgpA5LqO03kTLZIbnAi6Lhi+xHyGauonNoNG7gxIvR/mD5A9/SG1dgv91uLC 6ker67296J+DB1+vWPQBuE/25+BtXvbwocLmR90jmUK47g3pCnzKdh7LSaXKdr/0eFyN ShqxlTBIXkWTCMYDd6TFIi5C/x+sEzWgiBKrfvYljmSnCn2M48AqFi3txVtXp+EtRPoj 6ZNCLOeSR/n6oklNFf6T2z/S5UZCkwCSWv8UBdojHcl5zJU1/yc1xbr+uC7oEmyMk8S5 2CZYm1B7b2l0fY1Zom+tj2pmo/RIO0cHHW48SWDgDtkCZ4kXWqcLEoq6Fwfj6qanizCM 1WwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714678881; x=1715283681; 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=kKYoPQITMQuAedN0mdur/i0P7Uf2CERjQNG1Fx0WYJg=; b=aJXYVBE1Gh5EiRTqed/4HmNqMmVlzcbT20LoPpCLqosS1DZ3ixRx1pZJl9q5xMRjGV 454gOTbJDRyzH/iz582+pYFEz8m/eH3PZSbTFrMYcbig+t2WVtbHG8O/RWk5NV5KDv5W 5r/guBbiuLhJh/XY+kXHaw0ZRHczb8d2KLBPKYHTLkoqD/fggHne+o0gAEYnpRkDYzZd bZJPOL7wlbtE54fqBHyS1aZnmDLAWo8F/CmhqLgXQjD8c8vN7GFLRA6bABt+81W1BDpe DL6paQMiDkrrTpXYkF471P3POKiM8Wl/jVgMARonQeFlnRpvUHUJkHhAAE2UFMztQmwf k4EA== X-Gm-Message-State: AOJu0YyW/8vQYYvw2aRtJfS3T6stQ7Nq4fEMyblSq7XUsPcJS1Z3T5PS 848enEQWDb3vUq9W4up1e7tORO02qZfVcl1g4xtrjnnbWP/KbMmFjJgY7w== X-Google-Smtp-Source: AGHT+IHW7PGtEewr4GOhuxeeHRMlGQIEE/ccsN5j+UqcMUgoMQu1X1ocY+QWbNrhymmj+I+hF5gZsw== X-Received: by 2002:a05:6871:b1a1:b0:22e:bc50:3492 with SMTP id an33-20020a056871b1a100b0022ebc503492mr760771oac.47.1714678880899; Thu, 02 May 2024 12:41:20 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id uj12-20020a0568714e4c00b002390714e903sm297443oab.3.2024.05.02.12.41.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 12:41:20 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler , Patrick Steinhardt Subject: [PATCH v2 3/5] ci: separate whitespace check script Date: Thu, 2 May 2024 14:38:37 -0500 Message-ID: <20240502193840.105355-4-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240502193840.105355-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> <20240502193840.105355-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The `check-whitespace` CI job is only available as a GitHub action. To help enable this job with other CI providers, first separate the logic performing the whitespace check into its own script. In subsequent commits, this script is further generalized allowing its reuse. Helped-by: Patrick Steinhardt Signed-off-by: Justin Tobler --- .github/workflows/check-whitespace.yml | 68 ++--------------------- ci/check-whitespace.sh | 74 ++++++++++++++++++++++++++ 2 files changed, 78 insertions(+), 64 deletions(-) create mode 100755 ci/check-whitespace.sh diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index a3a6913ecc..d0a78fc426 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -26,67 +26,7 @@ jobs: - name: git log --check id: check_out run: | - baseSha=${{github.event.pull_request.base.sha}} - problems=() - commit= - commitText= - commitTextmd= - goodParent= - while read dash sha etc - do - case "${dash}" in - "---") # Line contains commit information. - if test -z "${goodParent}" - then - # Assume the commit has no whitespace errors until detected otherwise. - goodParent=${sha} - fi - commit="${sha}" - commitText="${sha} ${etc}" - commitTextmd="[${sha}](https://github.com/${{ github.repository }}/commit/${sha}) ${etc}" - ;; - "") - ;; - *) # Line contains whitespace error information for current commit. - if test -n "${goodParent}" - then - problems+=("1) --- ${commitTextmd}") - echo "" - echo "--- ${commitText}" - goodParent= - fi - case "${dash}" in - *:[1-9]*:) # contains file and line number information - dashend=${dash#*:} - problems+=("[${dash}](https://github.com/${{ github.repository }}/blob/${commit}/${dash%%:*}#L${dashend%:}) ${sha} ${etc}") - ;; - *) - problems+=("\`${dash} ${sha} ${etc}\`") - ;; - esac - echo "${dash} ${sha} ${etc}" - ;; - esac - done <<< $(git log --check --pretty=format:"---% h% s" ${baseSha}..) - - if test ${#problems[*]} -gt 0 - then - if test -z "${goodParent}" - then - goodParent=${baseSha: 0:7} - fi - echo " From patchwork Thu May 2 19:38:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13652024 Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9725217BB05 for ; Thu, 2 May 2024 19:41:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.170 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678893; cv=none; b=V9Ow8Vr9F3Lyt6UtIBE2OO4WqJZjb3DJkFldVQqX0e93F/hUUAJu5l9Ac+Y8uxwg63pDatu3SMRjaPcYrEjPUwyG79tprp2XPLDwdem3gca9xOoDAI1+WLACfzQ9YRSHRuM7glXhLibZMBFXzKZHivbiD5YF79ok3AUtqUrWR98= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678893; c=relaxed/simple; bh=00ONgb0PdtNkah5eUs0S5XOSGpq02u9tIBydTsx1ZZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=OuQtT2C0/O9v2JyXxS9l2CYp2/mWKV2zxLTnK9ROJp7xNc+7Md4AerJ9P6liPM7PamBFJfut/kSWSzuYP8fcxBnTjrlU6mle6ePHx161SziDJ+BVJ9GsYAxCXCgHu7E6UAfAuwR6LdWt3W2itFxSMjNOxqdXTYoUuvQPP9R7Ec8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DAFpeNvK; arc=none smtp.client-ip=209.85.167.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DAFpeNvK" Received: by mail-oi1-f170.google.com with SMTP id 5614622812f47-3c74ff209f6so5214531b6e.0 for ; Thu, 02 May 2024 12:41:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714678890; x=1715283690; darn=vger.kernel.org; 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=1JORxWVaH9n29n/i0ToVsIZ3I8GSYHYXwX4tEe0AMiU=; b=DAFpeNvK7g0c0nbm6Hn9vdtI4Tlw1a1tRqXfSKSe7xk9MFQq2kmSgPaQN3e5T85vp0 ApkX2fo8x9wdXfN+ze2ZGBXmWO0ITm4I6owM5fkyv9H3vx2ZqDymGzdiZw+JwqQxQDpp uN90KmEqVw9Ii9HwYBU+VGUtTDqjlFqPoQK+ztrckKJt6dUxiGttJpK0PFCYIDH8A4Pb m5JHJoc++Z7nRH7qt4ljBSEnBbrQjNhaqhRhFtQqGjAD+/s7Gr2Pk/IQFblN37h+pnbb 4awFzn2c8bsmp945lyV+yKrYIxjCYhY0w6+OpX38C+Q/zdZhnbKGh9EgIMq/wz8caAPN 59eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714678890; x=1715283690; 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=1JORxWVaH9n29n/i0ToVsIZ3I8GSYHYXwX4tEe0AMiU=; b=pTZnvSrx4wuB2LkCxr5ATLF9SYW+YTMREKZYMS0APHRn0pZMVItOV5ghf790Tg/JUH x/H6awv3/wPl+yUahtqgVkrGQ3/i03QOC9bt15Q6Me/FKDxBpvalaKvk4ckbs4SanZIy gEUc2Nh89A0yQe1JCtobhDShZCM0mTsRd3YwlJ3rudgtia0kvanX/NZ+ph2oIoLIwUsN qz6hRQt1dZTwCSGEakw3tkb+j4EsgrX+dayUgEkkXnVckI2RZ1XAG6AnG+O3N7oWBnrp PNdZPpnPoPfZqeuY5d2wlOjzsptOaES32PTc/vcWdwyTDI+AWJ4qEPv3bUYpyXugEx+d XpnQ== X-Gm-Message-State: AOJu0Yxv8jdeJSKZFQ31vQuJhp0cPrlilG8XZ0ul6HR5aG5Q0use5cZA JhbWZO/Pc+Gt8f4JY4M8UKiOI938vhqNW2QVdfSj3XMQXQM0ITf2AtouNg== X-Google-Smtp-Source: AGHT+IFrL5I6WzkfnhG26I6ho095DhJKP20MvFEBqOe+Vw5x7tsYywvi65gbh3W0kdcs03N8TGk/BA== X-Received: by 2002:a05:6871:69f:b0:22e:c860:9a6a with SMTP id l31-20020a056871069f00b0022ec8609a6amr1071753oao.49.1714678889782; Thu, 02 May 2024 12:41:29 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id uj12-20020a0568714e4c00b002390714e903sm297443oab.3.2024.05.02.12.41.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 12:41:29 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v2 4/5] ci: make the whitespace report optional Date: Thu, 2 May 2024 14:38:38 -0500 Message-ID: <20240502193840.105355-5-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240502193840.105355-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> <20240502193840.105355-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The `check-whitespace` CI job generates a formatted output file containing whitespace error information. As not all CI providers support rendering a formatted summary, make its generation optional. Signed-off-by: Justin Tobler --- ci/check-whitespace.sh | 45 +++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 12 deletions(-) diff --git a/ci/check-whitespace.sh b/ci/check-whitespace.sh index f57d1ff5f0..fabd6ecde5 100755 --- a/ci/check-whitespace.sh +++ b/ci/check-whitespace.sh @@ -1,9 +1,20 @@ #!/bin/bash +# +# Check that commits after a specified point do not contain new or modified +# lines with whitespace errors. An optional formatted summary can be generated +# by providing an output file path and url as additional arguments. +# baseCommit=$1 outputFile=$2 url=$3 +if test "$#" -eq 0 || test "$#" -gt 3 +then + echo "USAGE: $0 [ ]" + exit 1 +fi + problems=() commit= commitText= @@ -56,19 +67,29 @@ then goodParent=${baseCommit: 0:7} fi - echo " From patchwork Thu May 2 19:38:39 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13652025 Received: from mail-oa1-f54.google.com (mail-oa1-f54.google.com [209.85.160.54]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B681C17F385 for ; Thu, 2 May 2024 19:41:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678895; cv=none; b=Hc1u06S1nb7DPpeDlHTDWAG7bDbc/C6IroSnQM4Fdfx6zs97xPy+z7e8OOvu545R71q55CMjRhQvFHwHOmIromGcaJbgLXKiovtMObsusTv+IsLC+l3B1W8CXqqpuObJI3iFcfKMbRWOOlZZEkhTze2A8Gy/aYGKYNbZWdKSHiI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714678895; c=relaxed/simple; bh=Z+ksQhOqx3PSKKo3lEcsT5NS9FkiNIWRIJafU/5siGM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cJym1rWX7IRRggzFBUKILJMmxohGZyo5VUBxzz9NiAA5gkcUCLsVVxibTNVFE3vQ7ibTmPVS8HGiZiSXblAoEQHZqHIX47O3tcJd8iuCrlgoW/8enJuW67oaYG18+omN5HPLPVH4F/wYeFsRHaAWn1EoG3SSv3Q1bJakQ6xpNc0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=W6NTq+Wn; arc=none smtp.client-ip=209.85.160.54 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="W6NTq+Wn" Received: by mail-oa1-f54.google.com with SMTP id 586e51a60fabf-23d3d092a1bso1362361fac.1 for ; Thu, 02 May 2024 12:41:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714678892; x=1715283692; darn=vger.kernel.org; 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=ZIDBiS84UewzXCNV+EwH1tE5bsdwEGGpaYyWMk3/N0c=; b=W6NTq+WnAM3wPTBOAfnWt8R82jzDWj6RRH0xSS0jEPbD25+AcWf60b2KESquYsDf+A aVYQ39lxKdHFo2Ll9lvtBJjGj8azNKFZHqQr53B+Q5eopCsLAP7Xs+x/EhZbEQwCl2k+ 8dA4KJ6GNPl54JKb8tExWzX4Cu15v/XBrgOU9Y4fJdanSrYwpzaPNTpCQAt2rT4nUe8Y yqeEp4XNnxQMbqNDFCoNo3ncHNEy3pv5Qbsovsorhkobnl09asZUCkWuqFEBP1d9WhwQ KiwPOVNOAi1fQsiq1qFwaDcLPOrPIw7UdekBpFVf4zB/otr+/x5X+x8DCvWyCKiWbDsV Hxgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714678892; x=1715283692; 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=ZIDBiS84UewzXCNV+EwH1tE5bsdwEGGpaYyWMk3/N0c=; b=TxqiLHhesJGO9hEXZHTWqEID0NLJFmyueIyHwwwI1g+3pcuz6lHI41NwqyO5OUva8c H+BznPGSun4ZVAAUlFKJs6Z1CleAh6GxWxF0hJY7GovO3mF+8DMXlfH98IVkidk3McNz EuwR+WAYUbuHVVwTri5xbR+jhST9URT9r+IahagRSNaOGDI/s/ZyhYD+jnBBErcgT/4c Ox4zAsdIsOSSGq+y28sg+ARZLr8sMTGgGglht6AvA11wNmhkHc59rXR8qsmjqM+7hU+U oo3woKO6MxQssdhhjemyAykmJFSEMp4eqjkl4hl7SXAgbMGHjI7IsWO8t+JjdOfF8Ftl ZWRw== X-Gm-Message-State: AOJu0Yy79/Au0a3tTaYMGMPny1UJnfSCIjzv6SxxHBYIQbidg8tdMIY0 bPM9Y8Oys9vWxnDqhyj587THFcnObPryUzmEm1o8otg2H+csLo7IlkZMIg== X-Google-Smtp-Source: AGHT+IGP7JG010CBz9PfWKGHTPAtvwsznNQn0T38tk4MPvzEHsm6yomspEIBn4zcSQUXKumpsu1XvQ== X-Received: by 2002:a05:6870:a112:b0:233:f233:c3ee with SMTP id m18-20020a056870a11200b00233f233c3eemr962676oae.50.1714678892571; Thu, 02 May 2024 12:41:32 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id uj12-20020a0568714e4c00b002390714e903sm297443oab.3.2024.05.02.12.41.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 12:41:32 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v2 5/5] gitlab-ci: add whitespace error check Date: Thu, 2 May 2024 14:38:39 -0500 Message-ID: <20240502193840.105355-6-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240502193840.105355-1-jltobler@gmail.com> References: <20240430003323.6210-1-jltobler@gmail.com> <20240502193840.105355-1-jltobler@gmail.com> Precedence: bulk X-Mailing-List: git@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 GitLab CI does not have a job to check for whitespace errors introduced by a set of changes. Reuse the existing generic `whitespace-check.sh` to create the job for GitLab pipelines. Note that the `$CI_MERGE_REQUEST_TARGET_BRANCH_SHA` variable is only available in GitLab merge request pipelines and therefore the CI job is configured to only run as part of those pipelines. Signed-off-by: Justin Tobler --- .gitlab-ci.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index c0fa2fe90b..6d046ce409 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -102,3 +102,12 @@ static-analysis: script: - ./ci/run-static-analysis.sh - ./ci/check-directional-formatting.bash + +check-whitespace: + image: ubuntu:latest + before_script: + - ./ci/install-docker-dependencies.sh + script: + - ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event'