Skip to content

Commit 28f965d

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

12 files changed

Lines changed: 89 additions & 24 deletions

File tree

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ jobs:
55
uses: ./.github/workflows/lint.yml
66

77
release:
8-
needs: lint
8+
needs: [lint]
99
runs-on: ubuntu-latest
1010
if: "!contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'skip ci')"
1111
steps:

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ on: [pull_request_target]
55
jobs:
66
lint:
77
if: "github.event.pull_request.head.repo.fork"
8-
uses: ./.github/workflows/lint.yml
8+
uses: ./.github/workflows/lint.yml

.github/workflows/lint.yml

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,26 @@
1-
# Reusable workflow that lints the repository!
21
name: lint
32
on:
43
workflow_call
54
jobs:
6-
lint:
5+
luau-lsp:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- name: Checkout repository
9+
uses: actions/checkout@v2
10+
11+
- name: Setup Aftman
12+
uses: ok-nick/setup-aftman@v0.4.2
13+
with:
14+
version: 'v0.3.0'
15+
token: ${{ secrets.GITHUB_TOKEN }}
16+
17+
- name: Generate Sourcemap
18+
run: npm run build:sourcemap
19+
20+
- name: luau-lsp analyze
21+
run: npm run lint:luau
22+
23+
selene:
724
runs-on: ubuntu-latest
825
steps:
926
- name: Checkout repository
@@ -21,6 +38,17 @@ jobs:
2138
- name: Run Selene
2239
run: selene src
2340

41+
moonwave:
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Checkout repository
45+
uses: actions/checkout@v2
46+
47+
- name: Setup Aftman
48+
uses: ok-nick/setup-aftman@v0.4.2
49+
with:
50+
version: 'v0.3.0'
51+
token: ${{ secrets.GITHUB_TOKEN }}
52+
2453
- name: Run moonwave-extractor
25-
if: success() || failure()
2654
run: moonwave-extractor extract src

.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": false,
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=false --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)