fix(client): resolve all gdlint warnings — zero warnings policy
Fix 354 gdlint warnings across 65 files: 194 class-definitions-order (reorder declarations), 138 max-line-length (split long lines), 22 code issues (unused args, no-else-return, naming). Update .gdlintrc to exclude addons/ and raise max-public-methods for test files. No logic changes — declaration order, whitespace, and naming only. Ticket: #783 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
class_name TestAiDialogueSprint26
|
||||
extends GdUnitTestSuite
|
||||
|
||||
const SETTINGS_DIALOG_SCENE = preload("res://ui/settings_dialog.tscn")
|
||||
|
||||
var _original_ai_enabled: bool = true
|
||||
|
||||
@@ -345,7 +346,7 @@ func test_hardware_classify_degradation_ok_at_exact_40_percent() -> void:
|
||||
|
||||
func test_settings_dialog_exposes_ai_dialogue_label_text_method() -> void:
|
||||
# settings_dialog needs a testable API — hardcoded UI strings are easy to drift.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -359,7 +360,7 @@ func test_settings_dialog_exposes_ai_dialogue_label_text_method() -> void:
|
||||
|
||||
func test_settings_dialog_ai_dialogue_label_is_correct() -> void:
|
||||
# D-138: label must be exactly "AI-Enhanced Dialogue" (Jeroen's wording).
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -377,7 +378,7 @@ func test_settings_dialog_ai_dialogue_label_is_correct() -> void:
|
||||
func test_settings_dialog_toggle_disabled_when_hardware_fails() -> void:
|
||||
# D-138 §8: RAM < 1.6 GB → feature disabled, toggle greyed out.
|
||||
# Player receives message but cannot enable the feature.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -396,7 +397,7 @@ func test_settings_dialog_toggle_disabled_when_hardware_fails() -> void:
|
||||
|
||||
func test_settings_dialog_toggle_enabled_when_hardware_passes() -> void:
|
||||
# "pass" → toggle available to interact with.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -415,7 +416,7 @@ func test_settings_dialog_toggle_enabled_when_hardware_passes() -> void:
|
||||
|
||||
func test_settings_dialog_toggle_enabled_when_hardware_marginal() -> void:
|
||||
# D-138 §8: "marginal" → warn but let player proceed. Never force-disable.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -439,8 +440,8 @@ func test_hardware_detector_benchmark_cache_path_is_correct() -> void:
|
||||
var det := _get_detector()
|
||||
if det == null:
|
||||
return
|
||||
assert_str(det.BENCHMARK_CACHE_PATH).override_failure_message(
|
||||
"BENCHMARK_CACHE_PATH must be 'user://ai-dialogue-config.json' (D-138 §8)"
|
||||
assert_str(det.benchmark_cache_path).override_failure_message(
|
||||
"benchmark_cache_path must be 'user://ai-dialogue-config.json' (D-138 §8)"
|
||||
).is_equal("user://ai-dialogue-config.json")
|
||||
|
||||
|
||||
@@ -766,7 +767,7 @@ func test_hardware_detector_battery_suspend_preserves_player_pref_false() -> voi
|
||||
|
||||
|
||||
func test_settings_dialog_inference_suspended_state_defaults_false() -> void:
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -779,7 +780,7 @@ func test_settings_dialog_inference_suspended_state_defaults_false() -> void:
|
||||
|
||||
|
||||
func test_settings_dialog_set_inference_suspended_true() -> void:
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -794,7 +795,7 @@ func test_settings_dialog_set_inference_suspended_true() -> void:
|
||||
|
||||
func test_settings_dialog_resume_clears_suspended_state() -> void:
|
||||
# D-138 §8: resume when plugged in — suspended state clears.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -813,7 +814,7 @@ func test_settings_dialog_toggle_remains_enabled_when_battery_suspended() -> voi
|
||||
# Battery suspend auto-pauses inference but must NOT grey the toggle —
|
||||
# the player can click it to override the suspension.
|
||||
# Only hardware "fail" (RAM < 1.6 GB) may disable the toggle.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -829,7 +830,7 @@ func test_settings_dialog_toggle_remains_enabled_when_battery_suspended() -> voi
|
||||
|
||||
func test_settings_dialog_toggle_enabled_after_resume() -> void:
|
||||
# After resume (plug-in), toggle must be enabled again.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -847,7 +848,7 @@ func test_settings_dialog_toggle_enabled_after_resume() -> void:
|
||||
func test_settings_dialog_toggle_disabled_by_hardware_fail_even_when_suspended() -> void:
|
||||
# Hardware "fail" disables the toggle regardless of battery state.
|
||||
# RAM < 1.6 GB is the only hard disable — battery suspend is not.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -864,7 +865,7 @@ func test_settings_dialog_toggle_disabled_by_hardware_fail_even_when_suspended()
|
||||
func test_settings_dialog_warning_label_shown_when_battery_suspended() -> void:
|
||||
# When inference is battery-suspended, a warning label must be visible
|
||||
# so the player knows why inference isn't running (even though toggle is enabled).
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
@@ -882,7 +883,7 @@ func test_settings_dialog_warning_label_shown_when_battery_suspended() -> void:
|
||||
|
||||
func test_settings_dialog_warning_label_hidden_when_not_suspended() -> void:
|
||||
# Warning label must not show when plugged in — no battery message needed.
|
||||
var scene := load("res://ui/settings_dialog.tscn") as PackedScene
|
||||
var scene := SETTINGS_DIALOG_SCENE
|
||||
if scene == null:
|
||||
push_warning("TestAiDialogueSprint26: settings_dialog.tscn not found — skipped")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user