mirror of
https://github.com/NotAShelf/direnv.nvim.git
synced 2024-11-22 16:30:41 +00:00
ci: check style & lint Lua code
This commit is contained in:
parent
90f356d4b5
commit
c81f9e52c0
2 changed files with 72 additions and 0 deletions
62
.github/workflows/check.yml
vendored
Normal file
62
.github/workflows/check.yml
vendored
Normal file
|
@ -0,0 +1,62 @@
|
|||
name: "Style & Lint"
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
pull_request:
|
||||
push:
|
||||
branches: ["main"]
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ matrix.lua_version }}-${{ github.head_ref || github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
lua_version: [5.1]
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Lua setup"
|
||||
uses: leafo/gh-actions-lua@v10
|
||||
with:
|
||||
luaVersion: ${{ matrix.lua_version }}
|
||||
|
||||
- name: "Install Luarocks"
|
||||
uses: leafo/gh-actions-luarocks@v4
|
||||
|
||||
- name: "Install luacheck"
|
||||
run: luarocks install luacheck 1.1.1
|
||||
|
||||
- name: "Lint"
|
||||
run: luacheck lua/
|
||||
|
||||
style:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ matrix.stylua_version }}-${{ github.head_ref || github.ref_name }}
|
||||
cancel-in-progress: true
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
stylua_version: [0.19.1]
|
||||
|
||||
steps:
|
||||
- name: "Checkout"
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: "Check style via Stylua"
|
||||
uses: JohnnyMorganz/stylua-action@v4
|
||||
with:
|
||||
token: ${{ secrets.GITHUB_TOKEN }}
|
||||
version: ${{ matrix.stylua_version }}
|
||||
args: --check lua
|
10
.luacheckrc
Normal file
10
.luacheckrc
Normal file
|
@ -0,0 +1,10 @@
|
|||
-- vim: ft=lua tw=80
|
||||
|
||||
-- Don't report unused self arguments of methods.
|
||||
self = false
|
||||
|
||||
ignore = {
|
||||
"631", -- max_line_length
|
||||
}
|
||||
|
||||
globals = { "vim" }
|
Loading…
Reference in a new issue