Closed j127 closed 3 years ago
What I expect to happen: 4-space indentation
What actually happens: 2-space indentation for multi-line where clauses (while everything else has 4 spaces, including single-line where clauses)
where
Versions:
My brittany.yaml file contains the line:
brittany.yaml
lconfig_indentAmount: 4
Everything works great so far, except in one case. When I run brittany on this code:
solveRPN :: (Num a, Read a) => String -> a solveRPN = head . foldl foldingFunction [] . words where foldingFunction (x : y : ys) "*" = (x * y) : ys foldingFunction (x : y : ys) "+" = (x + y) : ys foldingFunction (x : y : ys) "-" = (y - x) : ys foldingFunction xs numberString = read numberString : xs
brittany changes it to 2-space indentation:
It looks like it only happens for where clauses when there are multiple lines. When there is just one line, it correctly indents by 4 spaces:
calcBmis :: (RealFloat a) => [(a, a)] -> [a] calcBmis xs = [ bmi w h | (w, h) <- xs ] where bmi weight height = weight / height ^ 2
If I change that code to 2 spaces and run brittany on it, it correctly re-indents it with 4 spaces (based on my config file).
I think you can avoid this by setting lconfig_indentWhereSpecial: false. See #39 and #188.
lconfig_indentWhereSpecial: false
Thanks, that fixed it.
(Sorry, I had searched through the issues before posting but didn't see those.)
What I expect to happen: 4-space indentation
What actually happens: 2-space indentation for multi-line
where
clauses (while everything else has 4 spaces, including single-linewhere
clauses)Versions:
My
brittany.yaml
file contains the line:Everything works great so far, except in one case. When I run brittany on this code:
brittany changes it to 2-space indentation:
It looks like it only happens for
where
clauses when there are multiple lines. When there is just one line, it correctly indents by 4 spaces:If I change that code to 2 spaces and run brittany on it, it correctly re-indents it with 4 spaces (based on my config file).