diff options
| author | Eric Zheng (PiaoDan) <zhengpiaodan@gmail.com> | 2022-07-09 16:58:25 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-07-09 10:58:25 +0200 |
| commit | 9587db3d077de1e118f40f8b880b36e594ba9ce6 (patch) | |
| tree | c9e9f7120ed8933e950229b234a47a87ab1040fc | |
| parent | ab3183107a34a0364888273239365fc868a5385c (diff) | |
fix: add more indentations for ruby (#3139)
| -rw-r--r-- | queries/ruby/indents.scm | 2 | ||||
| -rw-r--r-- | tests/indent/ruby/indent-assignment.rb | 2 | ||||
| -rw-r--r-- | tests/indent/ruby/indent-unless.rb | 2 | ||||
| -rw-r--r-- | tests/indent/ruby_spec.lua | 13 |
4 files changed, 19 insertions, 0 deletions
diff --git a/queries/ruby/indents.scm b/queries/ruby/indents.scm index 882a8157..1d8e5b47 100644 --- a/queries/ruby/indents.scm +++ b/queries/ruby/indents.scm @@ -16,6 +16,8 @@ (until) (for) (begin) + (unless) + (assignment) ] @indent [ diff --git a/tests/indent/ruby/indent-assignment.rb b/tests/indent/ruby/indent-assignment.rb new file mode 100644 index 00000000..d0ae21ef --- /dev/null +++ b/tests/indent/ruby/indent-assignment.rb @@ -0,0 +1,2 @@ +ret = + 2 diff --git a/tests/indent/ruby/indent-unless.rb b/tests/indent/ruby/indent-unless.rb new file mode 100644 index 00000000..50bc2b45 --- /dev/null +++ b/tests/indent/ruby/indent-unless.rb @@ -0,0 +1,2 @@ +unless true +end diff --git a/tests/indent/ruby_spec.lua b/tests/indent/ruby_spec.lua new file mode 100644 index 00000000..4c533a39 --- /dev/null +++ b/tests/indent/ruby_spec.lua @@ -0,0 +1,13 @@ +local Runner = require("tests.indent.common").Runner + +local run = Runner:new(it, "tests/indent/ruby", { + shiftwidth = 2, + expandtab = true, +}) + +describe("indent Ruby:", function() + describe("new line:", function() + run:new_line("indent-unless.rb", { on_line = 1, text = "stmt", indent = 2 }) + run:new_line("indent-assignment.rb", { on_line = 1, text = "1 +", indent = 2 }) + end) +end) |
