From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id +NMKC/4Jo2bOAAAAe85BDQ:P1 (envelope-from ) for ; Fri, 26 Jul 2024 02:29:18 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:4876::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2.migadu.com with LMTPS id +NMKC/4Jo2bOAAAAe85BDQ (envelope-from ) for ; Fri, 26 Jul 2024 04:29:18 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=Da0rzzmu; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1721960958; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: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=h6jrgzSsQUkjKoli0PsInKBzOsBvT2ns8B7JSne8ZUk=; b=uDAWgiqOpjzuk7v++jWGmJulChs0yOBiLL5VF/zKfrSt9lGBJCBNSSxg5fehc+QyWI1Nv0 cYUP2TTfY2OTFNnp5gR7JveD+CGwQLE+TUTdok7/ZRwoGWqO/K880kiZQ/o7OfGH/H7p6j KmWKiNvY7c3b+rOw/1ZigviqdyfVKgIT91UNc8fQSRaP5CUPya01Ck3h03IviUwwq416R3 ZUub2/xEk5t27cxt951Sgjhg03MZXsZQyxjt6L/sgtry/69O4ft2zxHogH9YgHvZO9k4Kq jCRmoPBbKP1xuDKr3H6rveOQ7jDW+QT6IVaaLMs/6LCJaflgfdZGebqz/5GQoA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20230601 header.b=Da0rzzmu; 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"; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1721960958; a=rsa-sha256; cv=none; b=N8XpHuYaBf8mXGIyvkSSUYmT1TjHcuIDGSAhEZlp/Geg+dfsb8Ic82qL/dYzIbiRdgkvv/ U3KVlF/Xo/kr4tDCZp2/AUT7oyQ47JQUPD1oGbiNzwCLuSUkmL1sQ9GbYkNK3/SXlCAL4W z/AcpGpmJtaTKLpZFyaoRMPeECuu9+9A3OewwhoBKMnxrf8YZtNXbejjuyiNhiaOUFQOia FiXPhpBWhC5xd4ErTFc9yZA9yHduOOCycFiPGGuJJv0XcDd1AWup6okMpySe6W9X1xPs+j B8+5x6tXm1nsVMugQUJd8nWGoQid1JTUZZJ98zc8cZZvakMYgvyD4GkcbRMHDg== 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 BEABE73751 for ; Fri, 26 Jul 2024 04:29:17 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sXAhV-0000mx-Cz; Thu, 25 Jul 2024 22:28:57 -0400 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 1sXAhT-0000kP-72 for guix-patches@gnu.org; Thu, 25 Jul 2024 22:28:55 -0400 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sXAhS-0005vl-VV for guix-patches@gnu.org; Thu, 25 Jul 2024 22:28:54 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sXAha-0001zg-0g for guix-patches@gnu.org; Thu, 25 Jul 2024 22:29:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#71697] [PATCH v5 3/3] scripts: lint: Add hint for checker typo. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Fri, 26 Jul 2024 02:29:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71697 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: Simon Tournier Cc: Josselin Poiret , Mathieu Othacehe , Ludovic =?UTF-8?Q?Court=C3=A8s?= , Tobias Geerinckx-Rice , Florian Pelz , 71697@debbugs.gnu.org, Christopher Baines , Matthew Trzcinski Received: via spool by 71697-submit@debbugs.gnu.org id=B71697.17219608897602 (code B ref 71697); Fri, 26 Jul 2024 02:29:01 +0000 Received: (at 71697) by debbugs.gnu.org; 26 Jul 2024 02:28:09 +0000 Received: from localhost ([127.0.0.1]:38172 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXAgj-0001yY-62 for submit@debbugs.gnu.org; Thu, 25 Jul 2024 22:28:09 -0400 Received: from mail-pl1-f172.google.com ([209.85.214.172]:53529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sXAgg-0001y3-A4 for 71697@debbugs.gnu.org; Thu, 25 Jul 2024 22:28:07 -0400 Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1fc491f9b55so1785965ad.3 for <71697@debbugs.gnu.org>; Thu, 25 Jul 2024 19:27:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1721960812; x=1722565612; darn=debbugs.gnu.org; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=h6jrgzSsQUkjKoli0PsInKBzOsBvT2ns8B7JSne8ZUk=; b=Da0rzzmu8sEexnIxuqlC3i0fdLoOd82PKJmbx0EV68QT2duBox6uqt0hrjtEk2CKZp gcNTk+Kw3/CGN7gZQC5hYc/QhbV4ff+YveXe7OJnOhTkTbOa0sTupkLbI2yk1+lwcF2g bAoGykBfdPs3q3z6X4ZqfLYhzSQzxTSPOCM3UDAOsapf8VNVKB8liQxb462zBrMeGRwf x27T1dxqKpSv3ExslLDCGaHyUs2i0aVhpdsvYESIo3HaQmd5fooI2BDY+vdm7TKBGDz6 W9yJB5txqhziXaMsS27NmkabXjd+G4igxb0Gt4Fn+i/ntIAN+5FRwMzg9xBXvcYfTZz8 XD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721960812; x=1722565612; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=h6jrgzSsQUkjKoli0PsInKBzOsBvT2ns8B7JSne8ZUk=; b=RaUKKZm9Sqg6PY+TKXneEJnvAyJq69/Rv8xSWXMXd6D59SH4tLHE3wvDn5Wd7lvpyO cfsFgHgD1H+kXFL7SLTogO+nrz3ZeawzhSWFC05Fg+/t1V1COtF3nR7X5BI6+GkXQH7Z Nkcd8aQr25nQ+mSZlKMxjccYQ3JwSFjxGn9RadPWvIXM+G8lJLYKfEDcwVFDI+IN2cjP g7i66hAAmrsUJ1Xr8HaIxlFIs6BkZ6uwbyZ80d5Qx43w8C64FiFpXY6/rgSxKtQzGciB ACQ4ESEIhcyyox9A5Uqg+UljmhHrk3JehIoGyfQp//W6RCWBPAad+Ak/6wMFVuZRqVZ7 YZqQ== X-Forwarded-Encrypted: i=1; AJvYcCWxulQWGbY5lCQHAmsPYN/Mfd5AcCwrBFcnuJh/F+PsK1gl3cHrEdSeC/T8/FFcM2yzP0dj+bWa2M4ES7LIMBwTI8Ej1UA= X-Gm-Message-State: AOJu0YwcilAALv2RaV00SlD/HlF8TQSxdNcUqSxooT/E3bjvefLLJuH5 ZXHOmVTBFLjVa2i9fjiUBQsSugaNvlfCLi8vAJiOP+pldzqH0DEJ X-Google-Smtp-Source: AGHT+IHuBoJXil45+p89D5nyyE8TkRMiMfxeBKdpVtsBy2cd0EoaYF0bSaVkXENETlC6O3W2JQxv8w== X-Received: by 2002:a17:902:d486:b0:1fd:9420:104f with SMTP id d9443c01a7336-1fed92ca3ddmr40784175ad.53.1721960812313; Thu, 25 Jul 2024 19:26:52 -0700 (PDT) Received: from x200 ([133.106.253.71]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1fed7d25fafsm20974905ad.108.2024.07.25.19.26.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jul 2024 19:26:51 -0700 (PDT) From: Maxim Cournoyer References: <155dbefb7074dd3c77a1642b2aa6e18bb4e9df7b.1721411923.git.zimon.toutoune@gmail.com> Date: Fri, 26 Jul 2024 11:26:42 +0900 In-Reply-To: <155dbefb7074dd3c77a1642b2aa6e18bb4e9df7b.1721411923.git.zimon.toutoune@gmail.com> (Simon Tournier's message of "Fri, 19 Jul 2024 20:38:10 +0200") Message-ID: <87sevwvqfx.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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 X-Spam-Score: 4.08 X-Migadu-Queue-Id: BEABE73751 X-Migadu-Scanner: mx10.migadu.com X-Migadu-Spam-Score: 4.08 X-TUID: I+wIi6fop7zb Hi, Simon Tournier writes: > > Change-Id: I432c5b0570d2f413b59c2296666f3a4e5fb8c64c > --- > guix/scripts/lint.scm | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/guix/scripts/lint.scm b/guix/scripts/lint.scm > index 2df0cba948..f4aa394686 100644 > --- a/guix/scripts/lint.scm > +++ b/guix/scripts/lint.scm > @@ -31,6 +31,7 @@ (define-module (guix scripts lint) > #:use-module (guix packages) > #:use-module (guix lint) > #:use-module (guix ui) > + #:use-module ((guix utils) #:select (string-closest)) > #:use-module (guix store) > #:use-module (guix scripts) > #:use-module (guix scripts build) > @@ -147,7 +148,15 @@ (define (option-checker short-long) > ((short long) long))))) > (for-each (lambda (c) > (unless (memq c checker-names) > - (leave (G_ "~a: invalid checker~%") c))) > + (let* ((name (symbol->string c)) > + (checkers (map symbol->string checker-names)) > + (hint (string-closest name checkers > + #:threshold 3))) > + (report-error (G_ "~a: invalid checker~%") name) > + (when hint > + (display-hint > + (format #f (G_ "Did you mean @code{~a}?~%") hint))) > + (exit 1)))) > names) > (alist-cons option-name > (filter (lambda (checker) Patch 1 and 3 LGTM. Patch 2 I'd rather wait to see if we can think about a better option to match the original use case (exclude the archival checker from 'guix lint' for privately developed packages). I remember that perhaps the simplest thing for that would be to add a nonfree license to (guix licenses); Guix users developing nonfree software (ugh) could mark it as such and the lint code could disable archival for such licensed packages (or maybe more generally if the license used is unknown to Guix). -- Thanks, Maxim