From 1c72e797ba7a07c465633751502604258dd87255 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ph=E1=BA=A1m=20Huy=20Ho=C3=A0ng?= Date: Tue, 13 Feb 2024 23:00:53 +0700 Subject: [PATCH] fix(yuck): comment out start-of-line parens --- queries/yuck/indents.scm | 24 ++++++++---------------- tests/indent/yuck/indent.yuck | 17 +++++++++++++++++ tests/indent/yuck_spec.lua | 19 +++++++++++++++++++ 3 files changed, 44 insertions(+), 16 deletions(-) create mode 100644 tests/indent/yuck/indent.yuck create mode 100644 tests/indent/yuck_spec.lua diff --git a/queries/yuck/indents.scm b/queries/yuck/indents.scm index 0f1305e25..515795021 100644 --- a/queries/yuck/indents.scm +++ b/queries/yuck/indents.scm @@ -15,23 +15,15 @@ ")" "}" "]" -] @indent.end - -[ - "{" - "}" -] @indent.branch - -[ - "(" - ")" -] @indent.branch - -[ - "[" - "]" -] @indent.branch +] @indent.end @indent.branch +; I do not know what/when this should be added. +; Commenting this out for now +; [ +; "(" +; "{" +; "[" +; ] @indent.branch [ (ERROR) (comment) diff --git a/tests/indent/yuck/indent.yuck b/tests/indent/yuck/indent.yuck new file mode 100644 index 000000000..c224548af --- /dev/null +++ b/tests/indent/yuck/indent.yuck @@ -0,0 +1,17 @@ +(defwidget name + :widget parameter + (box one + :box1 parameter + (box two + :box2 parameter + ) + ) +) + +(defwidget name + :widget parameter + (box one + ) +) + +(defwidget name diff --git a/tests/indent/yuck_spec.lua b/tests/indent/yuck_spec.lua new file mode 100644 index 000000000..6ce15de6f --- /dev/null +++ b/tests/indent/yuck_spec.lua @@ -0,0 +1,19 @@ +local Runner = require("tests.indent.common").Runner +local run = Runner:new(it, "tests/indent/yuck", { + tabstop = 2, + shiftwidth = 2, + expandtab = true, +}) + +describe("indent yuck", function() + describe("whole file:", function() + run:whole_file(".", { + expected_failures = {}, + }) + end) + + describe("new line:", function() + run:new_line("indent.yuck", { on_line = 13, text = ":box1 parameter", indent = 4 }) + run:new_line("indent.yuck", { on_line = 17, text = ")", indent = 0 }) + end) +end)