OyvindSabo / gremlint

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

Relative indentation within closures is off by one if dots are configured to come after newlines #81

Closed OyvindSabo closed 3 years ago

OyvindSabo commented 3 years ago

Consider the following query formatted with a max line length of 45

g.V(ids).
  has('factor_a').
  has('factor_b').
  project('Factor A', 'Factor B', 'Product').
    by(values('factor_a')).
    by(values('factor_b')).
    by(map{ it.get().value('factor_a') * 
            it.get().value('factor_b') })

When shouldPlaceDotsAfterLineBreaks is set to true it is formatted like this:

g.V(ids)
  .has('factor_a')
  .has('factor_b')
  .project('Factor A', 'Factor B', 'Product')
    .by(values('factor_a'))
    .by(values('factor_b'))
    .by(map{ it.get().value('factor_a') * 
            it.get().value('factor_b') })

but it should be formatted like this:

g.V(ids)
  .has('factor_a')
  .has('factor_b')
  .project('Factor A', 'Factor B', 'Product')
    .by(values('factor_a'))
    .by(values('factor_b'))
    .by(map{ it.get().value('factor_a') * 
             it.get().value('factor_b') })