OyvindSabo / gremlint

Linter/Code formatter for Gremlin
https://gremlint.com
Apache License 2.0
11 stars 6 forks source link

How should modulators which appear before the step they are modulating be indented? #55

Open OyvindSabo opened 3 years ago

OyvindSabo commented 3 years ago

For instance, assuming a max line length of 23 characters consider the following query:

g.V(1).emit().repeat(out()).times(2).path().by('name')

It is currently formatted like this (on the same line as the previous step, as if it was modulating the previous step):

g.V(1).emit().
  repeat(out()).
    times(2).
  path().by('name')

Should it rather be formatted like this (not treated as a modulator, I'm kind of leaning towards this one):

g.V(1).
  emit().
  repeat(out()).
    times(2).
  path().by('name')

Or like this (on the same line, but before the step it is modulating):

g.V(1).
  emit().repeat(out()).
    times(2).
  path().by('name')

Or like this (indented relative to the step it is modulating):

g.V(1).
    emit().
  repeat(out()).
    times(2).
  path().by('name')