Skip to content

Commit 954d878

Browse files
committed
change stylua: wrong quotes
1 parent c2c5f00 commit 954d878

25 files changed

+356
-353
lines changed

crates/vim9-gen/build.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@ use std::{fmt::Write, fs, path::Path};
22

33
fn get_stylua_config() -> stylua_lib::Config {
44
stylua_lib::Config::new()
5+
.with_column_width(100)
6+
.with_line_endings(stylua_lib::LineEndings::Unix)
57
.with_indent_type(stylua_lib::IndentType::Spaces)
68
.with_indent_width(2)
7-
.with_column_width(120)
9+
.with_quote_style(stylua_lib::QuoteStyle::AutoPreferSingle)
10+
.with_call_parentheses(stylua_lib::CallParenType::Always)
811
}
912

1013
fn main() -> anyhow::Result<()> {

crates/vim9-gen/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1720,7 +1720,7 @@ fn get_stylua_config() -> stylua_lib::Config {
17201720
.with_line_endings(stylua_lib::LineEndings::Unix)
17211721
.with_indent_type(stylua_lib::IndentType::Spaces)
17221722
.with_indent_width(2)
1723-
.with_quote_style(stylua_lib::QuoteStyle::AutoPreferDouble)
1723+
.with_quote_style(stylua_lib::QuoteStyle::AutoPreferSingle)
17241724
.with_call_parentheses(stylua_lib::CallParenType::Always)
17251725
}
17261726

crates/vim9-gen/testdata/output/busted_assign.lua

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,49 +3,49 @@
33
-- For any bugs, please first consider reporting there.
44
----------------------------------------
55

6-
local NVIM9 = require("_vim9script")
7-
describe("filename", function()
6+
local NVIM9 = require('_vim9script')
7+
describe('filename', function()
88
-- vim9script
99

10-
it("Test_assignment_bool_1", function()
10+
it('Test_assignment_bool_1', function()
1111
-- Set errors to empty
1212
vim.v.errors = {}
1313

1414
-- Actual test
1515
local bool1 = NVIM9.convert.decl_bool(true)
16-
NVIM9.fn["assert_equal"](vim.v["true"], bool1)
16+
NVIM9.fn['assert_equal'](vim.v['true'], bool1)
1717
local bool2 = NVIM9.convert.decl_bool(false)
18-
NVIM9.fn["assert_equal"](vim.v["false"], bool2)
18+
NVIM9.fn['assert_equal'](vim.v['false'], bool2)
1919

2020
-- Assert that errors is still empty
2121
assert.are.same({}, vim.v.errors)
2222
end)
2323

24-
it("Test_assignment_bool_2", function()
24+
it('Test_assignment_bool_2', function()
2525
-- Set errors to empty
2626
vim.v.errors = {}
2727

2828
-- Actual test
2929
local bool3 = NVIM9.convert.decl_bool(0)
30-
NVIM9.fn["assert_equal"](false, bool3)
30+
NVIM9.fn['assert_equal'](false, bool3)
3131
local bool4 = NVIM9.convert.decl_bool(1)
32-
NVIM9.fn["assert_equal"](true, bool4)
32+
NVIM9.fn['assert_equal'](true, bool4)
3333

3434
-- Assert that errors is still empty
3535
assert.are.same({}, vim.v.errors)
3636
end)
3737

38-
it("Test_assignment_bool_3", function()
38+
it('Test_assignment_bool_3', function()
3939
-- Set errors to empty
4040
vim.v.errors = {}
4141

4242
-- Actual test
43-
local bool5 = NVIM9.convert.decl_bool(NVIM9.ops["And"](1, true))
44-
NVIM9.fn["assert_equal"](true, bool5)
45-
local bool6 = NVIM9.convert.decl_bool(NVIM9.ops["And"](0, 1))
46-
NVIM9.fn["assert_equal"](false, bool6)
47-
local bool7 = NVIM9.convert.decl_bool(NVIM9.ops["Or"](0, NVIM9.ops["And"](1, true)))
48-
NVIM9.fn["assert_equal"](true, bool7)
43+
local bool5 = NVIM9.convert.decl_bool(NVIM9.ops['And'](1, true))
44+
NVIM9.fn['assert_equal'](true, bool5)
45+
local bool6 = NVIM9.convert.decl_bool(NVIM9.ops['And'](0, 1))
46+
NVIM9.fn['assert_equal'](false, bool6)
47+
local bool7 = NVIM9.convert.decl_bool(NVIM9.ops['Or'](0, NVIM9.ops['And'](1, true)))
48+
NVIM9.fn['assert_equal'](true, bool7)
4949

5050
-- # var lines =<< trim END
5151
-- # vim9script
@@ -80,31 +80,31 @@ describe("filename", function()
8080
assert.are.same({}, vim.v.errors)
8181
end)
8282

83-
it("Test_unpacked_identifiers", function()
83+
it('Test_unpacked_identifiers', function()
8484
-- Set errors to empty
8585
vim.v.errors = {}
8686

8787
-- Actual test
8888
local x, y = unpack({ 1, 2 })
89-
NVIM9.fn["assert_equal"](1, x)
90-
NVIM9.fn["assert_equal"](2, y)
89+
NVIM9.fn['assert_equal'](1, x)
90+
NVIM9.fn['assert_equal'](2, y)
9191

9292
-- Assert that errors is still empty
9393
assert.are.same({}, vim.v.errors)
9494
end)
9595

96-
it("Test_modifier_prefixes", function()
96+
it('Test_modifier_prefixes', function()
9797
-- Set errors to empty
9898
vim.v.errors = {}
9999

100100
-- Actual test
101101
local foo = 10
102102
foo = foo - 1
103-
NVIM9.fn["assert_equal"](9, foo)
103+
NVIM9.fn['assert_equal'](9, foo)
104104

105105
foo = foo + 1
106106
foo = foo + 1
107-
NVIM9.fn["assert_equal"](11, foo)
107+
NVIM9.fn['assert_equal'](11, foo)
108108

109109
-- Assert that errors is still empty
110110
assert.are.same({}, vim.v.errors)

crates/vim9-gen/testdata/output/busted_defer.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
-- For any bugs, please first consider reporting there.
44
----------------------------------------
55

6-
local NVIM9 = require("_vim9script")
6+
local NVIM9 = require('_vim9script')
77
local MyDefer = nil
88
local RangeDefer = nil
9-
describe("filename", function()
9+
describe('filename', function()
1010
-- # def AddDefer(arg1)
1111
-- # call extend(g:deferred, [arg1])
1212
-- # # if a:0 == 1
@@ -44,15 +44,15 @@ describe("filename", function()
4444
local _, ret = pcall(function()
4545
local x = {}
4646
table.insert(nvim9_deferred, 1, function()
47-
NVIM9.fn["add"](x, 1)
47+
NVIM9.fn['add'](x, 1)
4848
end)
4949

5050
table.insert(nvim9_deferred, 1, function()
51-
NVIM9.fn["add"](x, 2)
51+
NVIM9.fn['add'](x, 2)
5252
end)
5353

5454
table.insert(nvim9_deferred, 1, function()
55-
NVIM9.fn["add"](x, 3)
55+
NVIM9.fn['add'](x, 3)
5656
end)
5757

5858
return x
@@ -70,9 +70,9 @@ describe("filename", function()
7070
local _, ret = pcall(function()
7171
local x = {}
7272

73-
for _, i in NVIM9.iter(NVIM9.fn["range"](3)) do
73+
for _, i in NVIM9.iter(NVIM9.fn['range'](3)) do
7474
table.insert(nvim9_deferred, 1, function()
75-
NVIM9.fn["add"](x, i)
75+
NVIM9.fn['add'](x, i)
7676
end)
7777
end
7878

@@ -86,16 +86,16 @@ describe("filename", function()
8686
return ret
8787
end
8888

89-
it("Test_defer", function()
89+
it('Test_defer', function()
9090
-- Set errors to empty
9191
vim.v.errors = {}
9292

9393
-- Actual test
9494
local x = MyDefer()
95-
NVIM9.fn["assert_equal"]({ 3, 2, 1 }, x)
95+
NVIM9.fn['assert_equal']({ 3, 2, 1 }, x)
9696

9797
local y = RangeDefer()
98-
NVIM9.fn["assert_equal"]({ 3, 2, 1 }, x)
98+
NVIM9.fn['assert_equal']({ 3, 2, 1 }, x)
9999

100100
-- Assert that errors is still empty
101101
assert.are.same({}, vim.v.errors)

crates/vim9-gen/testdata/output/busted_function.lua

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
-- For any bugs, please first consider reporting there.
44
----------------------------------------
55

6-
local NVIM9 = require("_vim9script")
7-
describe("filename", function()
6+
local NVIM9 = require('_vim9script')
7+
describe('filename', function()
88
-- vim9script
99

10-
it("Test_default_args", function()
10+
it('Test_default_args', function()
1111
-- Set errors to empty
1212
vim.v.errors = {}
1313

@@ -18,59 +18,59 @@ describe("filename", function()
1818
return x
1919
end
2020

21-
NVIM9.fn["assert_equal"](MyCoolFunc(), 5)
22-
NVIM9.fn["assert_equal"](MyCoolFunc(10), 10)
21+
NVIM9.fn['assert_equal'](MyCoolFunc(), 5)
22+
NVIM9.fn['assert_equal'](MyCoolFunc(10), 10)
2323

2424
-- Assert that errors is still empty
2525
assert.are.same({}, vim.v.errors)
2626
end)
2727

28-
it("Test_inplace", function()
28+
it('Test_inplace', function()
2929
-- Set errors to empty
3030
vim.v.errors = {}
3131

3232
-- Actual test
3333
local explicit = { 3, 2, 1 }
34-
explicit = NVIM9.fn_mut("sort", { explicit }, { replace = 0 })
35-
NVIM9.fn["assert_equal"]({ 1, 2, 3 }, explicit)
34+
explicit = NVIM9.fn_mut('sort', { explicit }, { replace = 0 })
35+
NVIM9.fn['assert_equal']({ 1, 2, 3 }, explicit)
3636

3737
local inplace = { 3, 2, 1 }
38-
NVIM9.fn_mut("sort", { inplace }, { replace = 0 })
39-
NVIM9.fn["assert_equal"]({ 1, 2, 3 }, inplace)
38+
NVIM9.fn_mut('sort', { inplace }, { replace = 0 })
39+
NVIM9.fn['assert_equal']({ 1, 2, 3 }, inplace)
4040

41-
local expr_sort = NVIM9.fn["sort"]({ 3, 2, 1 })
42-
NVIM9.fn["sort"]({ 3, 2, 1 })
43-
NVIM9.fn["assert_equal"]({ 1, 2, 3 }, expr_sort)
41+
local expr_sort = NVIM9.fn['sort']({ 3, 2, 1 })
42+
NVIM9.fn['sort']({ 3, 2, 1 })
43+
NVIM9.fn['assert_equal']({ 1, 2, 3 }, expr_sort)
4444

4545
-- Assert that errors is still empty
4646
assert.are.same({}, vim.v.errors)
4747
end)
4848

49-
it("Test_insert_inplace", function()
49+
it('Test_insert_inplace', function()
5050
-- Set errors to empty
5151
vim.v.errors = {}
5252

5353
-- Actual test
5454
local foo = { 1, 2, 3 }
55-
local bar = NVIM9.fn["insert"](foo, 4, NVIM9.fn["len"](foo))
56-
NVIM9.fn["assert_equal"](foo, bar)
55+
local bar = NVIM9.fn['insert'](foo, 4, NVIM9.fn['len'](foo))
56+
NVIM9.fn['assert_equal'](foo, bar)
5757

58-
NVIM9.fn["insert"](bar, 5, NVIM9.fn["len"](bar))
59-
NVIM9.fn["assert_equal"]({ 1, 2, 3, 4, 5 }, bar)
60-
NVIM9.fn["assert_equal"](foo, bar)
58+
NVIM9.fn['insert'](bar, 5, NVIM9.fn['len'](bar))
59+
NVIM9.fn['assert_equal']({ 1, 2, 3, 4, 5 }, bar)
60+
NVIM9.fn['assert_equal'](foo, bar)
6161

6262
-- Assert that errors is still empty
6363
assert.are.same({}, vim.v.errors)
6464
end)
6565

66-
it("Test_insert_inplace", function()
66+
it('Test_insert_inplace', function()
6767
-- Set errors to empty
6868
vim.v.errors = {}
6969

7070
-- Actual test
7171
local foo = { 1, 3, 2 }
72-
NVIM9.fn_mut("reverse", { NVIM9.fn_mut("sort", { foo }, { replace = 0 }) }, { replace = 0 })
73-
NVIM9.fn["assert_equal"]({ 3, 2, 1 }, foo)
72+
NVIM9.fn_mut('reverse', { NVIM9.fn_mut('sort', { foo }, { replace = 0 }) }, { replace = 0 })
73+
NVIM9.fn['assert_equal']({ 3, 2, 1 }, foo)
7474

7575
-- Assert that errors is still empty
7676
assert.are.same({}, vim.v.errors)

crates/vim9-gen/testdata/output/busted_heredoc.lua

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,57 +3,57 @@
33
-- For any bugs, please first consider reporting there.
44
----------------------------------------
55

6-
local NVIM9 = require("_vim9script")
7-
describe("filename", function()
6+
local NVIM9 = require('_vim9script')
7+
describe('filename', function()
88
-- vim9script
99

10-
it("Test_simple_heredoc", function()
10+
it('Test_simple_heredoc', function()
1111
-- Set errors to empty
1212
vim.v.errors = {}
1313

1414
-- Actual test
1515
local x = { [==[hello]==], [==[world]==] }
1616

17-
NVIM9.fn["assert_equal"]({ "hello", "world" }, x)
17+
NVIM9.fn['assert_equal']({ 'hello', 'world' }, x)
1818

1919
-- Assert that errors is still empty
2020
assert.are.same({}, vim.v.errors)
2121
end)
2222

23-
it("Test_simple_heredoc_with_whitespace", function()
23+
it('Test_simple_heredoc_with_whitespace', function()
2424
-- Set errors to empty
2525
vim.v.errors = {}
2626

2727
-- Actual test
2828
local x = { [==[ hello]==], [==[ world]==] }
2929

30-
NVIM9.fn["assert_equal"]({ " hello", " world" }, x)
30+
NVIM9.fn['assert_equal']({ ' hello', ' world' }, x)
3131

3232
-- Assert that errors is still empty
3333
assert.are.same({}, vim.v.errors)
3434
end)
3535

36-
it("Test_simple_heredoc_with_no_whitespace_trim", function()
36+
it('Test_simple_heredoc_with_no_whitespace_trim', function()
3737
-- Set errors to empty
3838
vim.v.errors = {}
3939

4040
-- Actual test
4141
local x = NVIM9.heredoc.trim({ [==[ hello]==], [==[world]==] })
4242

43-
NVIM9.fn["assert_equal"]({ " hello", "world" }, x)
43+
NVIM9.fn['assert_equal']({ ' hello', 'world' }, x)
4444

4545
-- Assert that errors is still empty
4646
assert.are.same({}, vim.v.errors)
4747
end)
4848

49-
it("Test_simple_heredoc_with_whitespace_trim", function()
49+
it('Test_simple_heredoc_with_whitespace_trim', function()
5050
-- Set errors to empty
5151
vim.v.errors = {}
5252

5353
-- Actual test
5454
local x = NVIM9.heredoc.trim({ [==[ hello]==], [==[ world]==] })
5555

56-
NVIM9.fn["assert_equal"]({ "hello", " world" }, x)
56+
NVIM9.fn['assert_equal']({ 'hello', ' world' }, x)
5757

5858
-- Assert that errors is still empty
5959
assert.are.same({}, vim.v.errors)

0 commit comments

Comments
 (0)