mirror of
https://github.com/vale981/apheleia
synced 2025-03-04 17:11:40 -05:00
Add stylua (#105)
This commit is contained in:
parent
67853e98b1
commit
2fa9dd97ed
5 changed files with 55 additions and 0 deletions
|
@ -7,6 +7,11 @@ The format is based on [Keep a Changelog].
|
|||
### Enhancements
|
||||
* shfmt uses 4 spaces instead of tabs by default.
|
||||
|
||||
### Formatters
|
||||
* [stylua](https://github.com/JohnnyMorganz/StyLua) for Lua ([#105]).
|
||||
|
||||
[#105]: https://github.com/raxod502/apheleia/pull/105
|
||||
|
||||
## 3.0 (released 2022-06-01)
|
||||
### Breaking changes
|
||||
* The arguments of formatters defined as Elisp functions has changed.
|
||||
|
|
|
@ -936,6 +936,7 @@ being run, for diagnostic purposes."
|
|||
(phpcs . ("apheleia-phpcs"))
|
||||
(prettier . (npx "prettier" "--stdin-filepath" filepath))
|
||||
(shfmt . ("shfmt" "-i" "4"))
|
||||
(stylua . ("stylua" "-"))
|
||||
(rustfmt . ("rustfmt" "--quiet" "--emit" "stdout"))
|
||||
(terraform . ("terraform" "fmt" "-")))
|
||||
"Alist of code formatting commands.
|
||||
|
@ -1064,6 +1065,7 @@ function: %s" command)))
|
|||
(kotlin-mode . ktlint)
|
||||
(latex-mode . latexindent)
|
||||
(LaTeX-mode . latexindent)
|
||||
(lua-mode . stylua)
|
||||
(nix-mode . nixfmt)
|
||||
(python-mode . black)
|
||||
(ruby-mode . prettier)
|
||||
|
|
6
test/formatters/installers/stylua.bash
Normal file
6
test/formatters/installers/stylua.bash
Normal file
|
@ -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/
|
20
test/formatters/samplecode/stylua/in.lua
Normal file
20
test/formatters/samplecode/stylua/in.lua
Normal file
|
@ -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'
|
22
test/formatters/samplecode/stylua/out.lua
Normal file
22
test/formatters/samplecode/stylua/out.lua
Normal file
|
@ -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"
|
Loading…
Add table
Reference in a new issue