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: Tue, 28 May 2024 02:30:18 +0000
On Friday, May 24th, 2024 at 22:35, Randy Taylor <dev <at> rjt.dev> wrote:
> 
> On Saturday, May 18th, 2024 at 05:54, Ankit Gadiya via "Bug reports for GNU Emacs, the Swiss army knife of text editors" bug-gnu-emacs <at> gnu.org wrote:
> 
> > [...]
> > 
> > I'm submitting an updated Patch with the following changes:
> > * Add commit log
> > * Fix the text formatting.
> > * Update the keybindings to use the C-c C-t prefix.
> > * Improve regexp matching to be more strict.
> > * Define =go-ts-mode-build-tags= variable in the module and use it in the test
> > functions.
> > 
> > --
> > Ankit
> 
> 
> Thanks.
> 
> Sorry for the delay in reviewing, I've been having internet troubles since last Friday. I'll take a look at this next week.
> 
> A few quick things I noticed on a glance:
> 
> + (let* ((node (go-ts-mode--find-defun-at start))
> + (name (treesit-defun-name node))
> 
> Indentation is off on the name line - looks like a TAB was used? Should only be spaces everywhere. Double check the rest is OK.
> 
> +region. It is bound to 'C-c C-t' in 'go-ts-mode'.
> ^ C-c C-t t
> 
> +package of the current buffer. It is bound to 'C-c C-p' in 'go-ts-mode'.
> ^ C-c C-t p
> 
> + "List of go build tags for the test commands."
> ^ Go
> 
> + "Return a list with names of all defuns in the range."
> We should probably say what the range actually is (START to END) - not sure if we have a convention for that wording already.

A few more nits:
+  "Return compile flag for build tags.
          ^ the

+This function respects `go-ts-mode-build-tags' variable for specifying
                       ^ the

+  "Return a list with names of all defuns in the range."
                      ^ the

Indentation is also off in go-ts-mode-test-function-at-point.

When we run C-c C-t t outside of a function, we get:
go test -v  -run '^nil$'
Should we maybe not bother running anything at all? What do you think?
Do we know how other packages behave under similar circumstances?




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.