From patchwork Fri May 3 17:21:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13653160 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 3F0011581F2 for ; Fri, 3 May 2024 17:23:17 +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=1714756998; cv=none; b=TI22uiGMaIgAAtWY8nfgjF1+kSBqn+ToeKtjNdXkipzOI7ot8RU7Cs8wFCrWSxBgZxoQ7gLpIzcoZbERoBIkVOj9hKM8JgB5Oi6pW6UJnQfKJEB0JF/PvkRdGNIswc4Jt9NkJE9arzD6Tpk4ihsvcFlKxNLTegTkvujh7oX+BRs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756998; c=relaxed/simple; bh=kPWZWHrWJeIfy/w4RFmod9jplc/tZ+Emui/avpXenSo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=H4JxnJ7bdAoTM3hTOc7N1ayA79HbTyhRm1RGpF9cFll2xp2lBaulVTbgjt1S+LINrxJahSd6qU6HgrOox3GdHB7T7wLUb1Y8ZOaFIIFYnOlCahQ1FUBfD62QDaj0pM6pwDsLoBvpM8Sz5dfXgOPOmgd+7MDb2WSexeHeXz9VXLs= 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=lvzwqnkZ; 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="lvzwqnkZ" Received: by mail-ot1-f42.google.com with SMTP id 46e09a7af769-6ee4dcc4567so3136402a34.3 for ; Fri, 03 May 2024 10:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714756995; x=1715361795; 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=lvzwqnkZ83MSC4XQzUtq0Rxcj3kUlB2yMgrJ0wt01BK1gEtgg179Q5OKuNYB3D+iEX 7wPJtAWefUcnmPW8vmXqEd/C/c/QFJviI9oXtvUL+VPkG5HyoDBXZ0aDYodQ6Nzb0K69 PULILwoy/OHh5LBvpfwbEzB/OCOUpCNdzrhmjz24/58YJErAHjm9fC/TImxNwPzmGjAG 2KiENDYkm1LXyqoQ00c6u/BAu7k7NRXXomg21JtauZMwzlTp7hHoQgiGxDoz80yH3PUM RDLdr8MNmwzYCdtF7+tqOQlVBVKuf17YOkgbdItS+shGh+SZnn2OlZt8S2kQ5P240Cg2 drVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714756995; x=1715361795; 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=aTMhSKpOL9DLicKVj9cKT/BxyiNJXSuUE6HlZ/wk5zwrLopnUssKuZykttYjdsjxdt povIABf4sO/E5QePi+46E8QShoBy4tSxDrSKDfzDx0z09sL7FGs6l7JKRvYn24BxJ+y6 K/6RQQYaX/tj/9M0uqJB9wZOt0LHG9QRDJBpRxn58B34m/HjpKbQLSh0XU13LEKH9jht Vq0uTLCglvYvODJR2Zoww5D2tzJTzpu2gd9RjkQJiLruHzevbPgRGJqDHUE18UiI97E7 wNQ99xweqw+ELsedA9JGSmN0ih34jvVPRet4k9wr9FkhthqFRvzUgi6exz0S46pBz6wX f31g== X-Gm-Message-State: AOJu0YyrgmLIzSUcPh2jY3rYBHAYkty5AOso98DbTBiQuYkhJoh25j0f che+WHRVaLhs1eWY8XCl7rpdjrocfpfCTQvAocH+fZ+GTgpw3TZyUn/f2w== X-Google-Smtp-Source: AGHT+IFh9um2/JAeslDVzacatGHyf4TLgUsVC/2aLB46YIqhRi8ichsVizKjzAlnahqcMP1ujHFxLg== X-Received: by 2002:a05:6830:16c3:b0:6ee:3e22:83cb with SMTP id l3-20020a05683016c300b006ee3e2283cbmr3868132otr.16.1714756995179; Fri, 03 May 2024 10:23:15 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id cy14-20020a056830698e00b006eb7b0ee326sm705212otb.65.2024.05.03.10.23.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 10:23:14 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v3 1/5] ci: pre-collapse GitLab CI sections Date: Fri, 3 May 2024 12:21:03 -0500 Message-ID: <20240503172110.181326-2-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503172110.181326-1-jltobler@gmail.com> References: <20240502193840.105355-1-jltobler@gmail.com> <20240503172110.181326-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 Fri May 3 17:21:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13653161 Received: from mail-oa1-f52.google.com (mail-oa1-f52.google.com [209.85.160.52]) (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 8A7021581F4 for ; Fri, 3 May 2024 17:23:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756999; cv=none; b=dbckcVP9ILkpdB45IKvfSRaW7OEbpQZHMD8yLstPEtPgj+LJ1ILNyjoeLvd/aM5YH01AMaYMSCSW6dV3UHRyxoYehlYUSIL/DTvZ7LiA/iOjkxc0yAJKboHpZsUWddTy4Kz6ajeeJLNPei5pYJUs84DATJeStNICk3rkYxGQ74c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714756999; c=relaxed/simple; bh=UahwUq9KQ+L25qWoYlDOZhfHrQ02v1DAE6Qi/vaHVgE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cTZfbCsV6Qtgi32D6Yp5SLQk85k342LAQBYE7sDmSN5PrDFoIvDLWBoRZ9+z6ukzTZaH/KB12NetDCuxc23apyBQ4PdOGKM+Bp/6a8Py2AmYgPyETlXFfgjt7ByDGsRyDtuXugRiVsA+JBnsTcKBXAbnFExNtYgHzb0ewqQNs2A= 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=jqLP9AMe; arc=none smtp.client-ip=209.85.160.52 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="jqLP9AMe" Received: by mail-oa1-f52.google.com with SMTP id 586e51a60fabf-23dd52c6176so1373786fac.1 for ; Fri, 03 May 2024 10:23:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714756996; x=1715361796; 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=jqLP9AMeO7hlF9Wa4B/yMwREa8+0pi3Rj/Lvj2l+iiOxe3brTMHcVwwxV0JeXJLg1p ZOqfS7PNZVKKYIunz5KUqPhG/ds0/bpuNe89lRCyZiLuknte6WWLFNSYw5X/hQjF2T2I 3CdcDRHY1SVMwI7+b+FGGhZ3QMbvo3G6ORzKW4Rttt3aV7Rn3fPMcT1RpXXBClEZ7/AU BxEgT6VygK5HQCMVmRnCpt7CxsYSyVaKzYS0OZnYa4Y3JSzldMj6/QJob7RB+NjhjyeH IMpUw5AudrWc7nrZKg19c1H9DGLfdky+TYjd8EcUQtZ6jUsHBjJjiVbVGmaTMxCR4SPF 4Yig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714756996; x=1715361796; 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=W4YkSbsoM4v73biy6IoS7/gpcbGd3dkzZRqhF1eUW0rlj9z/bdlnWCoc3tb4XHyQHv 5K98vWYLVq9BpRXQkaMPeyST9d1xoO4vPA59PBahYRSe8WudlAsNHPKyceyW1NOcClJN 7HfVrzrkEDGHdSGyiWEtkp6WbSUFEwU5VvcUSNhzRAWQ9eparFGcHNBsnNGpa5X3vu5g iY/AdCzUJKNchryyOToOPh9qYKnbzAdpuUz1XammVsqJhW6oh+hVCJaFSaCd+U/xnJ2Q m4xeTAXYPqXrKKKfZoliCxvEoAXptHH4NKEQL00eDZVzy47Eees/Q5SLYfMJqKy8ANjL LRCg== X-Gm-Message-State: AOJu0YwPwEUNUqmMCqqRLIORitIuqalMoOPzdiWtER4+B5Hovxi4iHaI V8YBlhwqyZzpoF9k1Xnvsyehe0/z65DNvwHJNZv4A+J8YTVnNGO6+b+kEg== X-Google-Smtp-Source: AGHT+IHt+tpaVqer8srloLk5CfWP6G22mGQOvrsn/oi7cFByRLCQ0cUcqOuh5HSBvP7NbOaY1Nd/Ng== X-Received: by 2002:a05:6870:2328:b0:23d:35a:24d with SMTP id w40-20020a056870232800b0023d035a024dmr2499542oao.9.1714756996392; Fri, 03 May 2024 10:23:16 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id cy14-20020a056830698e00b006eb7b0ee326sm705212otb.65.2024.05.03.10.23.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 10:23:16 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v3 2/5] github-ci: fix link to whitespace error Date: Fri, 3 May 2024 12:21:04 -0500 Message-ID: <20240503172110.181326-3-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503172110.181326-1-jltobler@gmail.com> References: <20240502193840.105355-1-jltobler@gmail.com> <20240503172110.181326-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 Fri May 3 17:21:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13653162 Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 D53CF1581EF for ; Fri, 3 May 2024 17:23:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.53 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714757000; cv=none; b=ptlH+r3fWwLfUtt167CFhQ9rSjsCd75xvDpp4deBDZrK8JbKDe6lGWWSELG3cZI6UXFr6YfZuT92YNVInq5zGu2E+q+3lo7BSmiqRqiavz+URQDTmT4pFkGQzkQ8MlbdY7WQQ1mj4atHokAv9bwVL3tP3sDCqA9EIGjh5oXV9wg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714757000; c=relaxed/simple; bh=X3c3dB6GrxwCDFFkJUxTJuwutdMW82AgfcOYHt+NSxM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=YvQZmryrrDPUC3vTaXm6IfklVa1htZB+gsbDjec2dypLkEPqy61RK4hcsmrW84AzYdU4vcsfLPzVt158mC27aw1H8qOT/KoFnDRkdMgcy+1ulFUUjCKVWkH8alDsx+k5y9TPpAuH59n2syH0DrKQjYz0ZD9NTnD//W2vdNiAdKQ= 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=jZ2ma+UN; arc=none smtp.client-ip=209.85.210.53 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="jZ2ma+UN" Received: by mail-ot1-f53.google.com with SMTP id 46e09a7af769-6ee3231d95eso1607968a34.0 for ; Fri, 03 May 2024 10:23:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714756997; x=1715361797; 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=eaYZanCcN/0A5sR/5ZDpxGmHTlj4CGs8Xv0hH4TfpMQ=; b=jZ2ma+UNhfrrjGpRuzomcZstC8UO1ID3i7jFmmHMvUZm87pwP6bXVN38BBsp5gI2Qu jG840gAShRMfYKAxnwgkzlHEqljm/VmPrQfvDaWcBVsiPnfOV+9jxVEZb11UAdH6/Qd2 obeKhPrAkiB7h9G0+gJHEqmAmHwmLPEFAeWKqYu208Mm+K/ioJxrB4l2qrqG/SNp7izR f3/vs2Bgi4MgxF6Z1c8pfYbj3nYEZSbE9dknFjSl5zEl5yOXxUUac3Ku0usIEfHpKQ6X eLM8kJR82puqViydfc6jOAQGQ5T6+8dEtXAf5yonBjVTfPDBpinX2ZHI+eDjJRiKUtdr 7SCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714756997; x=1715361797; 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=eaYZanCcN/0A5sR/5ZDpxGmHTlj4CGs8Xv0hH4TfpMQ=; b=e5vbp64PNLQ9aultcSdtKlJBndyTMF4zn6c3qI/4PxD1mYe/pZtyA/szfpKrZjH+/B JxvMNqoua/sNNiEz1DuM+k1alTCKSbS0MZ3cn1uHaq8vD1s6oHzbRwVrVlsxMzgrmyKr jI+AljXUZW9wMcbeCbDatEXYdugLYlVo0wYBOtLvoI1gZwItoyakOxWfarrVVIIXYLiw asGwxQDLMGZB9zsMdbXe1WAWK2NoTvY+Er7bBF5DVOU6NDCoX0EyuGpDcfHhnLEfLXDx qqxusMG7HAEGojo4UyNSqVX4J+gQMJFheAV6y+QxYbHFxIb2WwUrOIm4QPUgFdU36mDD 6TsQ== X-Gm-Message-State: AOJu0YxcOKAeSzVZ96XjVEsoKO07cw+ohAHvt2+8W65KZvHApHkHOqP+ CACC2FzNKxuD/kPanPX7BR/MIO2YbJlhS7be3P+4+Xv/uSegolMx8yh8bYOx X-Google-Smtp-Source: AGHT+IE7E99QuWnd7KgVmpUWNRU84Ta6am2SzehpsYZ5WHMFucp/N0RMYhTBNwzJX6OdWXAxa2Pc7Q== X-Received: by 2002:a9d:7d98:0:b0:6ee:2741:d1b0 with SMTP id j24-20020a9d7d98000000b006ee2741d1b0mr1395184otn.0.1714756997650; Fri, 03 May 2024 10:23:17 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id cy14-20020a056830698e00b006eb7b0ee326sm705212otb.65.2024.05.03.10.23.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 10:23:17 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler , Patrick Steinhardt Subject: [PATCH v3 3/5] ci: separate whitespace check script Date: Fri, 3 May 2024 12:21:05 -0500 Message-ID: <20240503172110.181326-4-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503172110.181326-1-jltobler@gmail.com> References: <20240502193840.105355-1-jltobler@gmail.com> <20240503172110.181326-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 Fri May 3 17:21:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13653163 Received: from mail-oa1-f42.google.com (mail-oa1-f42.google.com [209.85.160.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 00995158865 for ; Fri, 3 May 2024 17:23:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.42 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714757001; cv=none; b=onOkLgFhIDXePGm5Ne6ZimZes1NcJb8ZmrVejYyRKzh7qTQI1YCMO2WleHouJsft1kFzxWFhi3z00qyM9jEmtArMfw3W3rUdYJBDt3kuaaaUSCyLJI90BmHzKxGXFqEOba2i8mJUi/y9FPvE2WqxvTF5WQ37fs3q1ET1psNPzDc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714757001; c=relaxed/simple; bh=XDdWxTKd+UMMDl+BreB28KsbvnKhxUAO8xphMvT6aSI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=FXRYfNRW8PdzWcAoj6r6CSBtaZoesMf6HhkQh1QDukViH7joK6ddRnq4iA11cy3NgmmvVrVDxt1DmkuqJL3BbGYMShUBPlXyLpXl9Mwu94ZnYq7MAwdwJ1q4cKzX2upXye2J0uh1CaadBmRnr0GlEEtq082qYF2IvqMwwkhz0zQ= 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=G5INiKv8; arc=none smtp.client-ip=209.85.160.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="G5INiKv8" Received: by mail-oa1-f42.google.com with SMTP id 586e51a60fabf-23dd94111cfso1078784fac.2 for ; Fri, 03 May 2024 10:23:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714756999; x=1715361799; 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=BF7fDwS9X2wTNKNZGlOinf4i33Kfaf/XEL7Tt0bmcL4=; b=G5INiKv8EwLtIKCYBiD2UWScUEZKji6z+IhBIKFLSlQN5VgrB2ioWX7JdDHCvRgVdQ 5TWhhbugmRLQ++2eZ7Lugt5+8S1ZqE+U0CRq8kuEL/IIi2kdIL7kIJV9H2KVSbfnzlU/ 98tp65Qe8n8IkMm/msAkerWuM1UKA4onktEHun8sqPIoG2b3Zi84Bmt8USr564SfY5EK OkZvaXaMsArOEOVp1vgdSzXHkkrMHMxpNbNet/sAche0gnt1fuSknfUv+rdcesnAIzvQ k4wn/XSBTbQkixRejdnYTsl6V2gsAxUyKYd+NFqjcqyhdYu7hewQ3efapDKUY6V5Fo0m qA5Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714756999; x=1715361799; 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=BF7fDwS9X2wTNKNZGlOinf4i33Kfaf/XEL7Tt0bmcL4=; b=QGnid7oBqJVrLJmMY9ysfhIBWQ1xlDlAMdv+HcYeRY/JSnN2SCB5xQ1vtrS+RYxONa 2d7gve0QwztjRdf+9CARlb0gbElBEUe9CfXfzMJC94ScUN5kvFNrFX5R5VSmBH0Np3Fs A8Eh3AVXh53b30i1NZg3bY8JatRsCCm5qzfELHOCRXsKDnEeHcTM0qU6owXVrnJCl+lj xfOhswTKGCfpHDYiRURA65+XdQOZOezRp3IWD9Awn1uWFP8oaenNK0rJG6lPJm9VoJgI wrMWid2nZ4PY3BLC2Q3hGcWH1Y91OMMcWHP4emaBhFRg3TyLMdQ0fD2Kd8SyC6B6pUMd Qjcw== X-Gm-Message-State: AOJu0Yx2kuJ8rxjr1gFoMgYrCaKqwmIIPOMMvwEjULGexSDmD5eDgSWQ S3rCFjelyDBCh4OrnE3LhRmkVrR6FwTqO02+NueaxUKtVZiao7CpKWd4iQ== X-Google-Smtp-Source: AGHT+IHa/5M4OLDkPQAGheBQfncqDL6XEexhh44tZaULeuKl0lisLI6Fja0dreDwvXN8T34qdrovGg== X-Received: by 2002:a05:6871:a58d:b0:23c:6c62:9cd6 with SMTP id wd13-20020a056871a58d00b0023c6c629cd6mr3644368oab.23.1714756998689; Fri, 03 May 2024 10:23:18 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id cy14-20020a056830698e00b006eb7b0ee326sm705212otb.65.2024.05.03.10.23.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 10:23:18 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v3 4/5] ci: make the whitespace report optional Date: Fri, 3 May 2024 12:21:06 -0500 Message-ID: <20240503172110.181326-5-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503172110.181326-1-jltobler@gmail.com> References: <20240502193840.105355-1-jltobler@gmail.com> <20240503172110.181326-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 9cc496da40..db399097a5 100755 --- a/ci/check-whitespace.sh +++ b/ci/check-whitespace.sh @@ -1,9 +1,20 @@ #!/usr/bin/env 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 "$#" -ne 1 && test "$#" -ne 3 +then + echo "USAGE: $0 [ ]" + exit 1 +fi + problems=() commit= commitText= @@ -56,19 +67,29 @@ then goodParent=${baseCommit: 0:7} fi - echo " From patchwork Fri May 3 17:21:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Justin Tobler X-Patchwork-Id: 13653164 Received: from mail-ot1-f47.google.com (mail-ot1-f47.google.com [209.85.210.47]) (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 35692158872 for ; Fri, 3 May 2024 17:23:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.47 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714757002; cv=none; b=e6nVsXlf3lZX4R5qA7tC6QShjwvp01qXH3VKybfquVNCuVeBLzExQotKnUoMW8KOcLV2EoEKLVyT3cLziCQrsL8EdXxFhiu0GGdGFwpH4MNyDhepLu1piqMpVd4XeB9GYNiVMHTRkgnoiN5T6dcqfHkIQotc8xi2l0oPqsEBB+w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714757002; c=relaxed/simple; bh=ImeOsnL34aJuDh8axgha4e3hdmEIP4bjuaztPZdaQM4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=aVpqE5rEXnJWoGyerpib9MR9rW88efh2Qf8bETkIWCPI7qdvt8j1EAPH8odvvymCm9wM2fYWW6Ocyqo6W5B2koBndFWiZkfvm8xIQKEVsCjRcXBJqBygkmS1pQBFgsSO7DCHXKOF4J29kvzoq48mNWKTIty5q97cgflPNQJhdnI= 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=IebbLMA5; arc=none smtp.client-ip=209.85.210.47 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="IebbLMA5" Received: by mail-ot1-f47.google.com with SMTP id 46e09a7af769-6ef98eee195so939930a34.1 for ; Fri, 03 May 2024 10:23:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714757000; x=1715361800; 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=iFYRrHJnj2Ftb7bcZDOjFcHuHpxB93oQkzwCgChwr+I=; b=IebbLMA5ynhSSDTuyc2sRX5OMDE8StPzIR8LYpfgGzRi8tIVn9GYnxoJJlwvEf8Yxi 5F9CwDhmGtSoMM1U7s2Hs1sVaCn1xu3tT6Q8wj1v7oIm1C9GKs1h/LVSeqhQlBmy3ZoZ COmSwjlr576I3Gy4HEm5D9euQjdg8k6knakSX8lukvVnimHCMtjWt0e/k1VnMJkWBwKa GNq7JmUl0DAbEulLWFzViZz9T9b8sUP6oCH6MfkhNrmsh7DQD5Ga3jKpNrPu0hH6VkjH qI9Vp+BZkmIjNkcUtGubNkunZAgeGsNkuYSZbNlHvnMRAfn7LnXzK2e/gM5OTQjsbuLT YgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714757000; x=1715361800; 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=iFYRrHJnj2Ftb7bcZDOjFcHuHpxB93oQkzwCgChwr+I=; b=ZlwJsb3K07mZ///Otzd/ol90kRzeIx/0ZkHkXbhTtLjrbosb3CmY77gNgJDYoLmd04 02HNrhVmUNe1RATDDMC7uCAAJ2zDN2rRJSkqz7CBrwuhgkK7uqsW5NArYMAqbjHoFdcA D8qIFK0+E4ewHRxdSnh3nsC82PmKHK81rfBd9SHD5ylRTxbcfD/lZAac/pwl/hrNVGgU Wfzce6vWxzFD2rlSIAYs3Db57p4RRt/2kTbrOKwWlo3J8kxcgUFw6iAbVK6eZ8LVurHU UqnwlC0Qx5MrT6vwvc+q6ABdAd8JUg1ormCaxau2V1QbvlizRtFyKjDPaC4e5y/mSq5n hvTg== X-Gm-Message-State: AOJu0Yy22123urj/dP7bBT/j3jz0yB1MT9Sf3wG+SDVUmfV6Q9o0wWXF qb/EGciAiH5l8zNL1gf5mMKQpOK4InPmXPkUWroagrSXrdK/Ks6/8dR2/w== X-Google-Smtp-Source: AGHT+IGVsCRcZAn22W7nH03QeZyCb9LhSp7gJI+VlRvQrc1pHzAHrxLDPk/K+CLa5KlSSUXkDy46Nw== X-Received: by 2002:a05:6830:108a:b0:6eb:a637:97aa with SMTP id y10-20020a056830108a00b006eba63797aamr3870140oto.21.1714757000028; Fri, 03 May 2024 10:23:20 -0700 (PDT) Received: from denethor.localdomain ([136.50.225.32]) by smtp.gmail.com with ESMTPSA id cy14-20020a056830698e00b006eb7b0ee326sm705212otb.65.2024.05.03.10.23.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 May 2024 10:23:19 -0700 (PDT) From: Justin Tobler To: git@vger.kernel.org Cc: Justin Tobler Subject: [PATCH v3 5/5] gitlab-ci: add whitespace error check Date: Fri, 3 May 2024 12:21:07 -0500 Message-ID: <20240503172110.181326-6-jltobler@gmail.com> X-Mailer: git-send-email 2.45.0 In-Reply-To: <20240503172110.181326-1-jltobler@gmail.com> References: <20240502193840.105355-1-jltobler@gmail.com> <20240503172110.181326-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..619bf729fa 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-dependencies.sh + script: + - ./ci/check-whitespace.sh "$CI_MERGE_REQUEST_TARGET_BRANCH_SHA" + rules: + - if: $CI_PIPELINE_SOURCE == 'merge_request_event'