GNU bug report logs - #70939
[PATCH] Add commands to run unit tests in go-ts-mode

Previous Next

Package: emacs;

Reported by: Ankit Gadiya <ankit <at> argp.in>

Date: Tue, 14 May 2024 14:06:01 UTC

Severity: wishlist

Tags: patch

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Randy Taylor <dev <at> rjt.dev>
To: Ankit Gadiya <ankit <at> argp.in>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 70939 <at> debbugs.gnu.org
Subject: bug#70939: [PATCH] Add commands to run unit tests in go-ts-mode
Date: Thu, 16 May 2024 02:32:42 +0000
On Wednesday, May 15th, 2024 at 00:55, Ankit Gadiya <ankit <at> argp.in> wrote:
> 
> 
> > This is going to need a commit log entry. See the "Commit messages" section
> 
> > in the CONTRIBUTING file.
> 
> 
> I missed it earlier, will add it.
> 
> > I'm undecided on the keybinds. I think I would prefer something like:
> > C-c t p
> > or
> > C-c C-t p
> > so we can keep test-related things together.
> 
> 
> Keeping it under C-c C-t makes sense to me. How about this:
> 
> C-c C-t t - go-ts-mode-test-function-at-point
> C-c C-t p - go-ts-mode-test-package

Sounds good.

I'm wondering If C-c C-t t should be f for "function" but let's leave it as t for now. I do like the t for test which is nice and simple. Decisions, decisions...

> 
> > I haven't tried this out yet, but here are some comments (mostly nits)
> > after a quick look:
> > 
> > In NEWS, sentences should be separated by 2 spaces.
> > 
> > +The 'go-ts-mode-test-function-at-point' command runs unit test at
> > ^the
> > +point.
> > 
> > +This function respects `go-build-tags' buffer-local variable
> > ^the
> > 
> > + "Compiles the tests matching REGEXP.
> > ^Compile
> > 
> > +If the point is anywhere in the test function, that function will be
> > +tested.
> > ^ run (keeps it consistent with the next sentence)
> > 
> > + "Run all the unit tests under current package."
> > ^the
> 
> 
> Thanks, I'll update this along with keybinding changes.

Great. I'll try to give this a try tomorrow.

Eli, is there a convention regarding local variables?
In the patch we have:
+  (if (local-variable-p 'go-build-tags)
+      (format "-tags %s" go-build-tags)
+    ""))

Should that local variable be prefixed with go-ts-mode, or is it fine as is?

> 
> --
> Ankit




This bug report was last modified 309 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.