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


Message #47 received at 70939 <at> debbugs.gnu.org (full text, mbox):

From: Ankit Gadiya <ankit <at> argp.in>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: dev <at> rjt.dev, 70939 <at> debbugs.gnu.org
Subject: Re: bug#70939: [PATCH] Add commands to run unit tests in go-ts-mode
Date: Sat, 18 May 2024 15:24:14 +0530
[Message part 1 (text/plain, inline)]
> It's okay to support buffer-local values, but using the value of the
> variable will do that automatically; you don't have to verify it has a
> local binding.  What I don't understand is why does your code _reject_
> global bindings.  If some user wants to set up a global value for some
> reason, or have a default global value and special local values in
> some cases, why should we prevent that?

You are absolutely right, now I realize that local-variable-p is overly
conservative. Since I didn't define the variable in the first place I had to do
the check and even then boundp would have been better.

> > But now I'm thinking maybe it makes sense to add it as defvar-local under the
> > go-ts-mode? Please guide me with what will be the correct way to implement it.
>
> Yes, defvar-local could be what we want.  But I first would like to
> understand what is special about this variable that it should be
> buffer-local.

With the improved understanding, I believe defcustom would be better for the
variable. Then I don't even need the the boundp check since the variable is
always present and it can be replaced by just the non-nil check instead.

As an improvement, I'm also changing the variable-type to a list of strings
instead of a single comma separated string.

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
[0001-Add-commands-to-run-unit-tests-in-go-ts-mode.patch (text/x-patch, attachment)]
[sample_test.go (text/x-go, attachment)]

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.