style(lint): flutter analyze 경고 91건 → 0건 전체 정리

- analysis_options.yaml: freezed/g.dart 생성 파일 분석 제외
- game_text_l10n.dart: if문 중괄호 추가, 불필요한 ${} 제거
- iap_service.dart: 불필요한 dart:typed_data import 제거
- pq_logic.dart, combat_text_frames.dart: dangling library doc → library; 추가
- save_picker_dialog.dart: __ → _ (unnecessary_underscores)
- desktop_equipment_panel.dart: 불필요한 import 제거
- test 파일: _localVar → localVar 네이밍, ignore_for_file 추가
This commit is contained in:
JiWoong Sul
2026-03-31 14:22:09 +09:00
parent 068d9da4bd
commit 68a5848510
10 changed files with 126 additions and 116 deletions

View File

@@ -1,5 +1,4 @@
import 'package:asciineverdie/src/core/engine/death_handler.dart';
import 'package:asciineverdie/src/core/model/equipment_container.dart';
import 'package:asciineverdie/src/core/model/equipment_item.dart';
import 'package:asciineverdie/src/core/model/equipment_slot.dart';
import 'package:asciineverdie/src/core/model/game_state.dart';
@@ -13,7 +12,7 @@ void main() {
const handler = DeathHandler();
/// 테스트용 장비 생성 헬퍼
EquipmentItem _makeItem(String name, EquipmentSlot slot) {
EquipmentItem makeItem(String name, EquipmentSlot slot) {
return EquipmentItem(
name: name,
slot: slot,
@@ -25,20 +24,20 @@ void main() {
}
/// 모든 슬롯에 장비가 장착된 Equipment 생성
Equipment _fullyEquipped() {
Equipment fullyEquipped() {
return Equipment(
items: [
EquipmentItem.defaultWeapon(), // 0: 무기(weapon)
_makeItem('Iron Shield', EquipmentSlot.shield),
_makeItem('Iron Helm', EquipmentSlot.helm),
_makeItem('Iron Hauberk', EquipmentSlot.hauberk),
_makeItem('Iron Brassairts', EquipmentSlot.brassairts),
_makeItem('Iron Vambraces', EquipmentSlot.vambraces),
_makeItem('Iron Gauntlets', EquipmentSlot.gauntlets),
_makeItem('Iron Gambeson', EquipmentSlot.gambeson),
_makeItem('Iron Cuisses', EquipmentSlot.cuisses),
_makeItem('Iron Greaves', EquipmentSlot.greaves),
_makeItem('Iron Sollerets', EquipmentSlot.sollerets),
makeItem('Iron Shield', EquipmentSlot.shield),
makeItem('Iron Helm', EquipmentSlot.helm),
makeItem('Iron Hauberk', EquipmentSlot.hauberk),
makeItem('Iron Brassairts', EquipmentSlot.brassairts),
makeItem('Iron Vambraces', EquipmentSlot.vambraces),
makeItem('Iron Gauntlets', EquipmentSlot.gauntlets),
makeItem('Iron Gambeson', EquipmentSlot.gambeson),
makeItem('Iron Cuisses', EquipmentSlot.cuisses),
makeItem('Iron Greaves', EquipmentSlot.greaves),
makeItem('Iron Sollerets', EquipmentSlot.sollerets),
],
bestIndex: 0,
);
@@ -50,7 +49,7 @@ void main() {
/// [level]: 캐릭터 레벨
/// [isBossFight]: 보스전(boss fight) 여부
/// [equipment]: 커스텀 장비
GameState _createState({
GameState createState({
int seed = 42,
int level = 1,
bool isBossFight = false,
@@ -59,7 +58,7 @@ void main() {
final state = GameState(
rng: DeterministicRandom(seed),
traits: Traits.empty().copyWith(level: level),
equipment: equipment ?? _fullyEquipped(),
equipment: equipment ?? fullyEquipped(),
progress: ProgressState.empty().copyWith(
currentCombat: MockFactories.createCombat(),
finalBossState: isBossFight
@@ -75,7 +74,7 @@ void main() {
group('deathInfo 생성', () {
test('사망 시 deathInfo가 올바르게 생성된다', () {
// 준비(arrange): Lv10 캐릭터 - 100% 장비 손실 확률
final state = _createState(level: 10);
final state = createState(level: 10);
// 실행(act)
final result = handler.processPlayerDeath(
@@ -94,7 +93,7 @@ void main() {
});
test('selfDamage 원인으로 사망 시 cause가 올바르다', () {
final state = _createState(level: 1);
final state = createState(level: 1);
final result = handler.processPlayerDeath(
state,
@@ -108,8 +107,8 @@ void main() {
group('보스전(boss fight) 사망', () {
test('보스전 사망 시 장비가 보호된다 (lostCount == 0)', () {
final equipment = _fullyEquipped();
final state = _createState(
final equipment = fullyEquipped();
final state = createState(
level: 10,
isBossFight: true,
equipment: equipment,
@@ -136,7 +135,7 @@ void main() {
});
test('보스전 사망 시 bossLevelingEndTime이 설정된다 (5분)', () {
final state = _createState(isBossFight: true);
final state = createState(isBossFight: true);
final before = DateTime.now().millisecondsSinceEpoch;
final result = handler.processPlayerDeath(
@@ -157,7 +156,7 @@ void main() {
});
test('일반 사망 시 bossLevelingEndTime은 null이다', () {
final state = _createState(level: 1);
final state = createState(level: 1);
final result = handler.processPlayerDeath(
state,
@@ -185,7 +184,7 @@ void main() {
}
expect(lossySeed, isNotNull, reason: '장비 손실 시드를 찾을 수 없음');
final state = _createState(seed: lossySeed!, level: 1);
final state = createState(seed: lossySeed!, level: 1);
final result = handler.processPlayerDeath(
state,
killerName: 'Goblin',
@@ -208,7 +207,7 @@ void main() {
}
expect(safeSeed, isNotNull, reason: '장비 보호 시드를 찾을 수 없음');
final state = _createState(seed: safeSeed!, level: 1);
final state = createState(seed: safeSeed!, level: 1);
final result = handler.processPlayerDeath(
state,
killerName: 'Goblin',
@@ -221,7 +220,7 @@ void main() {
test('Lv10+: 100% 확률로 장비 손실', () {
// Lv10 이상은 항상 100% 손실
final state = _createState(seed: 42, level: 10);
final state = createState(seed: 42, level: 10);
final result = handler.processPlayerDeath(
state,
@@ -249,7 +248,7 @@ void main() {
// Lv10(100% 손실)으로 여러 시드를 반복 테스트
// 무기는 절대 사라지지 않아야 함
for (var s = 0; s < 50; s++) {
final state = _createState(seed: s, level: 10);
final state = createState(seed: s, level: 10);
final result = handler.processPlayerDeath(
state,
killerName: 'Monster',
@@ -280,7 +279,7 @@ void main() {
// 무기만 있고 나머지는 빈 장비
final emptyEquipment = Equipment.empty();
// Equipment.empty()는 기본 무기(Keyboard)만 있음
final state = _createState(
final state = createState(
seed: 42,
level: 10, // 100% 손실 확률
equipment: emptyEquipment,
@@ -300,7 +299,7 @@ void main() {
group('deathCount 증가', () {
test('사망 시 deathCount가 1 증가한다', () {
final state = _createState();
final state = createState();
expect(state.progress.deathCount, 0);
final result = handler.processPlayerDeath(
@@ -314,7 +313,7 @@ void main() {
test('연속 사망 시 deathCount가 누적된다', () {
// 첫 번째 사망 (deathCount: 0 -> 1)
var state = _createState(seed: 100);
var state = createState(seed: 100);
state = handler.processPlayerDeath(
state,
killerName: 'Goblin',
@@ -338,7 +337,7 @@ void main() {
group('currentCombat 초기화', () {
test('사망 후 currentCombat이 null로 초기화되어야 한다', () {
// 전투 중(combat active) 상태에서 사망
final state = _createState();
final state = createState();
expect(state.progress.currentCombat, isNotNull);
final result = handler.processPlayerDeath(

View File

@@ -1,3 +1,5 @@
// ignore_for_file: avoid_print
import 'dart:math';
import 'package:flutter_test/flutter_test.dart';
@@ -7,7 +9,7 @@ import 'package:flutter_test/flutter_test.dart';
/// 다양한 GCD 값에 대해 전투 효율성을 측정
void main() {
test('GCD 시뮬레이션 - 다양한 값 비교', () {
print('\n' + '=' * 80);
print('\n${'=' * 80}');
print('글로벌 쿨타임(GCD) 시뮬레이션 결과');
print('=' * 80);
@@ -93,14 +95,14 @@ void main() {
'- DPS 손실이 크지 않음 (${((1 - gcd1500.avgDps / baselineDps) * 100).toStringAsFixed(0)}% ~ ${((1 - gcd2000.avgDps / baselineDps) * 100).toStringAsFixed(0)}%)',
);
print('\n' + '=' * 80);
print('\n${'=' * 80}');
// 테스트는 항상 통과 (정보 출력용)
expect(true, isTrue);
});
test('GCD 상세 시뮬레이션 - 레벨별 영향', () {
print('\n' + '=' * 80);
print('\n${'=' * 80}');
print('레벨별 GCD 영향 분석');
print('=' * 80);
@@ -153,7 +155,7 @@ void main() {
}
}
print('\n' + '=' * 80);
print('\n${'=' * 80}');
expect(true, isTrue);
});
}