From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.bugs Subject: bug#57884: [PATCH] Flymake backend using the shellcheck program Date: Mon, 19 Sep 2022 09:33:54 +0200 Message-ID: <87h713es2l.fsf@gmail.com> References: <87a66yaqwc.fsf@gmail.com> <83bkre0w4m.fsf@gnu.org> <871qs9c3er.fsf@gmail.com> <87zgewdhhd.fsf@posteo.net> <87fsgoyi0l.fsf@gmail.com> <87sfko4zjq.fsf@posteo.net> <87edw8n71p.fsf@gmail.com> <8735co4wxx.fsf@posteo.net> <878rmgcw2e.fsf@gmail.com> <87h7148mba.fsf@posteo.net> <87sfko755f.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35878"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: Eli Zaretskii , 57884@debbugs.gnu.org, Stefan Kangas To: Philip Kaludercic Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 19 09:36:47 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oaBKh-00095D-0d for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 09:36:47 +0200 Original-Received: from localhost ([::1]:48628 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oaBKf-0005Y9-MR for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 19 Sep 2022 03:36:45 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oaBJ5-0005Tj-SB for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 03:35:16 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:53066) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oaBJ0-0001vT-NU for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 03:35:07 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oaBJ0-0004pP-Af for bug-gnu-emacs@gnu.org; Mon, 19 Sep 2022 03:35:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Augusto Stoffel Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 19 Sep 2022 07:35:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57884 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 57884-submit@debbugs.gnu.org id=B57884.166357284618493 (code B ref 57884); Mon, 19 Sep 2022 07:35:02 +0000 Original-Received: (at 57884) by debbugs.gnu.org; 19 Sep 2022 07:34:06 +0000 Original-Received: from localhost ([127.0.0.1]:52144 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBI5-0004oC-Kc for submit@debbugs.gnu.org; Mon, 19 Sep 2022 03:34:05 -0400 Original-Received: from mail-ed1-f52.google.com ([209.85.208.52]:45976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oaBI2-0004nf-1r for 57884@debbugs.gnu.org; Mon, 19 Sep 2022 03:34:03 -0400 Original-Received: by mail-ed1-f52.google.com with SMTP id m3so20141855eda.12 for <57884@debbugs.gnu.org>; Mon, 19 Sep 2022 00:34:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date; bh=//6fvi3tNG6Oz11pa4AOCwrHjDiUUhNgeT6Tlw0lcsE=; b=T1peftUc9ubFeHKyoOQNRWWmdqd3vTgxpEWdhxe2dOa5ssHupCj7hdLPzE3vlipEjP 98hhm13TX/2CKduHB/1q2K4sqq4cMC6bQ6fjs2K7JGQHd/Rw52yMMu9XKGcktmMg2GTb fKuIuAwKiw7sEZSb0yohzHCs4Ehk9qvlbzUuoVu2srkaEmZpyaqwWVIpR2uUa/0dqIrH cO8+I27hjpjXBm4iik88irL7zDMJqaCmEyerhje9r4TuG/fyBIKJtnCQ3BnAu/hfaASW +EIctGIXd3LIE57mFqeICjEFrt00C6fmTj3A9e1PAH52PHpOcoPbV1sUR7sPRGyAzaIj jjzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date; bh=//6fvi3tNG6Oz11pa4AOCwrHjDiUUhNgeT6Tlw0lcsE=; b=lqRdu5KZByBkWtyQyaOeVxK42lEcSeyqyW1WiRijlQcac9rn36VHJdDdw7OxlRaTyd NmV7gcLkY/2O6GfkBNvX5FfVdPcmJHOtfzlItR4oatZ9mmKQoXZpWgL1tLFDmRu5t3RZ e1ZUdqtgV7Cm6Yx3RZqYNZw1enr1dFnylVastOlYrqJ0ieBqRQaIuU18W2jdhkX3+4lk +fWpG7NdEtuQZ0Xyr0A10RllzV85fJYbf7JZ1MmHg4dVCjkcN4d5G4BZgwM1gDc5p5fj BzdDlBbUuqdE4Kija+aWXP47L2nmFJsn1TplKVz0R6rF+1G8n3OAQ/3nIhilWmN+PEAj kyTA== X-Gm-Message-State: ACrzQf2ckO6l8RLtaukqW/BO1rssMeqJPB+5CS4/ODWa+6gk/QDqNhA/ 0vpxdy8b3sZigQD1+wxF+3o= X-Google-Smtp-Source: AMsMyM5Z4E/t1iLMQ0VLu1HtpagKL1Tt0W7izUzSmg5xmtiftqHcoT6n+I3D+RIT7CtiJLhOcHAecA== X-Received: by 2002:aa7:d617:0:b0:44e:d2de:3fe1 with SMTP id c23-20020aa7d617000000b0044ed2de3fe1mr14747710edr.104.1663572836092; Mon, 19 Sep 2022 00:33:56 -0700 (PDT) Original-Received: from ars3 ([2a02:8109:8ac0:56d0::8510]) by smtp.gmail.com with ESMTPSA id z15-20020a170906434f00b007413360a48fsm4031246ejm.50.2022.09.19.00.33.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 00:33:55 -0700 (PDT) In-Reply-To: <87sfko755f.fsf@posteo.net> (Philip Kaludercic's message of "Sun, 18 Sep 2022 21:18:36 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:243036 Archived-At: On Sun, 18 Sep 2022 at 21:18, Philip Kaludercic wrote: > Philip Kaludercic writes: > >>> Anyway, I rewrote the backend to use the JSON output of shellcheck, >>> which has the advantage that it provides the end position of each >>> diagnostic, so Flymake doesn't have to guess it (which is by nature >>> sometimes inaccurate). Let me know what you think. >> >> LGTM, but I haven't tested it yet. > > I just tried it out and it behaves the way you advertised it. Okay, so for whoever feels inclined to merge this, please consider the patch in my message of Sun, 18 Sep 2022 21:38:17 +0200. > BTW, this diff describes the changes required if you were to pull out > the sentinel definition into a named function: > [...] > I still don't think it looks that bad, but I don't insist on it. I still don't understand the motivation for this. Closures are the perfect tool for this job, and you seem to be just reinventing them. If I wanted to create a helper function (which I don't really find necessary from the code organization perspective in this case, although it might well be in the proselint case), then I'd pass this as :sentinel argument to make-process: (lambda (proc _event) (helper-function proc source report-fn))