OyvindSabo / gremlint

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

Relative indentation within code blocks is not preserved when wrapping happens inside of modulator #68

Closed OyvindSabo closed 3 years ago

OyvindSabo commented 3 years ago

Consider the following query, which with a max line length of 45 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') })

However, when I set the line length to 40, the query 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') })

instead of 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') })