OyvindSabo / gremlint

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

It should be possible to format multiple Gremlin queries at once, or code which consists of some Gremlin code and some non-Gremlin code #30

Closed OyvindSabo closed 3 years ago

OyvindSabo commented 5 years ago

The following

g.V().branch{ it.get().value('name') }.option('marko', values('age')).option(none, values('name'))

g.V().branch(values('name')).option('marko', values('age')).option(none, values('name'))

g.V().choose(has('name','marko'),values('age'), values('name'))

should be formatted to

g.V().
  branch{ it.get().value('name') }.
    option('marko', values('age')).
    option(none, values('name'))

g.V().
  branch(values('name')).
    option('marko', values('age')).
    option(none, values('name'))

g.V().choose(has('name', 'marko'), values('age'), values('name'))

and not

g.V().
  branch{ it.get().value('name') }.option('marko', values('age')).
  option(none, values('name'))

g.V().
  branch(values('name')).option('marko', values('age')).
  option(none, values('name'))

g.V().
  choose(has('name', 'marko'), values('age'), values('name'))