diff --git a/.github/workflows/luacheck.yml b/.github/workflows/luacheck.yml index 4421a7e0320..2853df13ad0 100644 --- a/.github/workflows/luacheck.yml +++ b/.github/workflows/luacheck.yml @@ -65,3 +65,31 @@ jobs: report_paths: 'busted.xml' check_name: 'Lua Test Report' annotate_only: ${{ (github.event.pull_request.head.repo.full_name != github.repository) }} + + luals-code-style: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - id: lua-changed-files + uses: tj-actions/changed-files@v42 + with: + files: | + lua/wikis/**/*.lua + + - name: Setup LuaLS + if: steps.lua-changed-files.outputs.any_changed == 'true' + run: | + mkdir -p ~/.local/bin/luals + curl -L https://github.com/LuaLS/lua-language-server/releases/download/3.17.1/lua-language-server-3.17.1-linux-x64.tar.gz | tar -xzv -C ~/.local/bin/luals + + - name: Check + if: steps.lua-changed-files.outputs.any_changed == 'true' + shell: bash + run: | + ~/.local/bin/luals/bin/lua-language-server --check ./ | tee luals-check && true + cat luals-check | (sed -e 's/\x1b\[[0-9;]*m//g'| sed -n 's/\(lua[^:]\+\):\([[:digit:]]*\):[[:digit:]]* \[Warning\] /::error file=\1,line=\2::/p') | (! grep -E $(echo ${{ steps.lua-changed-files.outputs.all_changed_files }} | sed -- 's/ /|/')) + echo "| | Files | Errors |" >> $GITHUB_STEP_SUMMARY + echo "|-|-------|----------|" >> $GITHUB_STEP_SUMMARY + echo "| LuaLS check | $(find lua -name '*.lua' | wc -l) | $(cat luals-check | grep 'Warning' | wc -l) |" >> $GITHUB_STEP_SUMMARY diff --git a/lua/snapshot.mjs b/lua/snapshot.mjs index b30c21d6748..82de065097c 100644 --- a/lua/snapshot.mjs +++ b/lua/snapshot.mjs @@ -30,6 +30,13 @@ const PIXELMATCH_OPTIONS = { threshold: 0.1 }; args: ['--disable-web-security'] }); const page = await browser.newPage({ viewport: VIEWPORT }); + page.on('console', msg => { + const type = msg.type(); + const text = msg.text(); + if ((type === 'error' || type === 'warning')) { + console.log(`BROWSER ${type.toUpperCase()}`, text); + } + }); await page.goto(`file://${htmlPath}`, {waitUntil: "networkidle"}); const newScreenshotBuffer = await page.screenshot({ animations: 'disabled' }); await browser.close(); diff --git a/lua/spec/snapshots/LeagueIcon.generate_copy_paste_gen.png b/lua/spec/snapshots/LeagueIcon.generate_copy_paste_gen.png index 63d5261e5aa..4c20f47b97e 100644 Binary files a/lua/spec/snapshots/LeagueIcon.generate_copy_paste_gen.png and b/lua/spec/snapshots/LeagueIcon.generate_copy_paste_gen.png differ diff --git a/lua/spec/snapshots/Slider.png b/lua/spec/snapshots/Slider.png index a42d2ee5df4..37491c62b57 100644 Binary files a/lua/spec/snapshots/Slider.png and b/lua/spec/snapshots/Slider.png differ diff --git a/lua/spec/snapshots/date range display.png b/lua/spec/snapshots/date range display.png index c43140c286a..d88082d1f0a 100644 Binary files a/lua/spec/snapshots/date range display.png and b/lua/spec/snapshots/date range display.png differ diff --git a/lua/spec/snapshots/dota2 rankings.png b/lua/spec/snapshots/dota2 rankings.png index 9f13ca2cea6..efdb286e97a 100644 Binary files a/lua/spec/snapshots/dota2 rankings.png and b/lua/spec/snapshots/dota2 rankings.png differ diff --git a/lua/spec/snapshots/infobox_league_apexlegends.png b/lua/spec/snapshots/infobox_league_apexlegends.png index 3506fdc1daf..233f01a9aeb 100644 Binary files a/lua/spec/snapshots/infobox_league_apexlegends.png and b/lua/spec/snapshots/infobox_league_apexlegends.png differ diff --git a/lua/spec/snapshots/infobox_league_counterstrike.png b/lua/spec/snapshots/infobox_league_counterstrike.png index c277cb4c138..0341ac21dd6 100644 Binary files a/lua/spec/snapshots/infobox_league_counterstrike.png and b/lua/spec/snapshots/infobox_league_counterstrike.png differ diff --git a/lua/spec/snapshots/infobox_league_dota2.png b/lua/spec/snapshots/infobox_league_dota2.png index 20d0704ca69..5bc43aff940 100644 Binary files a/lua/spec/snapshots/infobox_league_dota2.png and b/lua/spec/snapshots/infobox_league_dota2.png differ diff --git a/lua/spec/snapshots/infobox_league_leagueoflegends.png b/lua/spec/snapshots/infobox_league_leagueoflegends.png index c277cb4c138..0341ac21dd6 100644 Binary files a/lua/spec/snapshots/infobox_league_leagueoflegends.png and b/lua/spec/snapshots/infobox_league_leagueoflegends.png differ diff --git a/lua/spec/snapshots/infobox_league_mobilelegends.png b/lua/spec/snapshots/infobox_league_mobilelegends.png index c277cb4c138..0341ac21dd6 100644 Binary files a/lua/spec/snapshots/infobox_league_mobilelegends.png and b/lua/spec/snapshots/infobox_league_mobilelegends.png differ diff --git a/lua/spec/snapshots/infobox_league_overwatch.png b/lua/spec/snapshots/infobox_league_overwatch.png index 7d9739e5c02..5f4f4242ddd 100644 Binary files a/lua/spec/snapshots/infobox_league_overwatch.png and b/lua/spec/snapshots/infobox_league_overwatch.png differ diff --git a/lua/spec/snapshots/infobox_league_rainbowsix.png b/lua/spec/snapshots/infobox_league_rainbowsix.png index c1a13e78f25..00bbe611b18 100644 Binary files a/lua/spec/snapshots/infobox_league_rainbowsix.png and b/lua/spec/snapshots/infobox_league_rainbowsix.png differ diff --git a/lua/spec/snapshots/infobox_league_rocketleague.png b/lua/spec/snapshots/infobox_league_rocketleague.png index c277cb4c138..0341ac21dd6 100644 Binary files a/lua/spec/snapshots/infobox_league_rocketleague.png and b/lua/spec/snapshots/infobox_league_rocketleague.png differ diff --git a/lua/spec/snapshots/infobox_league_starcraft2.png b/lua/spec/snapshots/infobox_league_starcraft2.png index d41cc85c6c7..365beb690b6 100644 Binary files a/lua/spec/snapshots/infobox_league_starcraft2.png and b/lua/spec/snapshots/infobox_league_starcraft2.png differ diff --git a/lua/spec/snapshots/infobox_league_valorant.png b/lua/spec/snapshots/infobox_league_valorant.png index c277cb4c138..0341ac21dd6 100644 Binary files a/lua/spec/snapshots/infobox_league_valorant.png and b/lua/spec/snapshots/infobox_league_valorant.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_apexlegends.png b/lua/spec/snapshots/match2_matchlist_smoke_apexlegends.png index 426e0f4a4b9..89e1daa1021 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_apexlegends.png and b/lua/spec/snapshots/match2_matchlist_smoke_apexlegends.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_counterstrike.png b/lua/spec/snapshots/match2_matchlist_smoke_counterstrike.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_counterstrike.png and b/lua/spec/snapshots/match2_matchlist_smoke_counterstrike.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_dota2.png b/lua/spec/snapshots/match2_matchlist_smoke_dota2.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_dota2.png and b/lua/spec/snapshots/match2_matchlist_smoke_dota2.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_leagueoflegends.png b/lua/spec/snapshots/match2_matchlist_smoke_leagueoflegends.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_leagueoflegends.png and b/lua/spec/snapshots/match2_matchlist_smoke_leagueoflegends.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_mobilelegends.png b/lua/spec/snapshots/match2_matchlist_smoke_mobilelegends.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_mobilelegends.png and b/lua/spec/snapshots/match2_matchlist_smoke_mobilelegends.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_overwatch.png b/lua/spec/snapshots/match2_matchlist_smoke_overwatch.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_overwatch.png and b/lua/spec/snapshots/match2_matchlist_smoke_overwatch.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_rainbowsix.png b/lua/spec/snapshots/match2_matchlist_smoke_rainbowsix.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_rainbowsix.png and b/lua/spec/snapshots/match2_matchlist_smoke_rainbowsix.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_rocketleague.png b/lua/spec/snapshots/match2_matchlist_smoke_rocketleague.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_rocketleague.png and b/lua/spec/snapshots/match2_matchlist_smoke_rocketleague.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_starcraft2.png b/lua/spec/snapshots/match2_matchlist_smoke_starcraft2.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_starcraft2.png and b/lua/spec/snapshots/match2_matchlist_smoke_starcraft2.png differ diff --git a/lua/spec/snapshots/match2_matchlist_smoke_valorant.png b/lua/spec/snapshots/match2_matchlist_smoke_valorant.png index 2d68aeda2ce..12cd3c3c1a2 100644 Binary files a/lua/spec/snapshots/match2_matchlist_smoke_valorant.png and b/lua/spec/snapshots/match2_matchlist_smoke_valorant.png differ diff --git a/lua/spec/snapshots/prize_pool.png b/lua/spec/snapshots/prize_pool.png index 51a667dff85..74dcd66d32d 100644 Binary files a/lua/spec/snapshots/prize_pool.png and b/lua/spec/snapshots/prize_pool.png differ diff --git a/lua/spec/snapshots/squad_row_apexlegends.png b/lua/spec/snapshots/squad_row_apexlegends.png index 25c9edada21..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_apexlegends.png and b/lua/spec/snapshots/squad_row_apexlegends.png differ diff --git a/lua/spec/snapshots/squad_row_counterstrike.png b/lua/spec/snapshots/squad_row_counterstrike.png index 25c9edada21..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_counterstrike.png and b/lua/spec/snapshots/squad_row_counterstrike.png differ diff --git a/lua/spec/snapshots/squad_row_dota2.png b/lua/spec/snapshots/squad_row_dota2.png index f9ca0b1f363..e5c20f64232 100644 Binary files a/lua/spec/snapshots/squad_row_dota2.png and b/lua/spec/snapshots/squad_row_dota2.png differ diff --git a/lua/spec/snapshots/squad_row_leagueoflegends.png b/lua/spec/snapshots/squad_row_leagueoflegends.png index 6c6561b95eb..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_leagueoflegends.png and b/lua/spec/snapshots/squad_row_leagueoflegends.png differ diff --git a/lua/spec/snapshots/squad_row_mobilelegends.png b/lua/spec/snapshots/squad_row_mobilelegends.png index 6c6561b95eb..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_mobilelegends.png and b/lua/spec/snapshots/squad_row_mobilelegends.png differ diff --git a/lua/spec/snapshots/squad_row_overwatch.png b/lua/spec/snapshots/squad_row_overwatch.png index ea576c31081..5665cf34d8b 100644 Binary files a/lua/spec/snapshots/squad_row_overwatch.png and b/lua/spec/snapshots/squad_row_overwatch.png differ diff --git a/lua/spec/snapshots/squad_row_rocketleague.png b/lua/spec/snapshots/squad_row_rocketleague.png index 25c9edada21..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_rocketleague.png and b/lua/spec/snapshots/squad_row_rocketleague.png differ diff --git a/lua/spec/snapshots/squad_row_starcraft2.png b/lua/spec/snapshots/squad_row_starcraft2.png index 25c9edada21..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_starcraft2.png and b/lua/spec/snapshots/squad_row_starcraft2.png differ diff --git a/lua/spec/snapshots/squad_row_valorant.png b/lua/spec/snapshots/squad_row_valorant.png index 25c9edada21..406546484c5 100644 Binary files a/lua/spec/snapshots/squad_row_valorant.png and b/lua/spec/snapshots/squad_row_valorant.png differ diff --git a/lua/spec/snapshots/tabs_dynamic_variants.png b/lua/spec/snapshots/tabs_dynamic_variants.png index caa6a9c47a4..364d7b94833 100644 Binary files a/lua/spec/snapshots/tabs_dynamic_variants.png and b/lua/spec/snapshots/tabs_dynamic_variants.png differ diff --git a/lua/spec/snapshots/team_participant.png b/lua/spec/snapshots/team_participant.png index 226f0f4d85d..58b2be3e825 100644 Binary files a/lua/spec/snapshots/team_participant.png and b/lua/spec/snapshots/team_participant.png differ diff --git a/lua/spec/snapshots/transfer_row_apexlegends.png b/lua/spec/snapshots/transfer_row_apexlegends.png index 7a4ff8efb4c..dcb0ad80dff 100644 Binary files a/lua/spec/snapshots/transfer_row_apexlegends.png and b/lua/spec/snapshots/transfer_row_apexlegends.png differ diff --git a/lua/spec/snapshots/transfer_row_counterstrike.png b/lua/spec/snapshots/transfer_row_counterstrike.png index 7a4ff8efb4c..dcb0ad80dff 100644 Binary files a/lua/spec/snapshots/transfer_row_counterstrike.png and b/lua/spec/snapshots/transfer_row_counterstrike.png differ diff --git a/lua/spec/snapshots/transfer_row_dota2.png b/lua/spec/snapshots/transfer_row_dota2.png index 7a4ff8efb4c..dcb0ad80dff 100644 Binary files a/lua/spec/snapshots/transfer_row_dota2.png and b/lua/spec/snapshots/transfer_row_dota2.png differ diff --git a/lua/spec/snapshots/transfer_row_leagueoflegends.png b/lua/spec/snapshots/transfer_row_leagueoflegends.png index 4200e05eb0d..725d6bd6dfb 100644 Binary files a/lua/spec/snapshots/transfer_row_leagueoflegends.png and b/lua/spec/snapshots/transfer_row_leagueoflegends.png differ diff --git a/lua/spec/snapshots/transfer_row_mobilelegends.png b/lua/spec/snapshots/transfer_row_mobilelegends.png index 4200e05eb0d..725d6bd6dfb 100644 Binary files a/lua/spec/snapshots/transfer_row_mobilelegends.png and b/lua/spec/snapshots/transfer_row_mobilelegends.png differ diff --git a/lua/spec/snapshots/transfer_row_overwatch.png b/lua/spec/snapshots/transfer_row_overwatch.png index 7a4ff8efb4c..dcb0ad80dff 100644 Binary files a/lua/spec/snapshots/transfer_row_overwatch.png and b/lua/spec/snapshots/transfer_row_overwatch.png differ diff --git a/lua/spec/snapshots/transfer_row_rainbowsix.png b/lua/spec/snapshots/transfer_row_rainbowsix.png index 7a4ff8efb4c..dcb0ad80dff 100644 Binary files a/lua/spec/snapshots/transfer_row_rainbowsix.png and b/lua/spec/snapshots/transfer_row_rainbowsix.png differ diff --git a/lua/spec/snapshots/transfer_row_rocketleague.png b/lua/spec/snapshots/transfer_row_rocketleague.png index 4200e05eb0d..725d6bd6dfb 100644 Binary files a/lua/spec/snapshots/transfer_row_rocketleague.png and b/lua/spec/snapshots/transfer_row_rocketleague.png differ diff --git a/lua/spec/snapshots/transfer_row_starcraft2.png b/lua/spec/snapshots/transfer_row_starcraft2.png index 4a5577208b0..e5ab23fa7fc 100644 Binary files a/lua/spec/snapshots/transfer_row_starcraft2.png and b/lua/spec/snapshots/transfer_row_starcraft2.png differ diff --git a/lua/spec/snapshots/transfer_row_valorant.png b/lua/spec/snapshots/transfer_row_valorant.png index 7a4ff8efb4c..dcb0ad80dff 100644 Binary files a/lua/spec/snapshots/transfer_row_valorant.png and b/lua/spec/snapshots/transfer_row_valorant.png differ diff --git a/lua/wikis/ageofempires/PrizePool/Custom.lua b/lua/wikis/ageofempires/PrizePool/Custom.lua index 09e04f694a6..f52f05582d8 100644 --- a/lua/wikis/ageofempires/PrizePool/Custom.lua +++ b/lua/wikis/ageofempires/PrizePool/Custom.lua @@ -33,8 +33,7 @@ function CustomPrizePool.run(frame) args.syncPlayers = true args.import = Logic.nilOr(Logic.readBoolOrNil(args.import), false) - local prizePool = PrizePool(args) - :create() + local prizePool = PrizePool(args):create() prizePool:setLpdbInjector(CustomLpdbInjector())