Skip to content

Commit

Permalink
ci: Add job to run stylua for style checking
Browse files Browse the repository at this point in the history
  • Loading branch information
Histalek committed Feb 4, 2024
1 parent cea937d commit 268701e
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@ root = true
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = tab
indent_style = space
trim_trailing_whitespace = true
max_line_length = 100

[*.md]
trim_trailing_whitespace = false
Expand Down
18 changes: 13 additions & 5 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
env:
GLUALINT_VERSION: 1.26.0
NEODOC_VERSION: 0.1.6
STYLUA_VERSION: 0.20.0

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
Expand All @@ -12,13 +13,10 @@ on:
pull_request:
branches: [master]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
lint:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4

Expand All @@ -31,11 +29,21 @@ jobs:
- name: Check code with glualint
run: ./glualint .

style:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4

- uses: JohnnyMorganz/stylua-action@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ env.STYLUA_VERSION }}
args: --check .

doc-check:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v4

Expand Down
1 change: 1 addition & 0 deletions .styluaignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
lua/terrortown/lang/*.lua
10 changes: 10 additions & 0 deletions stylua.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
column_width = 100
line_endings = "Unix"
indent_type = "Spaces"
indent_width = 4
quote_style = "ForceDouble"
call_parentheses = "Always"
collapse_simple_statement = "Never"

[sort_requires]
enabled = false

0 comments on commit 268701e

Please sign in to comment.