aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorKisaragi Hiu <mail@kisaragi-hiu.com>2022-06-21 06:21:27 +0900
committerGitHub <noreply@github.com>2022-06-20 14:21:27 -0700
commit2fa9dd97eddf54fe4fe01449612722399aa05d1c (patch)
tree38f5e76a82b9738da63db498cdc6a759196257ad /test
parent67853e98b190cc735a8ad31bd1de64f76f2990c4 (diff)
Add stylua (#105)
Diffstat (limited to 'test')
-rw-r--r--test/formatters/installers/stylua.bash6
-rw-r--r--test/formatters/samplecode/stylua/in.lua20
-rw-r--r--test/formatters/samplecode/stylua/out.lua22
3 files changed, 48 insertions, 0 deletions
diff --git a/test/formatters/installers/stylua.bash b/test/formatters/installers/stylua.bash
new file mode 100644
index 0000000..40bc0d3
--- /dev/null
+++ b/test/formatters/installers/stylua.bash
@@ -0,0 +1,6 @@
+ver="$(latest_release JohnnyMorganz/StyLua | sed 's/^v//')"
+
+wget "https://github.com/JohnnyMorganz/StyLua/releases/download/v${ver}/stylua-linux.zip" -O stylua.zip
+unzip stylua.zip
+chmod +x stylua
+cp stylua /usr/local/bin/
diff --git a/test/formatters/samplecode/stylua/in.lua b/test/formatters/samplecode/stylua/in.lua
new file mode 100644
index 0000000..ba0cf49
--- /dev/null
+++ b/test/formatters/samplecode/stylua/in.lua
@@ -0,0 +1,20 @@
+ too_many_spaces = true
+
+-- stylua: ignore
+local function foo ()
+ return 1,
+ 2,
+ 3
+end
+
+local many, vars = function() return true end
+
+local function what_indent ()
+noindent = true
+ if noindent then
+ x = false
+ end
+ return x
+end
+
+local y = 'Double quotes are used'
diff --git a/test/formatters/samplecode/stylua/out.lua b/test/formatters/samplecode/stylua/out.lua
new file mode 100644
index 0000000..c1ea1d9
--- /dev/null
+++ b/test/formatters/samplecode/stylua/out.lua
@@ -0,0 +1,22 @@
+too_many_spaces = true
+
+-- stylua: ignore
+local function foo ()
+ return 1,
+ 2,
+ 3
+end
+
+local many, vars = function()
+ return true
+end
+
+local function what_indent()
+ noindent = true
+ if noindent then
+ x = false
+ end
+ return x
+end
+
+local y = "Double quotes are used"