first commit
This commit is contained in:
362
MMOTestServer/.editorconfig
Normal file
362
MMOTestServer/.editorconfig
Normal file
@@ -0,0 +1,362 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
indent_style = space
|
||||
indent_size = 4
|
||||
max_line_length = 140
|
||||
|
||||
[*.cs]
|
||||
# -------------------------------------------------------------------------
|
||||
# 중괄호 Allman 스타일
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# if (isAlive) if (isAlive) {
|
||||
# { TakeDamage();
|
||||
# TakeDamage(); }
|
||||
# }
|
||||
csharp_new_line_before_open_brace = all
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 중괄호 항상 사용
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# if (isAlive) if (isAlive)
|
||||
# { TakeDamage();
|
||||
# TakeDamage();
|
||||
# }
|
||||
csharp_prefer_braces = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 접근 제한자 항상 명시
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# private int health; int health;
|
||||
# public float moveSpeed; float moveSpeed;
|
||||
dotnet_style_require_accessibility_modifiers = always:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# this. 한정자 허용 (필드와 매개변수 이름이 같을 때 필요)
|
||||
# -------------------------------------------------------------------------
|
||||
# 허용: this.stateContext = stateContext; (매개변수와 필드명 동일 시)
|
||||
# 불필요: this.Initialize(); (모호하지 않은 경우)
|
||||
dotnet_style_qualification_for_field = false:suggestion
|
||||
dotnet_style_qualification_for_property = false:suggestion
|
||||
dotnet_style_qualification_for_method = false:suggestion
|
||||
dotnet_style_qualification_for_event = false:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# var 사용 금지
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# Enemy enemy = GetEnemy(); var enemy = GetEnemy();
|
||||
# int count = 0; var count = 0;
|
||||
csharp_style_var_for_built_in_types = false:warning
|
||||
csharp_style_var_when_type_is_apparent = false:warning
|
||||
csharp_style_var_elsewhere = false:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# null 체크 스타일 강제
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# animator?.Play("Run"); if (animator != null) animator.Play("Run");
|
||||
# string name = playerName ?? "Unknown"; string name = playerName != null ? playerName : "Unknown";
|
||||
# if (obj is null) { } if (object.ReferenceEquals(obj, null)) { }
|
||||
csharp_style_conditional_delegate_call = true:warning
|
||||
dotnet_style_null_propagation = true:warning
|
||||
dotnet_style_coalesce_expression = true:warning
|
||||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 패턴 매칭 강제 (as + null 체크 대신 is 패턴 사용)
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# if (obj is Enemy enemy) Enemy enemy = obj as Enemy;
|
||||
# { if (enemy != null)
|
||||
# enemy.TakeDamage(); {
|
||||
# } enemy.TakeDamage();
|
||||
# }
|
||||
csharp_style_pattern_matching_over_is_with_cast_check = true:warning
|
||||
csharp_style_pattern_matching_over_as_with_null_check = true:warning
|
||||
# not 패턴 (C# 9+)
|
||||
# Good: if (obj is not null) Bad: if (!(obj is null))
|
||||
# Good: if (enemy is not Dead) Bad: if (!(enemy is Dead))
|
||||
csharp_style_prefer_not_pattern = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# throw 표현식 강제
|
||||
# -------------------------------------------------------------------------
|
||||
# Good:
|
||||
# target = player ?? throw new ArgumentNullException(nameof(player));
|
||||
#
|
||||
# Bad:
|
||||
# if (player == null) throw new ArgumentNullException(nameof(player));
|
||||
# target = player;
|
||||
csharp_style_throw_expression = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 인라인 변수 선언 강제
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# TryGetComponent(out Rigidbody rb); Rigidbody rb;
|
||||
# TryGetComponent(out rb);
|
||||
csharp_style_inlined_variable_declaration = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 튜플 해체 선언
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# var (x, y) = GetPosition(); var pos = GetPosition();
|
||||
# var x = pos.x; var y = pos.y;
|
||||
csharp_style_deconstructed_variable_declaration = true:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 간단한 using 선언문
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# using var stream = File.Open(...); using (var stream = File.Open(...))
|
||||
# {
|
||||
# }
|
||||
csharp_prefer_simple_using_statement = true:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 인덱스 / 범위 연산자 (C# 8+)
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: items[^1] Bad: items[items.Length - 1]
|
||||
# Good: items[1..3] Bad: items.Skip(1).Take(2)
|
||||
csharp_style_prefer_index_from_end = true:suggestion
|
||||
csharp_style_prefer_range_operator = true:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# switch 표현식 권장
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# string label = state switch string label;
|
||||
# { switch (state)
|
||||
# GameState.Playing => "Playing", {
|
||||
# GameState.Paused => "Paused", case GameState.Playing: label = "Playing"; break;
|
||||
# _ => "Unknown" case GameState.Paused: label = "Paused"; break;
|
||||
# }; default: label = "Unknown"; break;
|
||||
# }
|
||||
csharp_style_prefer_switch_expression = true:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 불필요한 코드 제거
|
||||
# -------------------------------------------------------------------------
|
||||
# object initializer
|
||||
# Good: Bad:
|
||||
# Enemy enemy = new Enemy Enemy enemy = new Enemy();
|
||||
# { enemy.hp = 100;
|
||||
# hp = 100, enemy.name = "Goblin";
|
||||
# name = "Goblin"
|
||||
# };
|
||||
#
|
||||
# 미사용 반환값은 _ 로 명시적으로 버리기
|
||||
# Good: Bad:
|
||||
# _ = TryGetComponent(out Rigidbody rb); TryGetComponent(out Rigidbody rb);
|
||||
dotnet_style_object_initializer = true:warning
|
||||
dotnet_style_collection_initializer = true:warning
|
||||
dotnet_remove_unnecessary_suppression_exclusions = true
|
||||
csharp_style_unused_value_assignment_preference = discard_variable:warning
|
||||
csharp_style_unused_value_expression_statement_preference = discard_variable:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 단순화 강제
|
||||
# -------------------------------------------------------------------------
|
||||
# auto property
|
||||
# Good: Bad:
|
||||
# public int Hp { get; private set; } private int hp;
|
||||
# public int Hp { get { return hp; } }
|
||||
#
|
||||
# boolean 단순화
|
||||
# Good: Bad:
|
||||
# return isAlive; return isAlive == true;
|
||||
#
|
||||
# 삼항 연산자 (suggestion - 복잡한 경우 강제 안 함)
|
||||
# Good: Bad:
|
||||
# int damage = isCrit ? 200 : 100; int damage;
|
||||
# if (isCrit) damage = 200;
|
||||
# else damage = 100;
|
||||
dotnet_style_prefer_auto_properties = true:warning
|
||||
dotnet_style_prefer_simplified_boolean_expressions = true:warning
|
||||
dotnet_style_prefer_conditional_expression_over_assignment = true:suggestion
|
||||
dotnet_style_prefer_conditional_expression_over_return = true:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 복합 할당 연산자
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: hp -= damage; Bad: hp = hp - damage;
|
||||
# Good: score += point; Bad: score = score + point;
|
||||
dotnet_style_prefer_compound_assignment = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 타입 예약어 강제 (BCL 타입명 대신 C# 예약어 사용)
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# int count = 0; Int32 count = 0;
|
||||
# string name = "Player"; String name = "Player";
|
||||
# object obj = new Enemy(); Object obj = new Enemy();
|
||||
dotnet_style_predefined_type_for_locals_parameters_members = true:warning
|
||||
dotnet_style_predefined_type_for_member_access = true:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# expression-bodied 프로퍼티/접근자 강제, 메서드/생성자/로컬함수 금지
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# public int CurrentHp => currentHp; public int CurrentHp
|
||||
# {
|
||||
# get { return currentHp; }
|
||||
# }
|
||||
#
|
||||
# 메서드 / 생성자 / 로컬 함수는 expression-bodied 금지
|
||||
# Good: Bad:
|
||||
# public void TakeDamage(int damage) public void TakeDamage(int damage) => hp -= damage;
|
||||
# {
|
||||
# hp -= damage;
|
||||
# }
|
||||
csharp_style_expression_bodied_properties = true:warning
|
||||
csharp_style_expression_bodied_accessors = true:warning
|
||||
csharp_style_expression_bodied_indexers = true:warning
|
||||
csharp_style_expression_bodied_operators = true:warning
|
||||
csharp_style_expression_bodied_lambdas = true:suggestion
|
||||
csharp_style_expression_bodied_methods = false:warning
|
||||
csharp_style_expression_bodied_constructors = false:warning
|
||||
csharp_style_expression_bodied_local_functions = false:warning
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 한 줄 블록 금지 (포맷터 적용 시 자동 정리)
|
||||
# -------------------------------------------------------------------------
|
||||
# Good: Bad:
|
||||
# if (isAlive) if (isAlive) { TakeDamage(); }
|
||||
# {
|
||||
# TakeDamage();
|
||||
# }
|
||||
# 주의: 이 설정은 경고가 아닌 포맷터 실행 시에만 적용됩니다.
|
||||
csharp_preserve_single_line_blocks = false
|
||||
csharp_preserve_single_line_statements = false
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# using 정렬
|
||||
# -------------------------------------------------------------------------
|
||||
# Good:
|
||||
# using System.Collections;
|
||||
# using System.Collections.Generic;
|
||||
# using UnityEngine;
|
||||
dotnet_sort_system_directives_first = true
|
||||
dotnet_separate_import_directive_groups = false
|
||||
csharp_using_directive_placement = outside_namespace:warning
|
||||
# 네임스페이스는 폴더 구조와 일치
|
||||
# Good: Assets/Scripts/Player/ → namespace Project.Player
|
||||
dotnet_style_namespace_match_folder = true:suggestion
|
||||
|
||||
# -------------------------------------------------------------------------
|
||||
# 네이밍 규칙
|
||||
# -------------------------------------------------------------------------
|
||||
# 주의: 더 구체적인 규칙(const 등)을 먼저 선언해야 올바르게 적용됩니다.
|
||||
|
||||
# 상수: UPPER_SNAKE_CASE (const modifier로 가장 구체적 → 최우선)
|
||||
# Good: const int MAX_LEVEL = 100; Bad: const int MaxLevel = 100;
|
||||
# Good: const float DEFAULT_SPEED = 5f; Bad: const float defaultSpeed = 5f;
|
||||
dotnet_naming_rule.constants.severity = warning
|
||||
dotnet_naming_rule.constants.symbols = constants
|
||||
dotnet_naming_rule.constants.style = upper_snake_case
|
||||
|
||||
dotnet_naming_symbols.constants.applicable_kinds = field
|
||||
dotnet_naming_symbols.constants.required_modifiers = const
|
||||
|
||||
dotnet_naming_style.upper_snake_case.capitalization = all_upper
|
||||
dotnet_naming_style.upper_snake_case.word_separator = _
|
||||
|
||||
# private / protected 필드: camelCase (Unity 스타일 통일)
|
||||
# Good: private int currentHp; Bad: private int _currentHp;
|
||||
# Good: protected float baseSpeed; Bad: protected float _baseSpeed;
|
||||
dotnet_naming_rule.private_fields.severity = warning
|
||||
dotnet_naming_rule.private_fields.symbols = private_fields
|
||||
dotnet_naming_rule.private_fields.style = camel_case_style
|
||||
|
||||
dotnet_naming_symbols.private_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.private_fields.applicable_accessibilities = private, protected, protected_internal
|
||||
|
||||
# public 필드: camelCase (Unity Inspector 노출 필드 기준 - 일반 C# 컨벤션과 다름)
|
||||
# Good: public float moveSpeed; Bad: public float MoveSpeed;
|
||||
# Good: public int maxHealth; Bad: public int MaxHealth;
|
||||
dotnet_naming_rule.public_fields.severity = warning
|
||||
dotnet_naming_rule.public_fields.symbols = public_fields
|
||||
dotnet_naming_rule.public_fields.style = camel_case_style
|
||||
|
||||
dotnet_naming_symbols.public_fields.applicable_kinds = field
|
||||
dotnet_naming_symbols.public_fields.applicable_accessibilities = public, internal
|
||||
|
||||
dotnet_naming_style.camel_case_style.capitalization = camel_case
|
||||
|
||||
# 인터페이스: IPascalCase
|
||||
# Good: interface IEnemy { } Bad: interface Enemy { }
|
||||
# Good: interface IDamageable { } Bad: interface Damageable { }
|
||||
dotnet_naming_rule.interfaces.severity = warning
|
||||
dotnet_naming_rule.interfaces.symbols = interfaces
|
||||
dotnet_naming_rule.interfaces.style = prefix_i
|
||||
|
||||
dotnet_naming_symbols.interfaces.applicable_kinds = interface
|
||||
|
||||
dotnet_naming_style.prefix_i.capitalization = pascal_case
|
||||
dotnet_naming_style.prefix_i.required_prefix = I
|
||||
|
||||
# 클래스 / 구조체 / 열거형: PascalCase
|
||||
# Good: class PlayerController { } Bad: class playerController { }
|
||||
# Good: enum GameState { } Bad: enum gameState { }
|
||||
dotnet_naming_rule.types.severity = warning
|
||||
dotnet_naming_rule.types.symbols = types
|
||||
dotnet_naming_rule.types.style = pascal_case_style
|
||||
|
||||
dotnet_naming_symbols.types.applicable_kinds = class, struct, enum, delegate
|
||||
|
||||
dotnet_naming_style.pascal_case_style.capitalization = pascal_case
|
||||
|
||||
# 메서드 / 프로퍼티 / 이벤트: PascalCase
|
||||
# Good: public void TakeDamage() { } Bad: public void takeDamage() { }
|
||||
# Good: public int CurrentHp { } Bad: public int currentHp { }
|
||||
# Good: public event Action OnDeath; Bad: public event Action onDeath;
|
||||
dotnet_naming_rule.members.severity = warning
|
||||
dotnet_naming_rule.members.symbols = members
|
||||
dotnet_naming_rule.members.style = pascal_case_style
|
||||
|
||||
dotnet_naming_symbols.members.applicable_kinds = method, property, event
|
||||
|
||||
# 매개변수 / 로컬 변수: camelCase
|
||||
# Good: void Init(int maxHp) { } Bad: void Init(int MaxHp) { }
|
||||
# Good: float moveSpeed = 5f; Bad: float MoveSpeed = 5f;
|
||||
dotnet_naming_rule.parameters_and_locals.severity = warning
|
||||
dotnet_naming_rule.parameters_and_locals.symbols = parameters_and_locals
|
||||
dotnet_naming_rule.parameters_and_locals.style = camel_case_style
|
||||
|
||||
dotnet_naming_symbols.parameters_and_locals.applicable_kinds = parameter, local
|
||||
|
||||
# enum 멤버: PascalCase
|
||||
# Good: GameState.Playing Bad: GameState.playing
|
||||
# Good: GameState.GameOver Bad: GameState.GAME_OVER
|
||||
dotnet_naming_rule.enum_members.severity = warning
|
||||
dotnet_naming_rule.enum_members.symbols = enum_members
|
||||
dotnet_naming_rule.enum_members.style = pascal_case_style
|
||||
|
||||
dotnet_naming_symbols.enum_members.applicable_kinds = enum_member
|
||||
|
||||
[*.{json,yaml,yml}]
|
||||
indent_size = 2
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{asmdef,asmref}]
|
||||
indent_size = 4
|
||||
|
||||
[*.shader]
|
||||
indent_size = 4
|
||||
|
||||
[*.{compute,hlsl,cginc}]
|
||||
indent_size = 4
|
||||
|
||||
[*.{uss,uxml}]
|
||||
indent_size = 4
|
||||
Reference in New Issue
Block a user