Skip to content

Commit 8cf8cb7

Browse files
committed
Deps: Replaced luaformatter with StyLua in CI workflows
It doesn't seem very actively maintained and running it in the CI takes forever, plus it has the potential of sometimes corrupting the source code that it formatted. All in all, StyLua seems like a better solution nowadays.
1 parent 9484bdf commit 8cf8cb7

File tree

4 files changed

+11
-142
lines changed

4 files changed

+11
-142
lines changed

.github/workflows/check-format.yaml

+9-19
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Formatting
1+
name: Autoformat
22

33
on:
44
pull_request:
@@ -13,30 +13,20 @@ on:
1313

1414
jobs:
1515
check-format:
16-
name: luaformat
16+
name: Enforce consistent formatting
1717
runs-on: ubuntu-latest
1818

1919
steps:
20-
# LuaRocks needs the 5.1 headers to compile LuaCheck later, so we download them, too
21-
- name: Install LuaJIT
22-
run: sudo apt-get install luajit libluajit-5.1-dev
23-
24-
- name: Download LuaRocks
25-
run: wget https://luarocks.org/releases/luarocks-3.9.0.tar.gz
26-
27-
- name: Unpack LuaRocks release
28-
run: tar zxpf luarocks-3.9.0.tar.gz
29-
30-
- name: Install LuaRocks
31-
run: cd luarocks-3.9.0 && ./configure && make && sudo make install
32-
33-
- name: Install lua-formatter
34-
run: sudo luarocks install --server=https://luarocks.org/dev luaformatter
35-
3620
- name: Check out Git repository
3721
uses: actions/checkout@v1
3822

39-
- name: Run lua-formatter
23+
- name: Set up StyLua
24+
uses: JohnnyMorganz/[email protected]
25+
with:
26+
token: ${{ secrets.GITHUB_TOKEN }}
27+
args: --check .
28+
29+
- name: Run autoformat
4030
run: ./autoformat.sh
4131

4232
- name: Check for inconsistent formatting

.lua-format

-121
This file was deleted.

.styluaignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Libs/

autoformat.sh

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
RELEVANT_LUA_FILES_TO_FORMAT=$(find . -type f -name "*.lua" -print -o -path "*/Libs" -prune)
2-
lua-format -i -v $RELEVANT_LUA_FILES_TO_FORMAT
1+
stylua .

0 commit comments

Comments
 (0)