From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Bozhidar Batsov" Newsgroups: gmane.emacs.devel Subject: Re: ruby-ts-mode.el -- first draft Date: Sun, 11 Dec 2022 19:26:13 +0200 Message-ID: <117e87be-6717-4f69-ad75-a0037780fd16@app.fastmail.com> References: <065A1DE9-B9BA-4AA3-9D59-D0F5547B8824@easesoftware.com> <87v8mixscb.fsf@thornhill.no> <8340D08F-A596-4551-B7B1-B1E63E098E73@easesoftware.com> <51E008B5-891B-4A85-A6FD-7D018FD5D908@easesoftware.com> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=b6c478f280ae412fa9e3da90354864df Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="38908"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead To: "Emacs Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Dec 11 18:27:18 2022 Return-path: Envelope-to: ged-emacs-devel@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 1p4Q6e-0009sM-7Z for ged-emacs-devel@m.gmane-mx.org; Sun, 11 Dec 2022 18:27:17 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4Q6H-0002xJ-Vq; Sun, 11 Dec 2022 12:26:54 -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 1p4Q6F-0002x8-6K for emacs-devel@gnu.org; Sun, 11 Dec 2022 12:26:51 -0500 Original-Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p4Q6D-00081Q-1C for emacs-devel@gnu.org; Sun, 11 Dec 2022 12:26:50 -0500 Original-Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 106A85C00CB for ; Sun, 11 Dec 2022 12:26:47 -0500 (EST) Original-Received: from imap43 ([10.202.2.93]) by compute1.internal (MEProxy); Sun, 11 Dec 2022 12:26:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batsov.dev; h=cc :content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1670779607; x=1670866007; bh=4ifee6Sj4x cHg/ewXLSxfxrY6iTVUsgERWRs5f1+9II=; b=4RcboK80REqJFIrF5zFx+xMfu0 5qpBKUesX/qAU/ilrVn1WYOCc3DFZ8JjqCa5wiDzjgRN14g4fOeFQ6NY5qyK7cXW 9Blr6C4C0RqS8hQi6dhC2EJlCZEFFj1dv/6vRx/XIQ+irl2dU0KAm64CIE+MDlRI ZiJRKnaOdYoHzCgl5pf1ua8L5A1+LNEa+lwEGITw6d8Ete0gNu+Irx0MdRciyYdH a05Ykam2IX3uwdU5AUMXMvedNxHc86qNpzPQY3IE4HQcu6OxLoCCExsAxpmmtmkN 8duomJ4v3qayl+uqpPDVbsJIcew43AjcYHkp3Naic6VkxpfPnTO3ddwQ1nXg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1670779607; x=1670866007; bh=4ifee6Sj4xcHg/ewXLSxfxrY6iTV UsgERWRs5f1+9II=; b=fjORu4T9FZyFJUaqiuHzN8DrySVCS7F8iNXP5+9wCDtq uvobxh81OppggilvHfdOz7ubzkSw07VG1RiRtq1B3hdFGzWqGYhduJr8xN4LmZbX qndwplr40zw0tBNpsfe5/pZPi6yQ5BHsHel39Wqu9ykXfy8t+WEt+SGZzmzGn0KF hE+DfWEcaZKBatX/RqI4VFRa9jmdKzGcivwBsOhHEXzxSWYt1KDmLMf+iudOGQr+ NsCL/9koJ2zkwrUgwy46kM0Tp0Dx83/ruZYxQjJmPgdfP18AEhYfyEiNoT2E5ryW a/xvSDoDpFC3JS7QJ7BlcRCKhP7ehROGuLHo3hayVQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdeigddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvffutgesrgdtreerreerjeenucfhrhhomhepfdeuohii hhhiuggrrhcuuegrthhsohhvfdcuoegsohiihhhiuggrrhessggrthhsohhvrdguvghvqe enucggtffrrghtthgvrhhnpeeffffhheekfeekkeduteffgffhvefgtddvleefgeehhfef udelhedtleehfeegkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrih hlfhhrohhmpegsohiihhhiuggrrhessggrthhsohhvrdguvghv X-ME-Proxy: Feedback-ID: i025946a9:Fastmail Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id CC0A02D40074; Sun, 11 Dec 2022 12:26:46 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <51E008B5-891B-4A85-A6FD-7D018FD5D908@easesoftware.com> Received-SPF: pass client-ip=66.111.4.26; envelope-from=bozhidar@batsov.dev; helo=out2-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:301158 Archived-At: --b6c478f280ae412fa9e3da90354864df Content-Type: text/plain;charset=utf-8 Content-Transfer-Encoding: quoted-printable RuboCop's author here. :-) I'd encourage the new mode to support all most common indentation styles= , otherwise gaining traction would be hard given how versatile the curre= nt ruby-mode is. I think it'd be really nice for the sake of easy migrat= ion between the modes to maintain exactly the same default indentation s= ettings.=20 If I recall correctly out-of-the-box the current ruby-mode will generate= no RuboCop layout-related warnings and I'd like us to keep this going f= orward. On Sun, Dec 11, 2022, at 6:42 PM, Perry Smith wrote: >=20 >> On Dec 11, 2022, at 10:26, Theodor Thornhill wrot= e: >>=20 >>> The =E2=80=9Clint=E2=80=9D in the Ruby community is called Rubocop a= nd it is rather strongly opinionated out of the box but you can adjust i= t to your liking. I predict someone will write a set of rules that 100%= recreates Rubocop=E2=80=99s out of the box settings. I think a lot of = users would like to have an easy way to enable those =E2=80=9Crules=E2=80= =9D which I consider rather strict. And, at the same time, I think ther= e will be a lot of users would like a more relax set of rules. So I am = expecting two sets of rules to be developed. >>=20 >> Why not create the two sets now, rather than later? I think we should= try to make as good modes as possible so the need for external packages= vanishes. If we are not good enough people will just create the modes. = Maybe rubocop could be plugged into the Emacs tree-sitter integration?Lu= ckily rubocops author loves Emacs, so they might offer some useful feedb= ack (added Bozhidar Batsov to cc). >=20 > This is why I called it a first draft. I=E2=80=99m hoping others star= t to play with it and provide feedback. And I plan to fire up Rubocop (= or perhaps contact its author as well) and try to implement the Rubocop = mode. >=20 >>> Another option would be to put the various sets of rules in separate= variables and then the final set the user could cherry pick the desired= set of rules. >>>=20 >>> The system is incredibly beautiful and versatile and I haven=E2=80=99= t seen all the discussions on how to manage and use the versatility that= Emacs now has. I view myself at being rather bad when faced with these= types of decisions and choices. >>=20 >> I say bring forward something so we have something to discuss :-) > I was just about to do this. >=20 > I want to play around with treesit coupled with align. Wouldn=E2=80=99= t it be super slick if >=20 >> new_hash =3D { >> long_ugly_name: 9, >> frog: 12, >> daft: 92, >> egg: 99 >> } >=20 > was automagically formatted as: >=20 >> new_hash =3D { >> long_ugly_name: 9, >> frog: 12, >> daft: 92, >> egg: 99 >> } >=20 > Well=E2=80=A6 I am sure some will say =E2=80=9CYea!!!=E2=80=9D while o= thers will say =E2=80=9COMG! NO!!!=E2=80=9D. And, clearly how something= like that is styled has a lot of alternatives and choices. >=20 > But I=E2=80=99m not even sure it is even possible in the practical sen= se. I wanted to play with it and see how hard it is as well as ask the = list for advice / hints on how to approach this. >=20 > Perry >=20 >=20 > *Attachments:* > * signature.asc --b6c478f280ae412fa9e3da90354864df Content-Type: text/html;charset=utf-8 Content-Transfer-Encoding: quoted-printable
RuboCop's autho= r here. :-)

I'd encourage the new mode to s= upport all most common indentation styles, otherwise gaining traction wo= uld be hard given how versatile the current ruby-mode is. I think it'd b= e really nice for the sake of easy migration between the modes to mainta= in exactly the same default indentation settings.

If I recall correctly out-of-the-box the current ruby-mode will = generate no RuboCop layout-related warnings and I'd like us to keep this= going forward.

On Sun, Dec 11, 2022, at 6:= 42 PM, Perry Smith wrote:

On Dec 11, 2022, at 10:26, Theodor Thornhill <theo@thornh= ill.no> wrote:

The= =E2=80=9Clint=E2=80=9D in the Ruby community is called Rubocop and it i= s rather strongly opinionated out of the box but you can adjust it to yo= ur liking.  I predict someone will write a set of rules that 100% r= ecreates Rubocop=E2=80=99s out of the box settings.  I think a lot = of users would like to have an easy way to enable those =E2=80=9Crules=E2= =80=9D which I consider rather strict.  And, at the same time, I th= ink there will be a lot of users would like a more relax set of rules. &= nbsp;So I am expecting two sets of rules to be developed.

W= hy not create the two sets now, rather than later? I think we should try= to make as good modes as possible so the need for external packages van= ishes. If we are not good enough people will just create the modes. Mayb= e rubocop could be plugged into the Emacs tree-sitter integration?Luckil= y rubocops author loves Emacs, so they might offer some useful feedback = (added Bozhidar Batsov to cc).

This is why I called it a first = draft.  I=E2=80=99m hoping others start to play with it and provide= feedback.  And I plan to fire up Rubocop (or perhaps contact its a= uthor as well) and try to implement the Rubocop mode.

=
Another option would be to put the various set= s of rules in separate variables and then the final set the user could c= herry pick the desired set of rules.

The sy= stem is incredibly beautiful and versatile and I haven=E2=80=99t seen al= l the discussions on how to manage and use the versatility that Emacs no= w has.  I view myself at being rather bad when faced with these typ= es of decisions and choices.

I= say bring forward something so we have something to discuss :-)
I was just about to do this.
I want to play around with treesit coupled with align.  = ;Wouldn=E2=80=99t it be super slick if

new_hash =3D {
  long_ugly_name: 9,=
  frog: = 12,
  daf= t: 92,
  = egg: 99
}

was automagica= lly formatted as:

new_hash =3D {
  long_ugly_name:  9,<= br>
  frog:     &= nbsp;     12,
  daft:           92,
  egg:    = ;        99
<= span class=3D"font" style=3D"font-family:Courier New;">}

<= /div>
Well=E2=80=A6 I am sure some will say =E2=80=9CYea!!!=E2=80=9D= while others will say =E2=80=9COMG! NO!!!=E2=80=9D.  And, clearly = how something like that is styled has a lot of alternatives and choices.=

But I=E2=80=99m not even sure it is even p= ossible in the practical sense.  I wanted to play with it and see h= ow hard it is as well as ask the list for advice / hints on how to appro= ach this.

Perry


Attachments:
  • signature.asc
    <= /li>

--b6c478f280ae412fa9e3da90354864df--