From f0108dba405edc0ab82528bc3e2adf4949eb89e1 Mon Sep 17 00:00:00 2001 From: Mika Vilpas Date: Wed, 15 May 2024 05:54:20 +0300 Subject: [PATCH] ci: consistently enforce Lua coding style (#1029) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 三咲雅 · Misaki Masa --- .github/workflows/check.yml | 10 ++++++++++ .styluaignore | 2 ++ stylua.toml | 6 ++++++ 3 files changed, 18 insertions(+) create mode 100644 .styluaignore create mode 100644 stylua.toml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index ce034802..0e7b1d54 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -39,3 +39,13 @@ jobs: - name: Rustfmt run: cargo +nightly fmt --all -- --check + + stylua: + runs-on: ubuntu-22.04 + steps: + - uses: actions/checkout@v4 + - uses: JohnnyMorganz/stylua-action@v4 + with: + token: ${{ secrets.GITHUB_TOKEN }} + version: latest + args: --color always --check . diff --git a/.styluaignore b/.styluaignore new file mode 100644 index 00000000..d8e2f141 --- /dev/null +++ b/.styluaignore @@ -0,0 +1,2 @@ +# this file caused some issues with the build system +yazi-plugin/preset/plugins/mime.lua diff --git a/stylua.toml b/stylua.toml new file mode 100644 index 00000000..ffaa2031 --- /dev/null +++ b/stylua.toml @@ -0,0 +1,6 @@ +indent_width = 2 +call_parentheses = "NoSingleTable" +collapse_simple_statement = "FunctionOnly" + +[sort_requires] +enabled = true