Skip to content

Round calculated colours to protect against floating point precision errors.#103

Open
argium wants to merge 2 commits into
mainfrom
cleanup
Open

Round calculated colours to protect against floating point precision errors.#103
argium wants to merge 2 commits into
mainfrom
cleanup

Conversation

@argium
Copy link
Copy Markdown
Owner

@argium argium commented May 23, 2026

Moved IsDeathKnight into ClassUtil.
Removed unused ColorUtil.AreEqual
Minor cleanup

…errors.

Moved IsDeathKnight into ClassUtil.
Removed unused ColorUtil.AreEqual
Copilot AI review requested due to automatic review settings May 23, 2026 09:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 23, 2026

Test Results

894 tests  +1   894 ✅ +1   2s ⏱️ -1s
  5 suites ±0     0 💤 ±0 
  5 files   ±0     0 ❌ ±0 

Results for commit e3e8a68. ± Comparison against base commit d91a04b.

This pull request removes 132 and adds 133 tests. Note that renamed tests count towards both.
Tests.ClassUtil_spec_lua:109 ‑ ClassUtil GetResourceType returns souls for vengeance demon hunters
Tests.ClassUtil_spec_lua:117 ‑ ClassUtil GetResourceType returns devourerNormal for devourer demon hunters when void meta aura is absent
Tests.ClassUtil_spec_lua:125 ‑ ClassUtil GetResourceType returns devourerMeta for devourer demon hunters when void meta aura is present
Tests.ClassUtil_spec_lua:134 ‑ ClassUtil GetResourceType returns devourerMeta for devourer demon hunters when collapsing star aura is present
Tests.ClassUtil_spec_lua:143 ‑ ClassUtil GetResourceType returns combo points for feral druids in cat form
Tests.ClassUtil_spec_lua:148 ‑ ClassUtil GetResourceType returns essence for all evoker specs
Tests.ClassUtil_spec_lua:153 ‑ ClassUtil GetResourceType returns nil for all hunter specs
Tests.ClassUtil_spec_lua:157 ‑ ClassUtil GetResourceType returns arcane charges for arcane mages, nil for fire, and icicles for frost
Tests.ClassUtil_spec_lua:163 ‑ ClassUtil GetResourceType returns chi for windwalker monks, nil for brewmaster and mistweaver
Tests.ClassUtil_spec_lua:170 ‑ ClassUtil GetResourceType returns holy power for all paladin specs
…
Tests.ClassUtil_spec_lua:115 ‑ ClassUtil GetResourceType returns nil for all death knight specs
Tests.ClassUtil_spec_lua:127 ‑ ClassUtil GetResourceType returns souls for vengeance demon hunters
Tests.ClassUtil_spec_lua:135 ‑ ClassUtil GetResourceType returns devourerNormal for devourer demon hunters when void meta aura is absent
Tests.ClassUtil_spec_lua:143 ‑ ClassUtil GetResourceType returns devourerMeta for devourer demon hunters when void meta aura is present
Tests.ClassUtil_spec_lua:152 ‑ ClassUtil GetResourceType returns devourerMeta for devourer demon hunters when collapsing star aura is present
Tests.ClassUtil_spec_lua:161 ‑ ClassUtil GetResourceType returns combo points for feral druids in cat form
Tests.ClassUtil_spec_lua:166 ‑ ClassUtil GetResourceType returns essence for all evoker specs
Tests.ClassUtil_spec_lua:171 ‑ ClassUtil GetResourceType returns nil for all hunter specs
Tests.ClassUtil_spec_lua:175 ‑ ClassUtil GetResourceType returns arcane charges for arcane mages, nil for fire, and icicles for frost
Tests.ClassUtil_spec_lua:181 ‑ ClassUtil GetResourceType returns chi for windwalker monks, nil for brewmaster and mistweaver
…

♻️ This comment has been updated with latest results.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors class detection and constant definitions while tightening color/float-related comparisons by removing an unused color equality helper and updating affected tests/call sites.

Changes:

  • Moved IsDeathKnight from ECM.lua into ClassUtil.lua and updated all consumers (UI + module + tests).
  • Removed unused ColorUtil.AreEqual and adjusted tests that previously validated or stubbed it.
  • Refactored Constants.lua to directly expose several constant tables (and split module load order from chain order), updating runtime enable logic to use MODULE_LOAD_ORDER.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
UI/RuneBarOptions.lua Switches DK gating to ns.ClassUtil.IsDeathKnight() for RuneBar options visibility/disable logic.
UI/ResourceBarOptions.lua Updates ResourceBar options disable predicate to ns.ClassUtil.IsDeathKnight.
Tests/TestHelpers.lua Updates options test environment to provide ns.ClassUtil.IsDeathKnight (instead of ns.IsDeathKnight).
Tests/Modules/RuneBar_spec.lua Updates RuneBar tests to stub ClassUtil.IsDeathKnight.
Tests/FrameUtil_spec.lua Removes now-unneeded ns.ColorUtil.AreEqual stub from FrameUtil tests.
Tests/ColorUtil_spec.lua Removes AreEqual test and updates test harness setup (nit noted in review comment).
Tests/ClassUtil_spec.lua Adds unit tests for ClassUtil.IsDeathKnight.
Runtime.lua Switches module enable iteration to C.MODULE_LOAD_ORDER.
Modules/RuneBar.lua Updates DK checks to ns.ClassUtil.IsDeathKnight().
EnhancedCooldownManager.code-workspace Adjusts Lua diagnostics globals list.
ECM.lua Removes ns.IsDeathKnight implementation from root namespace.
Constants.lua Exposes constant tables directly on constants and introduces MODULE_LOAD_ORDER.
ColorUtil.lua Removes unused ColorUtil.AreEqual.
ClassUtil.lua Adds ClassUtil.IsDeathKnight and keeps class/resource utilities centralized.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Tests/ColorUtil_spec.lua Outdated
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants