OyvindSabo / gremlint

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

Add clearer distinction between multiple anonymous queries passed as arguments #61

Open OyvindSabo opened 3 years ago

OyvindSabo commented 3 years ago

Currently the following query

g.V(selectedId).union(until(__.not(out('ardoq_parent'))).repeat(out('ardoq_parent')), outE('Is Realized By').inV().hasLabel('Application').outE('Is Supported By').inV().hasLabel('Server').outE('Is Located At').inV().hasLabel('Location').until(__.not(out('ardoq_parent'))).repeat(out('ardoq_parent')).path()

is formatted like this

g.V(selectedId).
  union(
    until(__.not(out('ardoq_parent'))).repeat(out('ardoq_parent')),
    outE('Is Realized By').
    inV().
    hasLabel('Application').
    outE('Is Supported By').
    inV().
    hasLabel('Server').
    outE('Is Located At').
    inV().
    hasLabel('Location').until(__.not(out('ardoq_parent'))).
    repeat(out('ardoq_parent')).
    path()

insteead of this:

g.V(selectedId).
  union(
    until(__.not(out('ardoq_parent'))).repeat(out('ardoq_parent')),
    outE('Is Realized By').
      inV().
      hasLabel('Application').
      outE('Is Supported By').
      inV().
      hasLabel('Server').
      outE('Is Located At').
      inV().
      hasLabel('Location').
      until(__.not(out('ardoq_parent'))).repeat(out('ardoq_parent')).
  path()