From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eshel Yaron via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#60805: [PATCH] Extend go-ts-mode with command to add docstring to function Date: Sat, 21 Jan 2023 08:48:48 +0200 Message-ID: References: <87sfgdtga2.fsf@thornhill.no> <875yd4njdc.fsf@thornhill.no> <87r0vpv7fp.fsf@thornhill.no> <87a62dkkj5.fsf@thornhill.no> Reply-To: Eshel Yaron Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4448"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Evgeni Kolev , Eli Zaretskii , 60805@debbugs.gnu.org, Theodor Thornhill To: Randy Taylor Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jan 21 07:49:12 2023 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 1pJ7gd-0000wX-SC for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 21 Jan 2023 07:49:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pJ7gY-0007c5-Kq; Sat, 21 Jan 2023 01:49:06 -0500 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 1pJ7gU-0007bZ-AC for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 01:49:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pJ7gU-0005C7-2C for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 01:49:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pJ7gT-0000Ea-St for bug-gnu-emacs@gnu.org; Sat, 21 Jan 2023 01:49:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eshel Yaron Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Jan 2023 06:49:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60805 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 60805-submit@debbugs.gnu.org id=B60805.1674283734886 (code B ref 60805); Sat, 21 Jan 2023 06:49:01 +0000 Original-Received: (at 60805) by debbugs.gnu.org; 21 Jan 2023 06:48:54 +0000 Original-Received: from localhost ([127.0.0.1]:47817 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJ7gL-0000EE-QO for submit@debbugs.gnu.org; Sat, 21 Jan 2023 01:48:54 -0500 Original-Received: from mail.eshelyaron.com ([107.175.124.16]:32858 helo=eshelyaron.com) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pJ7gK-0000E5-Sq for 60805@debbugs.gnu.org; Sat, 21 Jan 2023 01:48:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=eshelyaron.com; s=mail; t=1674283732; bh=FbkLka+1G0KNPop9c6wNSAJiewUGDpU5mQjEivhWgq4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=iig6h9szCjMQZ24GVTJ8tv5tBXIdGV9Ljk8tDnuuOQnFA571siAt+v0kjX28BSKcG jlwRqWtgqiayiv1+fDW5mBy/r/hMKAw7F2tUDDXOhB0GIUTShIZATosLZ1ZfuN6WMk YiuaY5UJldO+MDxVKaskNL5g6vbowrtArYW7joirU9q5ffYl7ddT5LN+r4lFEuGjTn 5Fq82WFhKseAKJL+pUcF919AbFg6d9PrNqnY5t6aaEpZAC6jYtrGL6h1OQmGoIb9gc Bp4z4FFS2I2ylRGA2wibH/kLgjGyMznYwQx8r4F3SNhdqIwbRty4mVxfW+8O7NV7+4 kb6Cipvr/FCbg== In-Reply-To: (Randy Taylor's message of "Sat, 21 Jan 2023 03:30:40 +0000") 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:253825 Archived-At: A quick thought from someone interested in using this new command: IMO the current implementation is a bit too opinionated to be really useful. Inserting the function's name at the beginning of the comment is not always desired because different teams have different conventions for doc comments, and sometimes you just want to add a nolint directive[0] which again doesn't start with the function's name. My suggestion is to add some way for users to customize/extend the contents of the inserted doc comment. One option is to have a variable that'll hold a function responsible for determining the text of the comment. This variable can then default to a function that returns the current Go function's name. Thanks, Eshel [0] https://golangci-lint.run/usage/false-positives/#nolint-directive