Skip to content

Commit 1bf8b5b

Browse files
authored
fix(jq): limit indetion to [-1,7] (#807)
According to the documentation jq only accepts indention between -1 and 7. Regression of 235dd79.
1 parent 0b7e3df commit 1bf8b5b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lua/conform/formatters/jq.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ return {
66
},
77
command = "jq",
88
args = function(_, ctx)
9-
return { "--indent", ctx.shiftwidth }
9+
return { "--indent", math.max(-1, math.min(7, ctx.shiftwidth)) }
1010
end,
1111
}

0 commit comments

Comments
 (0)