Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
10 changes: 9 additions & 1 deletion .busted
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,15 @@ return {
"luarules/?.lua", "luarules/?/init.lua",
"luaui/?.lua", "luaui/?/init.lua",
"spec/?.lua", "spec/?/init.lua",
}, ";")
}, ";"),
-- spec_helper installs the Spring/SpringShared/SpringSynced/SpringUnsynced
-- shims that unit-def loading (via Builders.Spring:WithRealUnitDefs)
-- relies on. Without it, any spring-split'd unit def that references
-- SpringShared.GetModOptions() nil-derefs at require-time. Previously
-- only `_all` and `coverage` named tasks set this; default didn't, so
-- `just bar::units` (which runs default) silently swallowed ~20 unit
-- def load failures per run.
helper = "spec/spec_helper.lua",
},
-- Default configuration
verbose = true,
Expand Down
90 changes: 90 additions & 0 deletions .emmyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
{
"$schema": "https://raw.githubusercontent.com/EmmyLuaLs/emmylua-analyzer-rust/main/crates/emmylua_code_analysis/resources/schema.json",
"completion": {
"autoRequireSeparator": "/"
},
"diagnostics": {
"disable": ["duplicate-set-field"],
"globals": [
"Utilities",
"Debug",
"Lava",
"GetModOptionsCopy",
"I18N",

"Turn",
"Move",
"Spin",
"StopSpin",
"WaitForTurn",
"WaitForMove",
"Hide",
"Show",
"Explode",
"EmitSfx",
"StartThread",
"SetSignalMask",
"Signal",
"Sleep",
"GetUnitValue",
"SetUnitValue",
"piece",
"script",
"UnitScript",
"x_axis",
"y_axis",
"z_axis",
"SIG_WALK",
"UNITSCRIPT_DIR",

"widgetHandler",
"gadgetHandler",
"fontHandler",
"LUAUI_DIRNAME",
"socket",
"pairsByKeys",
"SendToUnsynced",
"CallAsTeam",
"handler",
"lowerkeys",
"addon",
"gcinfo",
"loadlib",

"_G",
"self",
"widget",
"gadget",
"GG",
"ghInfo",
"include",

"GameCMD",
"Scenario",
"game_engine",
"SG",
"CMD_AREA_MEX",
"CMD_WANT_CLOAK",
"CMD_WANTED_SPEED",
"GadgetCrashingAircraft",
"ExplosionDefs",
"GL_TEXTURE_2D"
]
},
"runtime": {
"version": "Lua5.1",
"requirePattern": ["?", "?.lua"],
"requireLikeFunction": ["VFS.Include", "include", "shard_include"]
},
"workspace": {
"ignoreDir": [
".vscode",
".devtools",
".lux"
],
"ignoreGlobs": [
"**/.lux/**",
"**/.devtools/**"
]
}
}
41 changes: 41 additions & 0 deletions .github/workflows/type_check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Type Check

on:
push:
branches: ['*']
pull_request:
branches: ['*']
workflow_dispatch:

jobs:
emmylua_check:
name: emmylua_check
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v5
with:
submodules: recursive

- name: Install emmylua_check
env:
# Pin to the same version as the dev container in BAR-Devtools
# (docker/dev.Containerfile -- ARG EMMYLUA_VERSION). Bump both
# at the same time so editor IDE results match CI results.
EMMYLUA_VERSION: 0.22.0
run: |
set -euo pipefail
ARCH=$(uname -m)
case "$ARCH" in
x86_64) ASSET=emmylua_check-linux-x64.tar.gz ;;
aarch64) ASSET=emmylua_check-linux-arm64-glibc.2.17.tar.gz ;;
*) echo "unsupported arch for emmylua_check: $ARCH" >&2; exit 1 ;;
esac
URL="https://github.com/EmmyLuaLs/emmylua-analyzer-rust/releases/download/${EMMYLUA_VERSION}/${ASSET}"
curl -fsSL "$URL" | sudo tar xz -C /usr/local/bin
sudo chmod +x /usr/local/bin/emmylua_check
/usr/local/bin/emmylua_check --version

- name: Run emmylua_check
run: emmylua_check -c .emmyrc.json .
30 changes: 2 additions & 28 deletions .luarc.json
Original file line number Diff line number Diff line change
@@ -1,40 +1,14 @@
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"completion.requireSeparator": "/",
"diagnostics": {
"type": {
"definition": [
".lux/",
"types/",
"recoil-lua-library/library/"
]
}
},
"runtime.path": [
"?",
"?.lua"
],
"runtime.special": {
"VFS.Include": "require",
"include": "require",
"shard_include": "require"
},
"runtime.version": "Lua 5.1",
"semantic": {
"enable": true
},
"workspace": {
"ignoreDir": [
".vscode",
"luaui/Tests",
"luaui/TestsExamples"
],
"library": [
"recoil-lua-library",
"recoil-lua-library/library",
"luarules",
"luaui",
"spec",
"types",
".lux/5.1/bc9d25ebdcc8e85d77e17e27b8d98785b6a08aa20e71c7b98d7438ec7f0a3175-i18n@0.9.2-1/src",
".lux/5.1/test_dependencies/5.1/01a3c364614bddff7370223a5a9c4580f8e62d144384148444c518ec5367a59b-mediator_lua@1.1.2-0/src",
".lux/5.1/test_dependencies/5.1/287e827f4a088d41bba04af5f61a13614346c16fe8150eb7c4246e67d6fd163e-lua-term@0.8-1/src",
".lux/5.1/test_dependencies/5.1/316ac0b30e04e86a253d64886f3b110bd0508267474e6b58a3b973bd6857dbf4-penlight@1.14.0-3/src",
Expand Down
29 changes: 14 additions & 15 deletions EngineOptions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,24 +25,23 @@
-- Example EngineOptions.lua
--

local options =
{
local options = {
{
key="engineoptions",
name="Engine Options",
desc="Engine Options",
type="section",
key = "engineoptions",
name = "Engine Options",
desc = "Engine Options",
type = "section",
},
{
key = 'maxunits',
name = 'Max units',
desc = 'Maximum number of units (including buildings) for each team allowed at the same time',
type = 'number',
section= 'engineoptions',
def = 2000,
min = 1,
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
step = 1,
key = "maxunits",
name = "Max units",
desc = "Maximum number of units (including buildings) for each team allowed at the same time",
type = "number",
section = "engineoptions",
def = 2000,
min = 1,
max = 10000, --- engine caps at lower limit if more than 3 team are ingame
step = 1,
},
}

Expand Down
Loading
Loading