From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id COMYM6dPx2N3jAAAbAwnHQ (envelope-from ) for ; Wed, 18 Jan 2023 02:47:19 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id eJfqMqdPx2PYZgAAauVa8A (envelope-from ) for ; Wed, 18 Jan 2023 02:47:19 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9321E44AAE for ; Wed, 18 Jan 2023 02:47:19 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pHxWw-0002u1-SS; Tue, 17 Jan 2023 20:46:22 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHxWs-0002qJ-R8 for guix-patches@gnu.org; Tue, 17 Jan 2023 20:46:18 -0500 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHxWs-0007E5-FY for guix-patches@gnu.org; Tue, 17 Jan 2023 20:46:18 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pHxWs-0007ef-C3 for guix-patches@gnu.org; Tue, 17 Jan 2023 20:46:18 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#60922] [PATCH 23/25] gnu: Add gofumpt. Resent-From: Katherine Cox-Buday Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 18 Jan 2023 01:46:18 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60922 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 60922@debbugs.gnu.org Cc: Katherine Cox-Buday X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167400635929046 (code B ref -1); Wed, 18 Jan 2023 01:46:18 +0000 Received: (at submit) by debbugs.gnu.org; 18 Jan 2023 01:45:59 +0000 Received: from localhost ([127.0.0.1]:38653 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHxWY-0007YL-ON for submit@debbugs.gnu.org; Tue, 17 Jan 2023 20:45:59 -0500 Received: from lists.gnu.org ([209.51.188.17]:44550) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pHxW8-0007Vp-Ca for submit@debbugs.gnu.org; Tue, 17 Jan 2023 20:45:33 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pHxW8-0002CH-2S for guix-patches@gnu.org; Tue, 17 Jan 2023 20:45:32 -0500 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pHxW6-00076T-AK for guix-patches@gnu.org; Tue, 17 Jan 2023 20:45:31 -0500 Received: by mail-il1-x12d.google.com with SMTP id v6so6853486ilq.3 for ; Tue, 17 Jan 2023 17:45:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; 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=N5XoULSc/RpQ9HrHY5fnRm6QXy+f1wK2MKhKB2z42Ho=; b=XXzq2gkW6Ngm5I0BRVsz8XkzL7UWsrIOMJDfPx2lnnFRr4GBCYRFSX/5w8GzCU4lsJ mxnkFW7yIJN7IZxMeAsAlojFRHr0gIFy1mY/oCRmgdVtO/PXIlpTNFHO9Fd5sajvs43m R+h7svcz5SNp8WPx184WIrXDnqfhzrurYQystXGD3UVL1pdQHOESEimR6AQ439K8YXF+ 83MvGw/fk71bVz/wETc+815rmtwKxwIN09F2kZkXtrKUGi4nZNJN5FSsy7h1tu4K95D3 SwG6yqaGqVLPGI0Y+Ff/QDolg3gVgvbfrtfoO+MUKBKYRWube3aoarlGjafiZVTJX0WO mOHA== 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=N5XoULSc/RpQ9HrHY5fnRm6QXy+f1wK2MKhKB2z42Ho=; b=xkMpbsP7mMpmdKuS5sz2dWfqNZqIdkHwX7lGUdGywlaMT2Ev7CZp+f199C4HRhJTnp tKlAv/1yHrkpJL+yG3ABTuk7Wj8pVNnWcO676JdqTs9AqTNLwQxF5Uaxvy7kkfsKKfxp C2bDDcXtmhQXpTEgMswFoTgrcIypgA9wIJp5eg0nMrlsTH8EZ0gILI4ppVB1SbhNrSZw 8NY2Z196m4Y2hl7FuGpOLUkDo4SJH/NBXl51iyf5qqusTysQqOwKKtD9Q14DgdQgv4Gn mjGkEaqmNp1Qlnz/k7XpN8NDKH5gjlpEo3LvOyB3Ykeq8XaNZCV4w2oQ9fmGGNT3DhmZ 7khw== X-Gm-Message-State: AFqh2krtnCcwBnCNhnhHIZ8Lqk6qx6fBFgOTqUuoDZX2sBPJ4VjzfcUb bLvP9nR5C1aSQNd8zvQp03+ZB2XksvQ= X-Google-Smtp-Source: AMrXdXs2M4NPoDHvmWQuKFmaUQvTlfitkHoYFhrvxlfUzFnZj0ByORsP444/44X0nbdOXo0/JDpYzA== X-Received: by 2002:a92:d284:0:b0:30e:f15d:4bed with SMTP id p4-20020a92d284000000b0030ef15d4bedmr4232542ilp.30.1674006329074; Tue, 17 Jan 2023 17:45:29 -0800 (PST) Received: from washu-v4.home.cox-buday.com (c-174-51-139-101.hsd1.co.comcast.net. [174.51.139.101]) by smtp.gmail.com with ESMTPSA id p32-20020a056638192000b0039e89ea68f9sm7889250jal.135.2023.01.17.17.45.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Jan 2023 17:45:28 -0800 (PST) From: Katherine Cox-Buday Date: Tue, 17 Jan 2023 18:45:08 -0700 Message-Id: <20230118014510.19320-24-cox.katherine.e@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230118014510.19320-1-cox.katherine.e@gmail.com> References: <20230118014510.19320-1-cox.katherine.e@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2607:f8b0:4864:20::12d; envelope-from=cox.katherine.e@gmail.com; helo=mail-il1-x12d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1674006439; a=rsa-sha256; cv=none; b=nVGiWJDQYrFkIHS6ytuNY/Jzzb9q0e9yR0P4wBMUORMHviqS5v5Qm3qUXNOxRQo3Lw5pPv K23HLQlGPOnU4CjO3QpPrgYHFQ0Vq/+B5bsu/nApGB/oqiqDisHczlW7cyBWwIT8gCaOkH opbmjdctGoYs6a1MW9HGGd++ke3Cve0yjyIxhZ1TyWgd6zzp1iy1ESjTinq6cJzZZbzI0i m4OaE6nc68iPNlMiJeeRnEY3wJpCTkVlY2vFd+ioUwZkDjtqW8IFDP8Zng1DmxKRmQ9z4P eeAmqRAMhpaEwCco9CCvWmEGtBN0AEq0DPAiJOh5uN8tStOoV4PZYhb2vToYbA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XXzq2gkW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1674006439; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=N5XoULSc/RpQ9HrHY5fnRm6QXy+f1wK2MKhKB2z42Ho=; b=GKNu4+nc7ds9sCN7CI2qB2rbuf1JbDqWigKWsbQh+1DIYXGBDoPLKOERhBJWS5reFxd5+d beEg/hUnutws34vqpIeQfo4WDNSxsL1U32lNYK3tueaQETR/PlQf0Lq9uS26T22W1j90p9 ZLLKLjVgoRhdrf2226KFGr+Wi9ND+ZnvjBHlEn1YEUfjsoyfRw2RkM6Fm3F3DMcXFMBSd1 Rro/s/q+3T5G7Fv7bwZFmoX40dgyOxEgBnGJ8/JsRMJAb6lGJJ5F2UTLEH2dvSThnf4wcE YPwYbHRZXpe+bJzMSRHB8rs6dTLKLqU7oSQXv03bidLbPFvWD+ycv/p4v1FGkw== X-Spam-Score: 5.07 X-Migadu-Queue-Id: 9321E44AAE Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=XXzq2gkW; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-Migadu-Scanner: scn0.migadu.com X-Migadu-Spam-Score: 5.07 X-TUID: n4UcA3jNQsMP * gnu/packages/golang.scm (gofumpt): New variable. --- gnu/packages/golang.scm | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/gnu/packages/golang.scm b/gnu/packages/golang.scm index 97f1753f42..40b6cf4a62 100644 --- a/gnu/packages/golang.scm +++ b/gnu/packages/golang.scm @@ -9868,6 +9868,74 @@ (define-public go-go-uber-org-multierr "@code{multierr} allows combining one or more Go errors together.") (license license:expat))) +(define-public gofumpt + (package + (name "gofumpt") + (version "0.4.0") + (source (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/mvdan/gofumpt") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "13ahi8q1a9h4dj6a7xp95c79d5svz5p37b6z91aswbq043qd417k")) + (modules '((guix build utils))) + (snippet `(let ((fixed-version (string-append ,version + " (GNU Guix)"))) + ;; Gofumpt formats Go files, and therefore modifies + ;; them. To help the developers diagnose issues, it + ;; replaces any occurrence of a `//gofumpt:diagnose` + ;; comment with some debugging information which + ;; includes the module version. In the event gofumpt + ;; was built without module support, it falls back + ;; to a string "(devel)". Since our build system + ;; does not yet support modules, we'll inject our + ;; version string instead, since this is more + ;; helpful. + (substitute* "internal/version/version.go" + (("^const fallbackVersion.+") + (format #f "const fallbackVersion = \"~a\"~%" + fixed-version))) + ;; These tests rely on `//gofumpt:diagnose` comments + ;; being replaced with fixed information injected + ;; from the test scripts, but this requires a binary + ;; compiled as a Go module. Since we can't do this + ;; yet, modify the test scripts with the version + ;; string we're injecting. + (delete-file "testdata/script/diagnose.txtar") + (substitute* (find-files "testdata/script/" + "\\.txtar$") + (("v0.0.0-20220727155840-8dda8068d9f3") + fixed-version) + (("(devel)") + fixed-version) + (("v0.3.2-0.20220627183521-8dda8068d9f3") + fixed-version)))))) + (build-system go-build-system) + (arguments + `(#:import-path "mvdan.cc/gofumpt" + #:go ,go-1.19)) + (native-inputs (list go-gopkg-in-errgo-fmt-errors)) + (propagated-inputs (list go-github-com-pkg-diff + go-github-com-kr-text + go-github-com-kr-pretty + go-golang-org-x-tools + go-golang-org-x-sys + go-golang-org-x-sync + go-golang-org-x-mod + go-github-com-rogpeppe-go-internal + go-github-com-google-go-cmp-cmp + go-github-com-frankban-quicktest)) + (home-page "https://mvdan.cc/gofumpt/") + (synopsis "Formats Go files with a stricter ruleset than gofmt") + (description + "Enforce a stricter format than @@code{gofmt}, while being backwards compatible. +That is, @@code{gofumpt} is happy with a subset of the formats that +@@code{gofmt} is happy with.") + (license license:bsd-3))) + (define-public unparam (package (name "unparam") -- 2.38.1