unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Pluim <rpluim@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: Randy Taylor <dev@rjt.dev>,
	"O'Brien, Will" <will.08rien@gmail.com>,
	74786@debbugs.gnu.org
Subject: bug#74786: [PATCH] Add custom args to test compile step
Date: Wed, 11 Dec 2024 16:58:03 +0100	[thread overview]
Message-ID: <87wmg643g4.fsf@gmail.com> (raw)
In-Reply-To: <86wmg62pfs.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 11 Dec 2024 17:45:59 +0200")

>>>>> On Wed, 11 Dec 2024 17:45:59 +0200, Eli Zaretskii <eliz@gnu.org> said:

    >> From: "O'Brien, Will" <will.08rien@gmail.com>
    >> Date: Wed, 11 Dec 2024 10:18:04 +0000
    >> 
    >> First time trying to contribute here, so apologies for any wrong doing.  I
    >> haven't signed FSF papers; would be happy to but believe this may fit in to
    >> tiny patch territory.

    Eli> It does.  But you may wish to start the paperwork regardless, so we
    Eli> could accept your future contributions without limitations.  Let me
    Eli> know if you want me to send you the form and instructions.

    >> This is a feature request to pass custom flags down to the test compile
    >> step in go-ts-mode-test-... functions.  Specifically I wanted to
    >> add the coverprofile argument to unit test invocation.
    >> 
    >> The attached patch seems to do the trick for me.

    Eli> Thanks.

    Eli> Randy, any comments or suggestions?

Iʼm not Randy, but:

    >> +(defun go-ts-mode--get-test-args ()
    >> +  "Return the test args.
    >> +This function respects the `go-ts-mode-test-args' variable for
    >> +specifying test args, such as adding coverage file."
    >> +  (if go-ts-mode-test-args
    >> +      (string-join go-ts-mode-test-args)
    >> +    ""))
    >> +

This entire function is not needed, since

(string-join nil) => ""

    >>  (defun go-ts-mode--compile-test (regexp)
    >>    "Compile the tests matching REGEXP.
    >>  This function respects the `go-ts-mode-build-tags' variable for
    >>  specifying build tags."
    >> -  (compile (format "go test -v %s -run '%s'"
    >> +  (compile (format "go test %s -v %s -run '%s'"
    >> +                   (go-ts-mode--get-test-args)
    >>                     (go-ts-mode--get-build-tags-flag)
    >>                     regexp)))
    >> 

so you could just inline the `string-join' here.


Robert
-- 





  reply	other threads:[~2024-12-11 15:58 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-11 10:18 bug#74786: [PATCH] Add custom args to test compile step O'Brien, Will
2024-12-11 15:45 ` Eli Zaretskii
2024-12-11 15:58   ` Robert Pluim [this message]
2024-12-11 16:31     ` O'Brien, Will
2024-12-11 16:30   ` O'Brien, Will
2024-12-11 17:10     ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87wmg643g4.fsf@gmail.com \
    --to=rpluim@gmail.com \
    --cc=74786@debbugs.gnu.org \
    --cc=dev@rjt.dev \
    --cc=eliz@gnu.org \
    --cc=will.08rien@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).