Skip to content

Instantly share code, notes, and snippets.

@mebiusbox
Last active April 24, 2025 08:38
Show Gist options
  • Save mebiusbox/c660eee4639989e8f1ebe1a3b80e5ade to your computer and use it in GitHub Desktop.
Save mebiusbox/c660eee4639989e8f1ebe1a3b80e5ade to your computer and use it in GitHub Desktop.
editorconfig
# https://editorconfig.org/
root = true
[*]
charset = utf-8
indent_size = 4
indent_style = space
tab_width = 4
end_of_line = crlf
insert_final_newline = true
trim_trailing_whitespace = true
# max_line_length = 119
# https://learn.microsoft.com/en-us/visualstudio/ide/cpp-editorconfig-properties?view=vs-2022
[*.{c,cpp,cxx,h,hxx,inl,glsl,hlsl,rs}]
# curly_bracket_next_line = false
[*.{lua,bat,cmd}]
indent_size = 2
[*.{cs,csx,vb,vbx}]
charset = utf-8-bom
[*.{ps1,psd1,psm1}]
[*.md]
# 環境によって末尾の空白2つで改行扱いするものがある
trim_trailing_whitespace = false
[*.py]
indent_size = 2
[*.{htm,html,tsx,xml,css,scss,sass,less,js,ts,yml,yaml,toml,json}]
indent_size = 2
[*.{yml,yaml}]
trim_trailing_whitespace = false
indent_size = 2
[*.txt]
insert_final_newline = false
[*.{tex,sty}]
#--------------------------------------------------------------------
# insert_final_newline, trim_trailing_whitespace が反映されない場合、
# Visual Studio Code 側の設定を確認すること.
# - files.insertFinalNewLine
# - files.trimTrailingWhitespace
# - editor.trimAutoWhitespace
# Visual Studio Code のEditorConfig拡張機能では以下の項目は保存時:
# - end_of_line
# - insert_final_newline
# - trim_trailing_whitespace
#--------------------------------------------------------------------
[*.{cs,csx}]
# https://learn.microsoft.com/ja-jp/dotnet/fundamentals/code-analysis/style-rules/csharp-formatting-options
# New Line Options
csharp_new_line_before_open_brace = none # "{"を新しい行に配置するか
csharp_new_line_before_else = false # "else"を新しい行に配置するか
csharp_new_line_before_catch = false # "catch"を新しい行に配置するか
csharp_new_line_before_finally = false # "finally"を新しい行に配置するか
csharp_new_line_before_members_in_object_initializers = true # オブジェクト初期化子のメンバーを別の行に配置するか
csharp_new_line_before_members_in_anonymous_types = true # 匿名型のメンバーを別の行に配置するか
csharp_new_line_between_query_expression_clauses = true # クエリ式の句の要素を別の行に配置するか
# Indentation Options
csharp_indent_block_contents = true # ブロックの内容をインデントするか
csharp_indent_braces = false # "{}"をインデントするか
csharp_indent_switch_labels = false # "switch" ラベルにインデントを付けるか
csharp_indent_case_contents = true # "switch" ケースにインデントを付けるか
csharp_indent_case_contents_when_block = false # "switch" ケースでのブロックをインデントするか
csharp_indent_labels = one_less_than_current # ラベルの配置位置
# Spacing Options
csharp_space_before_comma = false # コンマの前
csharp_space_after_comma = true # コンマの後
csharp_space_before_dot = false # ドットの前
csharp_space_after_dot = false # ドットの後
csharp_space_between_parentheses = false # "()"間
csharp_space_around_binary_operators = before_and_after # バイナリ演算子の前後
csharp_space_before_open_square_brackets = false # "["の前
csharp_space_between_square_brackets = false # "[]"の間
csharp_space_between_empty_square_brackets = false # 空の"[]"の間
csharp_space_after_cast = false # キャストの間
csharp_space_after_keywords_in_control_flow_statements = true # 制御フローステートメント(forなど)の後
csharp_space_before_semicolon_in_for_statement = false # forステートメントのセミコロンの前
csharp_space_after_semicolon_in_for_statement = true # forステートメントのセミコロンの後
csharp_space_around_declaration_statements = false # 宣言ステートメントの余計な空白文字. "false"なら削除
csharp_space_between_method_declaration_name_and_open_parenthesis = false # メソッド宣言のメソッド名と始め括弧の間
csharp_space_between_method_declaration_parameter_list_parentheses = false # メソッド宣言パラメータのリスト始めと終わり
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false # メソッド宣言の空パラメータのリスト始めと終わり
csharp_space_between_method_call_name_and_opening_parenthesis = false # メソッド呼び出し名と始め括弧の間
csharp_space_between_method_call_parameter_list_parentheses = false # メソッド呼び出しの始め括弧と終わり括弧
csharp_space_between_method_call_empty_parameter_list_parentheses = false # 空パラメータのメソッド呼び出しの始め括弧と終わり括弧
csharp_space_before_colon_in_inheritance_clause = true # 型宣言の":"前
csharp_space_after_colon_in_inheritance_clause = true # 型宣言の":"後
# Wrap Options
csharp_preserve_single_line_statements = false # 1行に複数のステートメントとメンバー宣言を表示
csharp_preserve_single_line_blocks = true # コードブロックを単一行に配置
# diagnostic
dotnet_diagnostic.IDE0044.severity = none # Make field read-only
dotnet_diagnostic.RCS1169.severity = none # Make field read-only
dotnet_diagnostic.IDE0051.severity = none # Remove unused member declaration
dotnet_diagnostic.RCS1213.severity = none # Remove unused member declaration
dotnet_diagnostic.SA1500.severity = none # Braces for Multi-Line Statements must not share line
dotnet_diagnostic.SA1633.severity = none # The file header is missing or not located at the top of the file
# .NET Coding Conventions
# Organize usings
dotnet_separate_import_directive_groups = false
dotnet_sort_system_directives_first = true
file_header_template = unset
# this. and Me. preferences
dotnet_style_qualification_for_event = true:suggestion
dotnet_style_qualification_for_field = true:suggestion
dotnet_style_qualification_for_method = true:suggestion
dotnet_style_qualification_for_property = true:suggestion
# Naming Styles
dotnet_naming_style.camel_case.capitalization = camel_case
dotnet_naming_style.pascal_case.capitalization = pascal_case
dotnet_naming_style.camel_case_and_prefix_with_underscore.required_prefix = _
dotnet_naming_style.camel_case_and_prefix_with_underscore.capitalization = camel_case
dotnet_naming_style.pascal_case_and_prefix_with_I.required_prefix = I
dotnet_naming_style.pascal_case_and_prefix_with_I.capitalization = pascal_case
dotnet_naming_style.pascal_case_and_prefix_with_T.required_prefix = T
dotnet_naming_style.pascal_case_and_prefix_with_T.capitalization = pascal_case
# Naming Symbols
# Interfaces
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = *
# Type parameters
dotnet_naming_symbols.type_parameter_symbols.applicable_kinds = type_parameter
dotnet_naming_symbols.type_parameter_symbols.applicable_accessibilities = *
# Constants
dotnet_naming_symbols.constant.applicable_kinds = field
dotnet_naming_symbols.constant.required_modifiers = const
dotnet_naming_symbols.constant.applicable_accessibilities = *
# Pascal most of the things
dotnet_naming_symbols.pascal.applicable_kinds = class, struct, enum, property, method, event, namespace, delegate, local_function
dotnet_naming_symbols.pascal.applicable_accessibilities = *
# Parameters, locals
dotnet_naming_symbols.locals_and_parameters.applicable_kinds = parameter, local
dotnet_naming_symbols.locals_and_parameters.applicable_accessibilities = *
# Private fields
dotnet_naming_symbols.private_or_internal_field.applicable_kinds = field
dotnet_naming_symbols.private_or_internal_field.applicable_accessibilities = internal, private
dotnet_naming_symbols.private_or_internal_field.required_modifiers =
# Public fields
dotnet_naming_symbols.public_field.applicable_kinds = field
dotnet_naming_symbols.public_field.applicable_accessibilities = public, internal, friend, protected, protected_internal, protected_friend, private_protected
# Naming Rules
# Interfaces
dotnet_naming_rule.interfaces_must_be_pascal_cased_and_prefixed_with_I.symbols = interface
dotnet_naming_rule.interfaces_must_be_pascal_cased_and_prefixed_with_I.style = pascal_case_and_prefix_with_I
dotnet_naming_rule.interfaces_must_be_pascal_cased_and_prefixed_with_I.severity = warning
# Type parameters
dotnet_naming_rule.type_parameters_must_be_pascal_cased_and_prefixed_with_T.symbols = type_parameter
dotnet_naming_rule.type_parameters_must_be_pascal_cased_and_prefixed_with_T.style = pascal_case_and_prefix_with_T
dotnet_naming_rule.type_parameters_must_be_pascal_cased_and_prefixed_with_T.severity = warning
# Pascal most of the things
dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.symbols = pascal
dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.style = pascal_case
dotnet_naming_rule.externally_visible_members_must_be_pascal_cased.severity = warning
# Parameters, locals
dotnet_naming_rule.parameters_must_be_camel_cased.symbols = locals_and_parameters
dotnet_naming_rule.parameters_must_be_camel_cased.style = camel_case
dotnet_naming_rule.parameters_must_be_camel_cased.severity = warning
# Constants
dotnet_naming_rule.constants_must_be_pascal_cased.symbols = constant
dotnet_naming_rule.constants_must_be_pascal_cased.style = pascal_case
dotnet_naming_rule.constants_must_be_pascal_cased.severity = warning
# Public fields
dotnet_naming_rule.public_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.symbols = public_field
dotnet_naming_rule.public_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.style = pascal_case
dotnet_naming_rule.public_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.severity = warning
# Private fields
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.symbols = private_or_internal_field
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.style = camel_case_and_prefix_with_underscore
dotnet_naming_rule.private_instance_fields_must_be_camel_cased_and_prefixed_with_underscore.severity = warning
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment