Skip to content

Commit 9f3c441

Browse files
committed
Merge branch 'master' of https://github.com/CuteOne/BadRotations
2 parents 7662442 + e67c599 commit 9f3c441

File tree

10 files changed

+114
-222
lines changed

10 files changed

+114
-222
lines changed

Diff for: .github/workflows/lint.yaml

+8-19
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,6 @@
1-
# name: Lint
2-
# on: [push, pull_request]
3-
4-
# jobs:
5-
# lint:
6-
# name: Lint
7-
# runs-on: ubuntu-latest
8-
# steps:
9-
# - name: checkout
10-
# uses: actions/checkout@v4
11-
# with:
12-
# repository: 'CuteOne/BadRotations'
13-
# - name: wow-lint
14-
# uses: davidcraig/[email protected]
15-
# with:
16-
# path-to-files: '**/*.lua'
17-
181
name: Lint
192

20-
on: [push, pull_request, workflow_dispatch]
3+
on: [push]
214

225
concurrency:
236
group: ${{ github.workflow }}-${{ github.ref }}
@@ -31,7 +14,7 @@ jobs:
3114
contents: read
3215
issues: read
3316
checks: write
34-
pull-requests: write
17+
pull-requests: read
3518
if: (github.actor != 'dependabot[bot]')
3619

3720
steps:
@@ -46,6 +29,12 @@ jobs:
4629
files: |
4730
**.lua
4831
32+
- name: List changed files
33+
run: |
34+
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
35+
echo "$file was changed"
36+
done
37+
4938
- name: Lua Check
5039
if: steps.changed-files.outputs.any_changed == 'true'
5140
uses: Kong/public-shared-actions/code-check-actions/lua-lint@main

Diff for: .github/workflows/lintPR.yaml

+96
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
name: Lint-PR
2+
3+
on:
4+
pull_request_target:
5+
types: ['opened', 'edited', 'reopened', 'synchronize']
6+
7+
concurrency:
8+
group: ${{ github.workflow }}-${{ github.ref }}
9+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
10+
11+
jobs:
12+
lua-check:
13+
name: Lua Check
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
issues: read
18+
checks: write
19+
pull-requests: write
20+
if: (github.actor != 'dependabot[bot]')
21+
22+
steps:
23+
- name: Checkout source code
24+
uses: actions/checkout@v4
25+
with:
26+
repository: ${{ github.event.pull_request.head.repo.full_name || github.repository }}
27+
28+
# Optional step to run on only changed files
29+
- name: Get changed files
30+
id: changed-files
31+
uses: tj-actions/changed-files@v44
32+
with:
33+
since_last_remote_commit: true
34+
files: |
35+
**.lua
36+
37+
- name: List changed files
38+
run: |
39+
for file in ${{ steps.changed-files.outputs.all_changed_files }}; do
40+
echo "$file was changed"
41+
done
42+
43+
# - name: Lua Check
44+
# if: steps.changed-files.outputs.any_changed == 'true'
45+
# uses: Kong/public-shared-actions/code-check-actions/lua-lint@main
46+
# with:
47+
# # additional_args: '--no-default-config --config .luacheckrc'
48+
# files: ${{ steps.changed-files.outputs.all_changed_files }}
49+
50+
- name: Run Luacheck for static analysis
51+
if: steps.changed-files.outputs.any_changed == 'true'
52+
uses: lunarmodules/luacheck@ababb6d403d634eb74d2c541035e9ede966e710d
53+
continue-on-error: true
54+
with:
55+
args: "--codes --ranges --formatter JUnit -q ${{ steps.changed-files.outputs.all_changed_files }} > luacheck_${{github.sha}}.xml"
56+
57+
- name: Upload results to workflow
58+
if: always()
59+
uses: actions/upload-artifact@v4
60+
with:
61+
name: luacheck_results.zip
62+
path: |
63+
luacheck_${{github.sha}}.xml
64+
if-no-files-found: warn
65+
66+
# - name: Print Luacheck results
67+
# shell: bash
68+
# run: |
69+
# cat luacheck_${{github.sha}}.xml
70+
71+
# when using the regular GITHUB_TOKEN, the check-run created by this step will be assigned to a
72+
# random workflow in the GH UI. to prevent this, we can force the check-run to be created in a separate
73+
# check-suite, which is created automatically if we use the credentials of a GitHub App
74+
# Ref: https://github.com/EnricoMi/publish-unit-test-result-action/issues/181
75+
# Publishing: https://github.com/EnricoMi/publish-unit-test-result-action#publishing-test-results
76+
- name: Luacheck Report
77+
uses: EnricoMi/publish-unit-test-result-action@v2
78+
if: always() && github.actor != 'dependabot[bot]'
79+
with:
80+
files: |
81+
luacheck_${{github.sha}}.xml
82+
check_name: Luacheck Report
83+
comment_mode: always
84+
action_fail: true
85+
fail_on: 'errors'
86+
87+
# name: Luacheck
88+
# on: [push, pull_request]
89+
# jobs:
90+
# lua-lint:
91+
# runs-on: ubuntu-latest
92+
# steps:
93+
# - name: Checkout
94+
# uses: actions/checkout@v4
95+
# - name: Luacheck linter
96+
# uses: lunarmodules/luacheck@v1

Diff for: Rotations/Evoker/Initial/Blank.lua

-174
This file was deleted.

Diff for: Rotations/Hunter/Initial/InitialHunter.lua

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ actionList.Interrupt = function()
177177
if br.canInterrupt(thisUnit,ui.value("Interrupt At")) then
178178
-- Freezing Trap
179179
if ui.hecked("Freezing Trap") and cast.able.freezingTrap() then
180-
for i = 1, #enemies.yards40 do
181-
thisUnit = enemies.yards40[i]
180+
for j = 1, #enemies.yards40 do
181+
thisUnit = enemies.yards40[j]
182182
if unit.distance(thisUnit) > 8 and cast.timeRemain(thisUnit) > 3 then
183183
if cast.freezingTrap(thisUnit,"ground") then return true end
184184
end

Diff for: Rotations/Mage/Initial/CronoMageInitial.lua

-13
Original file line numberDiff line numberDiff line change
@@ -82,17 +82,10 @@ end
8282
local buff
8383
local cast
8484
local cd
85-
local debuff
86-
local has
8785
local mode
88-
local power
89-
local talent
9086
local ui
91-
local pet
92-
local spell
9387
local unit
9488
local units
95-
local use
9689
-- General Locals
9790
local haltProfile
9891
local profileStop
@@ -166,16 +159,10 @@ local function runRotation()
166159
buff = br.player.buff
167160
cast = br.player.cast
168161
cd = br.player.cd
169-
debuff = br.player.debuff
170-
has = br.player.has
171162
mode = br.player.ui.mode
172163
ui = br.player.ui
173-
pet = br.player.pet
174-
spell = br.player.spell
175-
ui = br.player.ui
176164
unit = br.player.unit
177165
units = br.player.units
178-
use = br.player.use
179166
-- General Locals
180167
profileStop = profileStop or false
181168
haltProfile = (unit.inCombat() and profileStop) or br._G.IsMounted() or br.pause() or mode.rotation==4

Diff for: Rotations/Mage/Initial/MageInitial.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ local function createOptions()
3131
-----------------------
3232
section = br.ui:createSection(br.ui.window.profile, "General")
3333

34+
br.ui:checkSectionState(section)
3435
-------------------------
3536
--- DEFENSIVE OPTIONS ---
3637
-------------------------
@@ -183,4 +184,4 @@ br._G.tinsert(br.rotations[id],{
183184
toggles = createToggles,
184185
options = createOptions,
185186
run = runRotation,
186-
})
187+
})

0 commit comments

Comments
 (0)