Skip to content

Commit

Permalink
Add luau-lsp analyze job to CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptibell committed Sep 25, 2023
1 parent de0a570 commit 3b98303
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 10 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ jobs:
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: true

- name: Install Rust
uses: dtolnay/rust-toolchain@stable
Expand All @@ -34,6 +32,22 @@ jobs:
- name: Check Formatting
run: just fmt-check

analyze:
name: Analyze and lint Luau files
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Install Just
uses: extractions/setup-just@v1

- name: Install Tooling
uses: ok-nick/[email protected]

- name: Analyze
run: just analyze

ci:
needs: ["fmt"]
strategy:
Expand Down
13 changes: 11 additions & 2 deletions .justfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ test-bin *ARGS:
fmt:
#!/usr/bin/env bash
set -euo pipefail
stylua scripts tests types \
stylua .lune scripts tests types \
--glob "tests/**/*.luau" \
--glob "!tests/roblox/rbx-test-files/**"
cargo fmt
Expand All @@ -55,11 +55,20 @@ fmt:
fmt-check:
#!/usr/bin/env bash
set -euo pipefail
stylua scripts tests types \
stylua .lune scripts tests types \
--glob "tests/**/*.luau" \
--glob "!tests/roblox/rbx-test-files/**"
cargo fmt --check
# Analyze and lint Luau files using luau-lsp
[no-exit-message]
analyze:
#!/usr/bin/env bash
set -euo pipefail
luau-lsp analyze .lune scripts tests types \
--settings=".vscode/settings.json" \
--ignore="tests/roblox/rbx-test-files/**"
# Zips up the built binary into a single zip file
[no-exit-message]
zip-release TARGET_TRIPLE:
Expand Down
6 changes: 0 additions & 6 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
{
// Luau - disable Roblox features, enable Lune typedefs & requires
"luau-lsp.sourcemap.enabled": false,
"luau-lsp.types.roblox": false,
"luau-lsp.require.mode": "relativeToFile",
"luau-lsp.require.directoryAliases": {
"@lune/": "./types/"
},
// Luau - ignore type defs file in docs dir and dev scripts we use
"luau-lsp.ignoreGlobs": [
"docs/*.d.luau",
"packages/lib-roblox/scripts/*.luau",
"tests/roblox/rbx-test-files/**/*.lua",
"tests/roblox/rbx-test-files/**/*.luau"
],
// Rust
"rust-analyzer.check.command": "clippy",
// Formatting
"editor.formatOnSave": true,
"stylua.searchParentDirectories": true,
"prettier.tabWidth": 2,
Expand Down

0 comments on commit 3b98303

Please sign in to comment.