Skip to content

Commit e6bd8c4

Browse files
committed
chore: add .editorconfig, add udonsharp filter
1 parent 9821a21 commit e6bd8c4

File tree

4 files changed

+142
-8
lines changed

4 files changed

+142
-8
lines changed

.editorconfig

Lines changed: 132 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,132 @@
1+
[*.{appxmanifest,asax,ascx,aspx,axaml,build,c,c++,cc,cginc,compute,cp,cpp,cs,cshtml,cu,cuh,cxx,dtd,fs,fsi,fsscript,fsx,fx,fxh,h,hh,hlsl,hlsli,hlslinc,hpp,hxx,inc,inl,ino,ipp,ixx,master,ml,mli,mpp,mq4,mq5,mqh,nuspec,paml,razor,resw,resx,shader,skin,tpp,usf,ush,vb,xaml,xamlx,xoml,xsd}]
2+
indent_style = space
3+
indent_size = 4
4+
tab_width = 4
5+
6+
[*]
7+
8+
# Microsoft .NET properties
9+
csharp_new_line_before_members_in_object_initializers = false
10+
csharp_new_line_before_open_brace = none
11+
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
12+
csharp_style_prefer_utf8_string_literals = true:suggestion
13+
csharp_style_var_elsewhere = true:suggestion
14+
csharp_style_var_for_built_in_types = true:suggestion
15+
csharp_style_var_when_type_is_apparent = true:suggestion
16+
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
17+
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
18+
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
19+
dotnet_naming_rule.unity_serialized_field_rule.severity = none
20+
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
21+
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
22+
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
23+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
24+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
25+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
26+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
27+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
28+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
29+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
30+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
31+
dotnet_style_predefined_type_for_member_access = true:suggestion
32+
dotnet_style_qualification_for_event = false:suggestion
33+
dotnet_style_qualification_for_field = false:suggestion
34+
dotnet_style_qualification_for_method = false:suggestion
35+
dotnet_style_qualification_for_property = false:suggestion
36+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
37+
38+
# ReSharper properties
39+
resharper_apply_auto_detected_rules = false
40+
resharper_autodetect_indent_settings = true
41+
resharper_csharp_empty_block_style = together_same_line
42+
resharper_csharp_stick_comment = false
43+
resharper_formatter_off_tag = @formatter:off
44+
resharper_formatter_on_tag = @formatter:on
45+
resharper_formatter_tags_enabled = true
46+
resharper_indent_preprocessor_directives = normal
47+
resharper_indent_preprocessor_if = outdent
48+
resharper_indent_preprocessor_other = outdent
49+
resharper_indent_preprocessor_region = outdent
50+
resharper_keep_existing_attribute_arrangement = true
51+
resharper_show_autodetect_configure_formatting_tip = false
52+
resharper_use_indent_from_vs = false
53+
54+
# ReSharper inspection severities
55+
resharper_arrange_redundant_parentheses_highlighting = hint
56+
resharper_arrange_this_qualifier_highlighting = hint
57+
resharper_arrange_type_member_modifiers_highlighting = hint
58+
resharper_arrange_type_modifiers_highlighting = hint
59+
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
60+
resharper_built_in_type_reference_style_highlighting = hint
61+
resharper_inconsistent_naming_highlighting = none
62+
resharper_redundant_base_qualifier_highlighting = warning
63+
resharper_suggest_var_or_type_built_in_types_highlighting = hint
64+
resharper_suggest_var_or_type_elsewhere_highlighting = hint
65+
resharper_suggest_var_or_type_simple_types_highlighting = hint
66+
resharper_web_config_module_not_resolved_highlighting = warning
67+
resharper_web_config_type_not_resolved_highlighting = warning
68+
resharper_web_config_wrong_module_highlighting = warning
69+
70+
[*.cs]
71+
72+
# Microsoft .NET properties
73+
csharp_new_line_before_members_in_object_initializers = false
74+
csharp_new_line_before_open_brace = none
75+
csharp_preferred_modifier_order = public, private, protected, internal, file, new, static, abstract, virtual, sealed, readonly, override, extern, unsafe, volatile, async, required:suggestion
76+
csharp_style_prefer_utf8_string_literals = true:suggestion
77+
csharp_style_var_elsewhere = true:suggestion
78+
csharp_style_var_for_built_in_types = true:suggestion
79+
csharp_style_var_when_type_is_apparent = true:suggestion
80+
dotnet_naming_rule.unity_serialized_field_rule.import_to_resharper = True
81+
dotnet_naming_rule.unity_serialized_field_rule.resharper_description = Unity serialized field
82+
dotnet_naming_rule.unity_serialized_field_rule.resharper_guid = 5f0fdb63-c892-4d2c-9324-15c80b22a7ef
83+
dotnet_naming_rule.unity_serialized_field_rule.severity = none
84+
dotnet_naming_rule.unity_serialized_field_rule.style = lower_camel_case_style
85+
dotnet_naming_rule.unity_serialized_field_rule.symbols = unity_serialized_field_symbols
86+
dotnet_naming_style.lower_camel_case_style.capitalization = camel_case
87+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_accessibilities = *
88+
dotnet_naming_symbols.unity_serialized_field_symbols.applicable_kinds =
89+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_applicable_kinds = unity_serialised_field
90+
dotnet_naming_symbols.unity_serialized_field_symbols.resharper_required_modifiers = instance
91+
dotnet_style_parentheses_in_arithmetic_binary_operators = never_if_unnecessary:none
92+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:none
93+
dotnet_style_parentheses_in_relational_binary_operators = never_if_unnecessary:none
94+
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
95+
dotnet_style_predefined_type_for_member_access = true:suggestion
96+
dotnet_style_qualification_for_event = false:suggestion
97+
dotnet_style_qualification_for_field = false:suggestion
98+
dotnet_style_qualification_for_method = false:suggestion
99+
dotnet_style_qualification_for_property = false:suggestion
100+
dotnet_style_require_accessibility_modifiers = for_non_interface_members:suggestion
101+
102+
# ReSharper properties
103+
resharper_apply_auto_detected_rules = false
104+
resharper_autodetect_indent_settings = true
105+
resharper_csharp_empty_block_style = together_same_line
106+
resharper_csharp_stick_comment = false
107+
resharper_formatter_off_tag = @formatter:off
108+
resharper_formatter_on_tag = @formatter:on
109+
resharper_formatter_tags_enabled = true
110+
resharper_indent_preprocessor_directives = normal
111+
resharper_indent_preprocessor_if = outdent
112+
resharper_indent_preprocessor_other = outdent
113+
resharper_indent_preprocessor_region = outdent
114+
resharper_keep_existing_attribute_arrangement = true
115+
resharper_show_autodetect_configure_formatting_tip = false
116+
resharper_use_indent_from_vs = false
117+
118+
# ReSharper inspection severities
119+
resharper_arrange_redundant_parentheses_highlighting = hint
120+
resharper_arrange_this_qualifier_highlighting = hint
121+
resharper_arrange_type_member_modifiers_highlighting = hint
122+
resharper_arrange_type_modifiers_highlighting = hint
123+
resharper_built_in_type_reference_style_for_member_access_highlighting = hint
124+
resharper_built_in_type_reference_style_highlighting = hint
125+
resharper_inconsistent_naming_highlighting = none
126+
resharper_redundant_base_qualifier_highlighting = warning
127+
resharper_suggest_var_or_type_built_in_types_highlighting = hint
128+
resharper_suggest_var_or_type_elsewhere_highlighting = hint
129+
resharper_suggest_var_or_type_simple_types_highlighting = hint
130+
resharper_web_config_module_not_resolved_highlighting = warning
131+
resharper_web_config_type_not_resolved_highlighting = warning
132+
resharper_web_config_wrong_module_highlighting = warning

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Auto detect text files and perform LF normalization
22
* text=auto
3-
*.prefab merge=unityyamlmerge eol=lf text
4-
*.asset merge=unityyamlmerge eol=lf text
3+
*.prefab filter=usharp-prefab diff=usharp-prefab merge=unityyamlmerge eol=lf text
4+
*.asset filter=usharp-prefab diff=usharp-prefab merge=unityyamlmerge eol=lf text
55
*.fbx filter=lfs diff=lfs merge=lfs -text
66
*.wav filter=lfs diff=lfs merge=lfs -text
7-
*.png filter=lfs diff=lfs merge=lfs -text
7+
*.png filter=lfs diff=lfs merge=lfs -text

.gitconfig

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
[merge]
2-
tool = unityyamlmerge
1+
[filter "usharp-prefab"]
2+
smudge = powershell .gitscripts/filter-usharp-assets.ps1
3+
clean = powershell .gitscripts/filter-usharp-assets.ps1
34

4-
[mergetool "unityyamlmerge"]
5-
trustExitCode = false
6-
cmd = 'D:\Program Files\Unity\Hub\Editor\2019.4.31f1\Editor\Data\Tools\UnityYAMLMerge.exe' merge -p "$BASE" "$REMOTE" "$LOCAL" "$MERGED"
5+
[diff "usharp-prefab"]
6+
textconv = powershell .gitscripts/filter-usharp-assets.ps1

.gitscripts/filter-usharp-assets.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
$fileContent = [System.IO.File]::ReadAllText($args[2])
2+
$fileContent -replace ' serializedUdonProgramAsset: .*\r?\n.*\r?\n', ''

0 commit comments

Comments
 (0)