[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ruby-ts-mode.el -- first draft

From: Bozhidar Batsov
Subject: Re: ruby-ts-mode.el -- first draft
Date: Sun, 11 Dec 2022 19:26:13 +0200
User-agent: Cyrus-JMAP/3.7.0-alpha0-1115-g8b801eadce-fm-20221102.001-g8b801ead

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 current ruby-mode is. I think it'd be really nice for the sake of easy migration between the modes to maintain 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@thornhill.no> wrote:

The “lint” in the Ruby community is called Rubocop and it is rather strongly opinionated out of the box but you can adjust it to your liking.  I predict someone will write a set of rules that 100% recreates Rubocop’s out of the box settings.  I think a lot of users would like to have an easy way to enable those “rules” which I consider rather strict.  And, at the same time, I think there 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.

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?Luckily 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’m hoping others start 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.

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.

The system is incredibly beautiful and versatile and I haven’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.

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’t it be super slick if

new_hash = {
  long_ugly_name: 9,
  frog: 12,
  daft: 92,
  egg: 99

was automagically formatted as:

new_hash = {
  long_ugly_name:  9,
  frog:           12,
  daft:           92,
  egg:            99

Well… I am sure some will say “Yea!!!” while others will say “OMG! NO!!!”.  And, clearly how something like that is styled has a lot of alternatives and choices.

But I’m not even sure it is even possible in the practical sense.  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.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]