From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#70260: [PATCH] Flymake support for rust-ts-mode (clippy-driver) Date: Tue, 9 Apr 2024 22:41:58 +0300 Message-ID: <1e63d72e-ee49-47a2-8b7a-7f5b04cd43b9@gutov.dev> References: <28264769-159f-40b2-b798-bf0b3f5d7ee1@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26778"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 70260-done@debbugs.gnu.org To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Apr 09 21:43:08 2024 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 1ruHN5-0006nW-KG for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 Apr 2024 21:43:08 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ruHMu-0005NE-Lv; Tue, 09 Apr 2024 15:42:57 -0400 Original-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 1ruHMs-0005Mb-MG for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 15:42:54 -0400 Original-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 1ruHMs-0005SF-D9 for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 15:42:54 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ruHN0-0004yf-Hy for bug-gnu-emacs@gnu.org; Tue, 09 Apr 2024 15:43:02 -0400 Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Tue, 09 Apr 2024 19:43:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 70260 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Mail-Followup-To: 70260@debbugs.gnu.org, dmitry@gutov.dev, dmitry@gutov.dev Original-Received: via spool by 70260-done@debbugs.gnu.org id=D70260.171269173918973 (code D ref 70260); Tue, 09 Apr 2024 19:43:02 +0000 Original-Received: (at 70260-done) by debbugs.gnu.org; 9 Apr 2024 19:42:19 +0000 Original-Received: from localhost ([127.0.0.1]:51589 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruHMJ-0004vw-3L for submit@debbugs.gnu.org; Tue, 09 Apr 2024 15:42:19 -0400 Original-Received: from fhigh2-smtp.messagingengine.com ([103.168.172.153]:59431) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ruHMF-0004vN-To for 70260-done@debbugs.gnu.org; Tue, 09 Apr 2024 15:42:17 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailfhigh.nyi.internal (Postfix) with ESMTP id 15DD411400EC; Tue, 9 Apr 2024 15:42:02 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Tue, 09 Apr 2024 15:42:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm1; t=1712691722; x=1712778122; bh=pyJywQKjNLiOKU1QMCSpQPSlpVeiv3o58yFb+u8f6t4=; b= YrALxOQAV9GjKnTSWp7DBDFr8rC39UTddHsy7NdI1UHDQW7Pllb45yqiIM4OKOTV wKrdKUVl13EWhIBEGm9Ax5shP57r3IkAeYiELvtgtUgnofgyrbRTfvfq1yCYj2CY uRyBSGdaPOUJ3zCpWo7x9gfA2yu7kLtFzkwEPlL1nsFIpRSVDG/X67CMCcNXLQXl vg+5S9xjZZFMLvHyJvwUsKWK+O/9KGl9CBnlndoqKt7alvIktM+Crd8hxXjzeHU4 lae9YPA7dZ+IX9qTX15A3sWjZF4J3c9nVj7OK5h1DJEgDtODhs3MpXepZKYS1+Lk RVNl0jcswv+9HyYtDHGHqg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1712691722; x= 1712778122; bh=pyJywQKjNLiOKU1QMCSpQPSlpVeiv3o58yFb+u8f6t4=; b=p RiJ3riZEU8K5tpmbrST9wolPLSnF2XI5KBKs+0zTooc+qSA315Ae3mEs0tiEiHMP TFKqvkb/qTo95Hnj19DlxYk3GCNCFUpbFVMMa61L9sqFZE2I5WfEohnOnPuh19G2 2Nx/HlrsUqcGUjVPqi71tiSMaRDPAzcUVdo/KTziM4Q/2xA+FgxkZ/N3p5NpqKVR uzdYnu1QvgjAPXFC4VkNa7zS2UTVX1Fxs08Om58lfepQNJ1MQDp3c//rjjMHDmlo Fi9BoeVOOh9W1XakNl+NFIe6sW48xZkZsAnP5yzIxKAz8oXd7ZTqtWFpGDywU/J2 P1S3MJD+QEc7cCe7b1w/w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudehgedgudduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfevfhfhjggtgfesth ejredttddvjeenucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehg uhhtohhvrdguvghvqeenucggtffrrghtthgvrhhnpeetudeljeegheetgfehgeejkeeuhe dvveeikeeufedtvddtveefhfdvveegudejheenucevlhhushhtvghrufhiiigvpedtnecu rfgrrhgrmhepmhgrihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvh X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Apr 2024 15:42:00 -0400 (EDT) Content-Language: en-US In-Reply-To: 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:283009 Archived-At: Version: 30.1 On 09/04/2024 05:42, Randy Taylor wrote: > On Sunday, April 7th, 2024 at 20:26, Dmitry Gutov wrote: >> >> >> Minor fix and a TODO comment for the "cargo clippy" case. >> >> On 07/04/2024 19:42, Dmitry Gutov wrote: >> >>> X-Debbugs-Cc: Randy Taylor dev@rjt.dev >>> >>> Hi Randy and others, >>> >>> Here's a patch adding rust-ts-mode <-> flymake-mode integration using >>> clippy. >>> >>> Feedback welcome. > > Thanks for working on this. Thanks for taking a look. I imagine it won't be used for larger projects, edited assisted by LSP - LSP clients have their own Flymake integration. But I found it useful a few months ago when doing some leetcode exercises. > I'm not really familiar with flymake integration, but this > looks good to me. I have a few nits below. > > +(defcustom rust-ts-flymake-command '("clippy-driver" "-") > + "The external tool that will be used to perform the syntax check. > ^^^^^^^^^^^^^^^^ > maybe just "the check"? > Or something similar, since more is being done than just syntax checking. > > +This is a non empty list of strings, the checker tool possibly followed > ^^^^^^^^^ ^ > non-empty? A colon would work well here. Thank you. This was actually copied from some exiting flymake backends, but they could use such edits as well. > +(defvar rust-ts--flymake-proc nil) > Should this be defvar-local? Not necessarily - there would usually be only one simultaneous check running, and the pointer to the associated buffer is stored in the closure. > + ;; Flymake > ^ > A period at the end would make me happy :). Sure. Pushed to master as ccced8c3e43, closing.