mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
ci: consistently enforce the yazi lua coding style
This commit adds a GitHub Actions workflow that checks the lua files against the yazi lua coding style. The workflow uses the `stylua` tool, which can be installed using cargo: ```sh cargo install stylua --features lua54 ``` I picked the options for the formatter in a way that forced minimal changes to the existing style. <https://github.com/JohnnyMorganz/StyLua?tab=readme-ov-file#options> Update .github/workflows/check.yml Co-authored-by: 三咲雅 · Misaki Masa <sxyazi@gmail.com>
This commit is contained in:
parent
28dfe728ab
commit
b8264fcb75
3 changed files with 17 additions and 0 deletions
12
.github/workflows/check.yml
vendored
12
.github/workflows/check.yml
vendored
|
|
@ -39,3 +39,15 @@ jobs:
|
|||
|
||||
- name: Rustfmt
|
||||
run: cargo +nightly fmt --all -- --check
|
||||
|
||||
stylua:
|
||||
name: stylua
|
||||
runs-on: ubuntu-22.04
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: latest
|
||||
# CLI arguments
|
||||
args: --color always --check .
|
||||
|
|
|
|||
2
.styluaignore
Normal file
2
.styluaignore
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
# this file caused some issues with the build system
|
||||
yazi-plugin/preset/plugins/mime.lua
|
||||
3
stylua.toml
Normal file
3
stylua.toml
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
indent_width = 2
|
||||
call_parentheses = "NoSingleTable"
|
||||
collapse_simple_statement = "FunctionOnly"
|
||||
Loading…
Add table
Reference in a new issue