From patchwork Tue Dec 20 00:35:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Webster X-Patchwork-Id: 13077339 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CDA69C4332F for ; Tue, 20 Dec 2022 00:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229715AbiLTAfz (ORCPT ); Mon, 19 Dec 2022 19:35:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229492AbiLTAfw (ORCPT ); Mon, 19 Dec 2022 19:35:52 -0500 Received: from mail-wm1-x32d.google.com (mail-wm1-x32d.google.com [IPv6:2a00:1450:4864:20::32d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1D89D80 for ; Mon, 19 Dec 2022 16:35:51 -0800 (PST) Received: by mail-wm1-x32d.google.com with SMTP id bg10so7635280wmb.1 for ; Mon, 19 Dec 2022 16:35:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=F8bod0Rl9Tnm1gnlXbsPAOPh2lPs80zvyxTxHmg+bUg=; b=hb+H39OQAPm8vVAexBNW7tX1l0oQnFhx24+ZTVLEQHT8ZmnxK1xgbbd2PMaZDtgKIa tqBP8lfDapR9xf1hOD/if/IP0wPr4Kgr/LQkb9xHwlfMNku2o8O8aP/VjzBD3fHCLkka Xhdqs4oFSZbGLt+qY5AfEFSw9hdjzhi0wfK3OPq8pV5LXNjhw6o46Mi2A4M01rury0D5 q4hNEoOb6lCChpXftUplXgxpJlmb9hj+fJuMlwLzQ631N+WIKNMmMNjxBJcmDSNDi1t5 sQlPm10/SRmfp2xrGit8lU7k6kGz1ND6S4YtdqAqBiGnpfJqATEQs5Q1HfWKFkUSrb+L 8PXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F8bod0Rl9Tnm1gnlXbsPAOPh2lPs80zvyxTxHmg+bUg=; b=HYnvnHfNxCop+OvVYDDw3SS9fIy03UVqypNHCGehpbvsUUqpV0IvK+r+zfWE8bJZC1 a5bZI9TeXbUDzcVmK6+QrdNEO021QFr/Avj2GXTi1OcnrssxmDkfQgbLRGrBNnRT6rAe F66YIwUb/HXvZmvEMTGAQ5dp/vEPiBbWlXqcT8PSYOkCyZm2W9/c9fA+Q53WdjZnoUeW V5yRwTCtjE2YNYgmRHwajaLCAGnMejKYpUvkgYUBk1XKXCmoEGmK90gpoD0WCGGK6Pgh uyu0UCwp4HykQo609YBpuH1Xf74qHzNv/9fDysyC+sJCuFfJpdhwXhrWMuYb3k5Ii/bc XpMw== X-Gm-Message-State: ANoB5pmx3mQTRRuCIgWhu3qpFD6tH5QOGp2G0/3oeD+RFUZbMcJ/Nd2C hLkrQSAJLPa/0NKH3ZSPeas1mv+++Jw= X-Google-Smtp-Source: AA0mqf5wdgmdzv9PZyZF6UTL9/be2iNcIaMSFW4wpkzpz03iWjFGFvzxfY1+tq/7KilkGzEgw0QUqA== X-Received: by 2002:a05:600c:1c87:b0:3cf:ae53:9193 with SMTP id k7-20020a05600c1c8700b003cfae539193mr36037803wms.39.1671496549934; Mon, 19 Dec 2022 16:35:49 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a1-20020a05600c348100b003c7087f6c9asm20993124wmq.32.2022.12.19.16.35.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 16:35:49 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 20 Dec 2022 00:35:45 +0000 Subject: [PATCH v2 1/3] ci (check-whitespace): suggest fixes for errors Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "Chris. Webster" , "Chris. Webster" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: "Chris. Webster" From: "Chris. Webster" Make the errors more visible by adding them to the job summary and display the git commands that will usually fix the problem. Signed-off-by: Chris. Webster --- .github/workflows/check-whitespace.yml | 37 +++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index ad3466ad16e..a0871489b24 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -20,31 +20,50 @@ jobs: - name: git log --check id: check_out run: | - log= + problems=() commit= - while read dash etc + commitText= + lastcommit= + while read dash sha etc do case "${dash}" in "---") - commit="${etc}" + if test -z "${commit}" + then + lastcommit=${sha} + fi + commit="${sha}" + commitText="${sha} ${etc}" ;; "") ;; *) if test -n "${commit}" then - log="${log}\n${commit}" + problems+=("" "--- ${commitText}") echo "" - echo "--- ${commit}" + echo "--- ${commitText}" + commit= fi - commit= - log="${log}\n${dash} ${etc}" - echo "${dash} ${etc}" + problems+=("${dash} ${sha} ${etc}") + echo "${problems[-1]}" ;; esac done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..) - if test -n "${log}" + if test ${#problems[*]} -gt 0 then + if test -z "${commit}" + then + lastcommit=${{github.event.pull_request.base.sha}} + fi + echo "A whitespace issue was found in one or more of the commits." >$GITHUB_STEP_SUMMARY + echo "" >>$GITHUB_STEP_SUMMARY + echo "Run \`git rebase --whitespace=fix ${lastcommit}\` and \`git push --force\` to correct the problem." >>$GITHUB_STEP_SUMMARY + for i in "${problems[@]}" + do + echo "${i}" >>$GITHUB_STEP_SUMMARY + done + exit 2 fi From patchwork Tue Dec 20 00:35:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Webster X-Patchwork-Id: 13077340 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 594C7C4332F for ; Tue, 20 Dec 2022 00:36:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232710AbiLTAf7 (ORCPT ); Mon, 19 Dec 2022 19:35:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231862AbiLTAfx (ORCPT ); Mon, 19 Dec 2022 19:35:53 -0500 Received: from mail-wr1-x42a.google.com (mail-wr1-x42a.google.com [IPv6:2a00:1450:4864:20::42a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A3D610D3 for ; Mon, 19 Dec 2022 16:35:52 -0800 (PST) Received: by mail-wr1-x42a.google.com with SMTP id h16so10257716wrz.12 for ; Mon, 19 Dec 2022 16:35:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=Zl6Iga4ua4RWF2Ch3AHdkeYMAPYH/eqhuovDHXPKyLY=; b=Pp+Q3al9Wmm0FJtWfCZ82sBV7Ma5SCQJElRUlHork8Tvo+8fnH3NJiJmx2UFjWPMbE t3C4C1qkqi9m4dfwu/O6SuG9R0f9DTq42J3VtZ3F8ZJAIzsKbmfF+KArmEY0/9FJkn3t RmsJ56JJsIFcJeKRkcbImU9JFI7lAnyQoTn9TtP3E/kZ8VVTW+bGQ/oaz6r+gOVFv7S9 TzKqq5OJjURe7rdQDCS0HJReRfcQafwlO0exmUkqqLq9weNBxamMBRANCp4oeU2dDPqF Jmf9oyu34mbABZVe/eZohb5EzZiPeFik2E8RTLgmMSQ4VuOw0sW+Dl5AyYxGX2cWg1pV JplQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Zl6Iga4ua4RWF2Ch3AHdkeYMAPYH/eqhuovDHXPKyLY=; b=3gjci+stbO70rQ9wh4AAhpYR/FfDgcbrRZTPI05nL8FSDy0Td3cEUd9Fo2XbQ54MNd B4KqWJMZsrTdqujF3avTHGyyVc18MkJxbE4bsf9O83AbXF2+ei3BlByKqTK6XmjyMxE0 fWggGNcE0fF/XXwdpnC9ZS1b4g5YnCQ2/gam1++PW7oHvudjDSnogEOXqnIPYXQrmNFg H5GgEw1aWKv2FTvDOm18gE58zVHTH67Lc1n9Mcml81U6GeSnvmUZ+Rqz7b2vM1GMTDFw S489d0wPyQUgO9etzyLc2xrJ1JrzH3odb02jRA2lXuiasgUTbiFV9icPrVUislpq3Mg4 lzSA== X-Gm-Message-State: AFqh2kpuc0b+F5BxVlONP+2CW7ZFdnsp2HS1beWSR7w7/KGXe62BJeuT FjA2dMiKULNQCBAJrg2qzAUAGoSlfoA= X-Google-Smtp-Source: AMrXdXuNn8E1sIvIpPTrQMUfgCjhouHKu5ITQ/DLk+w5CdKxiu6rqX8cY7x1i+wxx+e3LTLscvNSZQ== X-Received: by 2002:a5d:50d2:0:b0:241:d126:ea0e with SMTP id f18-20020a5d50d2000000b00241d126ea0emr127206wrt.65.1671496550770; Mon, 19 Dec 2022 16:35:50 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z5-20020a5d4c85000000b0023659925b2asm11082814wrs.51.2022.12.19.16.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 16:35:50 -0800 (PST) Message-Id: <342167ef5bd7f98a7248feea86f4f77b268988bb.1671496548.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Tue, 20 Dec 2022 00:35:46 +0000 Subject: [PATCH v2 2/3] ci (check-whitespace): add links to job output Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "Chris. Webster" , "Chris. Webster" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: "Chris. Webster" From: "Chris. Webster" A message in the step log will refer to the Summary output. The job summary output is using markdown to improve readability. The git commands and commits with errors are now in ordered lists. Commits and files in error are links to the user's repository. Signed-off-by: Chris. Webster --- .github/workflows/check-whitespace.yml | 34 +++++++++++++++++++------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index a0871489b24..552894f736a 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -20,46 +20,62 @@ jobs: - name: git log --check id: check_out run: | + baseSha=${{github.event.pull_request.base.sha}} problems=() commit= commitText= - lastcommit= + commitTextmd= + goodparent= while read dash sha etc do case "${dash}" in "---") if test -z "${commit}" then - lastcommit=${sha} + goodparent=${sha} fi commit="${sha}" commitText="${sha} ${etc}" + commitTextmd="[${sha}](https://github.com/${{ github.repository }}/commit/${sha}) ${etc}" ;; "") ;; *) if test -n "${commit}" then - problems+=("" "--- ${commitText}") + problems+=("1) --- ${commitTextmd}") echo "" echo "--- ${commitText}" commit= fi - problems+=("${dash} ${sha} ${etc}") - echo "${problems[-1]}" + 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} ${sha} ${etc}\`") + ;; + esac + echo "${dash} ${sha} ${etc}" ;; esac - done <<< $(git log --check --pretty=format:"---% h% s" ${{github.event.pull_request.base.sha}}..) + done <<< $(git log --check --pretty=format:"---% h% s" ${baseSha}..) if test ${#problems[*]} -gt 0 then if test -z "${commit}" then - lastcommit=${{github.event.pull_request.base.sha}} + goodparent=${baseSha: 0:7} fi - echo "A whitespace issue was found in one or more of the commits." >$GITHUB_STEP_SUMMARY + echo " From patchwork Tue Dec 20 00:35:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chris Webster X-Patchwork-Id: 13077341 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E05EDC4332F for ; Tue, 20 Dec 2022 00:36:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232725AbiLTAgB (ORCPT ); Mon, 19 Dec 2022 19:36:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232589AbiLTAfy (ORCPT ); Mon, 19 Dec 2022 19:35:54 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B930F6 for ; Mon, 19 Dec 2022 16:35:53 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso7685671wmo.1 for ; Mon, 19 Dec 2022 16:35:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:from:to:cc:subject:date :message-id:reply-to; bh=vRyKBtVFUSsZz+7gjwjpM753NymGAbljoWelkpcw22E=; b=NGQ8H3Hfb6+61G8nvYM41RfFtIJMuKWsWGQT9zrSYMt5Rwsz48q27oT1sGUQwzUmhl befWtmRhaqAgG3KCFuByTm24oe6P/oDyvVrI9P9GXgLtpdMFhwmrHcfvapDTzkD5qR9p sPtElgjcYDCzk5rZh4AZPp+miukuythhmLpfZ72UTjXmPFtKBgvRSnYW3dp+4QfKMxpe 69NoCraEsO6IkPtI0DzW8Ka8J0EcDxhosPDGGDUtJZBnGp/9WmQGC+5rosGiqTMqn9fc zGOnACkBo+1K9aA8PT86Y0nlTx+gAXVd3XCvPwSWOpPUvYMPm5rio9G2tYN3LijolWUp YhRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:mime-version:content-transfer-encoding:fcc:subject:date:from :references:in-reply-to:message-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=vRyKBtVFUSsZz+7gjwjpM753NymGAbljoWelkpcw22E=; b=CEmfukNpe2gEVuOXv49+qHT3TcFh5skVdu1QevsfuKfkA1uvgkQuCpth6g0WogDO2A BeTwk0bPP21ARV44Ih84XZz7lZz6iDZU1Rap5W47BVVJvBF1dcIc/rqV3crCYqZe+GWr GENmaFsOVIwLhrTiDnbLWDN44XfYCqTs1uttF/kwUHl8qFJMtmieman93gs1oUXUdVC1 IQHno/6fmj0IMPAo0v7huw3udvYHRf/aCmEl7CDph7uVuT+p0eNoSn4RLD1VBuIcgE0L A9pEGC5vWkujhp600iURtqCAiP1Yfp0mvqUEJ4OZz9rI8eI7B7aO4h3yHYo7MRaVDmip 6pzg== X-Gm-Message-State: ANoB5pmJgyrQwgYLA8xOxshwVHjjRxn1IhJ0hqdkXKYOXpMkuJakFUUj bxa+f6+oYUsD1vMib62aScclXy+qcOU= X-Google-Smtp-Source: AA0mqf5Z/l+5r04Tx71lQGvZg5kInjYII3dcLi3J3TiK1UFWYOyyedwf/uNU5optDjwvr5nUkG4miQ== X-Received: by 2002:a05:600c:3512:b0:3d1:fcb4:4074 with SMTP id h18-20020a05600c351200b003d1fcb44074mr45316816wmq.22.1671496551471; Mon, 19 Dec 2022 16:35:51 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k5-20020a05600c1c8500b003d237d60318sm15114777wms.2.2022.12.19.16.35.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 16:35:51 -0800 (PST) Message-Id: In-Reply-To: References: Date: Tue, 20 Dec 2022 00:35:47 +0000 Subject: [PATCH v2 3/3] ci (check-whitespace): move to actions/checkout@v3 Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: "Chris. Webster" , "Chris. Webster" Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: "Chris. Webster" From: "Chris. Webster" Get rid of deprecation warnings in the CI runs. Also gets the latest security patches. Signed-off-by: Chris. Webster --- .github/workflows/check-whitespace.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check-whitespace.yml b/.github/workflows/check-whitespace.yml index 552894f736a..da557fd5914 100644 --- a/.github/workflows/check-whitespace.yml +++ b/.github/workflows/check-whitespace.yml @@ -13,7 +13,7 @@ jobs: check-whitespace: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 with: fetch-depth: 0