From b7f0b895ec971be2b333189afb8484ae24d00905 Mon Sep 17 00:00:00 2001 From: Austin Ziegler Date: Sat, 24 Aug 2024 19:59:01 -0400 Subject: [PATCH] stylua: Enable more Lua version formatting By default, stylua is built with support for Lua 5.1 only, but can be built to support Lua 5.1 through Lua 5.4 and Luau. This only requires adding `luau` and `lua54` to the default features, `editorconfig` and `wasm-bindgen`. `lua54` implies `lua52` and `lua53`. I was able to format a Lua 5.4 file that was not previously formattable with the existing feature set. --- lua/stylua/Portfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lua/stylua/Portfile b/lua/stylua/Portfile index 3a7bd56f1f1fb..3e3c3fa6c01c2 100644 --- a/lua/stylua/Portfile +++ b/lua/stylua/Portfile @@ -5,7 +5,7 @@ PortGroup github 1.0 PortGroup cargo 1.0 github.setup johnnymorganz stylua 0.20.0 v -revision 0 +revision 1 categories lua platforms darwin maintainers {judaew @judaew} \ @@ -13,7 +13,7 @@ maintainers {judaew @judaew} \ license MPL-2 description An opinionated Lua code formatter -long_description An opinionated code formatter for Lua 5.1, Lua 5.2 and Luau. \ +long_description An opinionated code formatter for Lua 5.1-5.4 and Luau. \ StyLua is inspired by the likes of prettier, it parses your \ Lua codebase, and prints it back out from scratch, enforcing \ a consistent code style. @@ -23,6 +23,9 @@ checksums ${distname}${extract.suffix} \ sha256 34235d51602229e8ad95b4099c6f7a36fde8eef699b998e17f3d00c61e6151ad \ size 412909 +build.pre_args-append \ + --features editorconfig,wasm-bindgen,luau,lua54 + destroot { xinstall -m 755 ${worksrcpath}/target/[cargo.rust_platform]/release/${name} ${destroot}${prefix}/bin/ }