Skip to content

Commit 24b5fbb

Browse files
committed
ci: Add luau-lsp type checking github action and integration
1 parent af926ec commit 24b5fbb

File tree

12 files changed

+85
-20
lines changed

12 files changed

+85
-20
lines changed

.github/workflows/build.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,11 @@ jobs:
44
lint:
55
uses: ./.github/workflows/lint.yml
66

7+
luau:
8+
uses: ./.github/workflows/luau.yml
9+
710
release:
8-
needs: lint
11+
needs: [lint, luau]
912
runs-on: ubuntu-latest
1013
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
1114
steps:

.github/workflows/lint-external-prs.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,6 @@ jobs:
66
lint:
77
if: "github.event.pull_request.head.repo.fork"
88
uses: ./.github/workflows/lint.yml
9+
luau:
10+
if: "github.event.pull_request.head.repo.fork"
11+
uses: ./.github/workflows/luau.yml

.github/workflows/luau.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# Reusable workflow that analyzes the repository!
2+
name: luau
3+
on:
4+
workflow_call
5+
jobs:
6+
lint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout repository
10+
uses: actions/checkout@v2
11+
12+
- name: Setup Aftman
13+
uses: ok-nick/setup-aftman@v0.4.2
14+
with:
15+
version: 'v0.3.0'
16+
token: ${{ secrets.GITHUB_TOKEN }}
17+
18+
- name: Generate Sourcemap
19+
run: npm run build:sourcemap
20+
21+
- name: Luau-lsp analyze
22+
run: npm run lint:luau

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ sourcemap.json
1010
dist
1111
*.tsbuildinfo
1212
.DS_Store
13+
globalTypes.d.lua
1314

1415
# Normally it's a good idea to commit this. However, in this mono-repo scenario with linking
1516
# it adds a ton of noise and no real gain. Also we have seen no gains from reproducing

.luaurc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"languageMode": "strict",
3-
"lint": { "*": true },
4-
"lintErrors": true,
5-
"typeErrors": true,
6-
"globals": []
2+
"languageMode": "nocheck",
3+
"lintErrors": true,
4+
"lint": {
5+
"*": true
6+
}
77
}

.vscode/extensions.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
{
22
"recommendations": [
3-
"kampfkarren.selene-vscode",
4-
"nightrains.robloxlsp",
5-
"shardulm94.trailing-spaces"
3+
"kampfkarren.selene-vscode",
4+
"johnnymorganz.luau-lsp",
5+
"johnnymorganz.stylua",
6+
"shardulm94.trailing-spaces",
7+
"esbenp.prettier-vscode"
68
]
79
}

.vscode/settings.json

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
11
{
2-
"files.exclude": {
3-
"*.sublime-workspace": true,
4-
"node_modules": true,
5-
"out": true,
6-
"roblox.toml": true
7-
},
8-
"Lua.diagnostics.enable": false,
9-
"files.trimTrailingWhitespace": true
2+
"files.exclude": {
3+
"*.sublime-workspace": true,
4+
"node_modules": true,
5+
"out": true,
6+
"roblox.toml": true
7+
},
8+
"luau-lsp.server.path": "/Users/jonnen/.aftman/bin/luau-lsp",
9+
"luau-lsp.ignoreGlobs": ["**/node_modules/**"],
10+
"luau-lsp.fflags.enableNewSolver": true,
11+
"[lua]": {
12+
"editor.defaultFormatter": "JohnnyMorganz.stylua",
13+
"editor.formatOnSave": true,
14+
"editor.formatOnSaveMode": "file"
15+
},
16+
"[typescript]": {
17+
"editor.defaultFormatter": "esbenp.prettier-vscode",
18+
"editor.formatOnSave": true,
19+
"editor.formatOnSaveMode": "file"
20+
},
21+
"files.trimTrailingWhitespace": true
1022
}

aftman.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@ selene = "Kampfkarren/selene@0.28.0"
99
moonwave-extractor = "UpliftGames/moonwave@1.3.0"
1010
mantle = "blake-mealey/mantle@0.10.7"
1111
remodel = "rojo-rbx/remodel@0.9.1"
12-
luau-lsp = "JohnnyMorganz/luau-lsp@1.27.1"
12+
luau-lsp = "Quenty/luau-lsp@1.41.0-quenty"

package.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,13 @@
1616
"moonwave": "^1.1.2"
1717
},
1818
"scripts": {
19+
"build:sourcemap": "rojo sourcemap default.project.json --output sourcemap.json",
20+
"build:link": "npx lerna exec --parallel -- npm install --no-package-lock --no-audit --no-fund",
21+
"lint:luau": "luau-lsp analyze --sourcemap=sourcemap.json --base-luaurc=.luaurc --defs=globalTypes.d.lua --flag:LuauSolverV2=true --ignore=**/node_modules/** --ignore=**/*.spec.lua --ignore=**/*.story.lua src",
22+
"lint:moonwave": "npx lerna exec --parallel -- moonwave-extractor extract src",
23+
"lint:selene": "npx lerna exec -- selene --config=../../selene.toml src",
24+
"postinstall": "npm run build:link",
25+
"prelint:luau": "npm run build:sourcemap && node tools/scripts/download-roblox-types.js",
1926
"release": "auto shipit"
2027
},
2128
"author": "James Onnen <rbxquenty@gmail.com>",

selene.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# This file specifies selene linting rules
2-
32
std = "roblox+testez"
3+
exclude = ["**/node_modules/**" ]
44

55
[rules]
66
if_same_then_else = "allow" # This actually makes code less clear sometimes

0 commit comments

Comments
 (0)