Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit92fdad7

Browse files
authored
Merge pull request#177 from wlsnmrk/quality/update-editorconfig
quality: update editorconfig
2 parents24a9410 +36a7cc6 commit92fdad7

File tree

134 files changed

+4139
-3117
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

134 files changed

+4139
-3117
lines changed

‎.editorconfig‎

Lines changed: 52 additions & 110 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# --------------------------------------------------------------------------- #
22
# Chickensoft C# Style — .editorconfig #
33
# --------------------------------------------------------------------------- #
4-
# Godot-friendly, K&Rcoding style with a bit of Dart-style flair thrown in. #
4+
# Godot-friendlycoding style with a bit of Dart-style flair thrown in. #
55
# --------------------------------------------------------------------------- #
66
# #
77
# #
@@ -52,6 +52,10 @@ end_of_line = lf
5252
# File Extension Settings
5353
##########################################
5454

55+
# GDScript Files
56+
[*.{gd,gdshader,gdshaderinc}]
57+
indent_style =tab
58+
5559
# Visual Studio Solution Files
5660
[*.sln]
5761
indent_style =tab
@@ -84,6 +88,10 @@ indent_size = 2
8488
[*.{cmd,bat}]
8589
end_of_line =crlf
8690

91+
# Powershell Files
92+
[*.ps1]
93+
end_of_line =crlf
94+
8795
# Bash Files
8896
[*.sh]
8997
end_of_line =lf
@@ -92,7 +100,7 @@ end_of_line = lf
92100
[Makefile]
93101
indent_style =tab
94102

95-
[*_Generated.cs,*.g.cs,*.generated.cs]
103+
[*{_Generated.cs,.g.cs,.generated.cs}]
96104
# Ignore a lack of documentation for generated code. Doesn't apply to builds,
97105
# just to viewing generation output.
98106
dotnet_diagnostic.CS1591.severity =none
@@ -101,7 +109,7 @@ dotnet_diagnostic.CS1591.severity = none
101109
# Default .NET Code Style Severities
102110
##########################################
103111

104-
[*.{cs,csx,cake,vb,vbx}]
112+
[*.cs]
105113
# Default Severity for all .NET Code Style rules below
106114
dotnet_analyzer_diagnostic.severity =warning
107115

@@ -110,7 +118,6 @@ dotnet_analyzer_diagnostic.severity = warning
110118
##########################################
111119

112120
# .NET Style Rules
113-
[*.{cs,csx,cake,vb,vbx}]
114121

115122
# "this." and "Me." qualifiers
116123
dotnet_style_qualification_for_field =false
@@ -123,7 +130,7 @@ dotnet_style_predefined_type_for_locals_parameters_members = true:warning
123130
dotnet_style_predefined_type_for_member_access =true:warning
124131

125132
# Modifier preferences
126-
dotnet_style_require_accessibility_modifiers =always:warning
133+
dotnet_style_require_accessibility_modifiers =for_non_interface_members:warning
127134
csharp_preferred_modifier_order =public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:warning
128135
visual_basic_preferred_modifier_order =Partial,Default,Private,Protected,Public,Friend,NotOverridable,Overridable,MustOverride,Overloads,Overrides,MustInherit,NotInheritable,Static,Shared,Shadows,ReadOnly,WriteOnly,Dim,Const,WithEvents,Widening,Narrowing,Custom,Async:warning
129136
dotnet_style_readonly_field =true:warning
@@ -154,9 +161,13 @@ dotnet_style_coalesce_expression = true:warning
154161
dotnet_style_null_propagation =true:warning
155162
dotnet_style_prefer_is_null_check_over_reference_equality_method =true:warning
156163

164+
# Unused parameters and methods
165+
dotnet_diagnostic.IDE0060.severity =warn
166+
dotnet_diagnostic.IDE0051.severity =warn
167+
157168
# File header preferences
158169
# Keep operators at end of line when wrapping.
159-
dotnet_style_operator_placement_when_wrapping =end_of_line:warning
170+
dotnet_style_operator_placement_when_wrapping =end_of_line
160171
csharp_style_prefer_null_check_over_type_check =true:warning
161172

162173
# Code block preferences
@@ -165,13 +176,13 @@ csharp_prefer_simple_using_statement = true:suggestion
165176
dotnet_diagnostic.IDE0063.severity =suggestion
166177

167178
# C# Style Rules
168-
[*.{cs,csx,cake}]
179+
169180
# 'var' preferences
170181
csharp_style_var_for_built_in_types =true:warning
171182
csharp_style_var_when_type_is_apparent =true:warning
172183
csharp_style_var_elsewhere =true:warning
173184
# Expression-bodied members
174-
csharp_style_expression_bodied_methods =true:warning
185+
csharp_style_expression_bodied_methods =when_on_single_line:warning
175186
csharp_style_expression_bodied_constructors =false:warning
176187
csharp_style_expression_bodied_operators =true:warning
177188
csharp_style_expression_bodied_properties =true:warning
@@ -196,56 +207,17 @@ csharp_style_implicit_object_creation_when_type_is_apparent = true:warning
196207
# "Null" checking preferences
197208
csharp_style_throw_expression =true:warning
198209
csharp_style_conditional_delegate_call =true:warning
199-
# Code block preferences
200-
csharp_prefer_braces =true:warning
201-
csharp_prefer_simple_using_statement =true:suggestion
202-
dotnet_diagnostic.IDE0063.severity =suggestion
203210
# 'using' directive preferences
204211
csharp_using_directive_placement =inside_namespace:warning
205-
# Modifier preferences
206-
# Don't suggest making public methods static. Very annoying.
207-
csharp_prefer_static_local_function =false
208-
# Only suggest making private methods static (if they don't use instance data).
209-
dotnet_code_quality.CA1822.api_surface =private
212+
# Use discard variable for unused expression values.
213+
csharp_style_unused_value_expression_statement_preference =discard_variable
214+
csharp_style_unused_value_assignment_preference =discard_variable
210215

211216
##########################################
212-
#Unnecessary Code Rules
217+
#Formatting Rules
213218
##########################################
214219

215-
# .NET Unnecessary code rules
216-
[*.{cs,csx,cake,vb,vbx}]
217-
218-
dotnet_code_quality_unused_parameters =non_public:suggestion
219-
dotnet_remove_unnecessary_suppression_exclusions =none
220-
dotnet_diagnostic.IDE0079.severity =warning
221-
222-
# C# Unnecessary code rules
223-
[*.{cs,csx,cake}]
224-
225-
# Chickensoft Unused Code Additions
226-
#
227-
# Unfortunately for VSCode users, disabling these rules prevents you from
228-
# detecting unused code. Enabling them will trigger the roslyn analyzers'
229-
# automatic code fixes to remove unused code, which is very annoying when
230-
# you're actively coding or using reflection.
231-
#
232-
# I have not found a way to disable automatic fixes while keeping
233-
# warnings/suggestions/etc in the editor. If you find a way, please file an
234-
# issue or open a PR.
235-
236-
# Don't remove method parameters that are unused.
237-
dotnet_diagnostic.IDE0060.severity =none
238-
dotnet_diagnostic.RCS1163.severity =none
239-
240-
# Don't remove methods that are unused.
241-
dotnet_diagnostic.IDE0051.severity =none
242-
dotnet_diagnostic.RCS1213.severity =none
243-
244-
# Use discard variable for unused expression values.
245-
csharp_style_unused_value_expression_statement_preference =discard_variable
246-
247220
# .NET formatting rules
248-
[*.{cs,csx,cake,vb,vbx}]
249221

250222
# Organize using directives
251223
dotnet_sort_system_directives_first =true
@@ -260,10 +232,9 @@ dotnet_style_namespace_match_folder = false
260232
dotnet_diagnostic.IDE0130.severity =none
261233

262234
# C# formatting rules
263-
[*.{cs,csx,cake}]
264235

265236
# Newline options
266-
csharp_new_line_before_open_brace =none
237+
csharp_new_line_before_open_brace =all
267238
csharp_new_line_before_else =true
268239
csharp_new_line_before_catch =true
269240
csharp_new_line_before_finally =true
@@ -310,14 +281,22 @@ csharp_preserve_single_line_blocks = true
310281
# Namespace options
311282
csharp_style_namespace_declarations =file_scoped:warning
312283

284+
##########################################
285+
# Unnecessary Code Rules
286+
##########################################
287+
288+
# .NET Unnecessary code rules
289+
290+
dotnet_code_quality_unused_parameters =non_public:suggestion
291+
dotnet_remove_unnecessary_suppression_exclusions =none
292+
313293
##########################################
314294
# .NET Naming Rules
315295
##########################################
316-
[*.{cs,csx,cake,vb,vbx}]
317296

318297
##########################################
319298
# Chickensoft Naming Conventions & Styles
320-
# These deviate heavily from Microsoft'sOffical Naming Conventions.
299+
# These deviate heavily from Microsoft'sOfficial Naming Conventions.
321300
##########################################
322301

323302
# Allow underscores in names.
@@ -348,7 +327,7 @@ dotnet_naming_rule.non_public_fields_under_camel.symbols = non_public_fields
348327
dotnet_naming_rule.non_public_fields_under_camel.style =camel_case_underscore_style
349328
dotnet_naming_symbols.non_public_fields.applicable_kinds =field
350329
dotnet_naming_symbols.non_public_fields.required_modifiers =
351-
dotnet_naming_symbols.non_public_fields.applicable_accessibilities =private,private_protected,protected,internal,protected,protected_internal
330+
dotnet_naming_symbols.non_public_fields.applicable_accessibilities =private,private_protected,internal,protected,protected_internal
352331

353332
# Public fields should be PascalCase
354333
dotnet_naming_rule.public_fields_pascal.severity =suggestion
@@ -415,67 +394,30 @@ dotnet_naming_symbols.unspecified.applicable_accessibilities = *
415394
# Chickensoft Rule Overrides
416395
##########################################
417396

418-
# Allow using keywords as names
419-
# dotnet_diagnostic.CA1716.severity = none
420-
# Don't require culture info for ToString()
421-
dotnet_diagnostic.CA1304.severity =none
422-
# Don't require a string comparison for comparing strings.
423-
dotnet_diagnostic.CA1310.severity =none
424-
# Don't require a string format specifier.
425-
dotnet_diagnostic.CA1305.severity =none
426397
# Allow protected fields.
427398
dotnet_diagnostic.CA1051.severity =none
428399
# Don't warn about checking values that are supposedly never null. Sometimes
429400
# they are actually null.
430401
dotnet_diagnostic.CS8073.severity =none
431-
# Don't remove seemingly "unnecessary" assignments, as they often have
432-
# intended side-effects.
433-
dotnet_diagnostic.IDE0059.severity =none
434-
# Switch/case should always have a default clause. Tell that to Roslynator.
435-
dotnet_diagnostic.RCS1070.severity =none
436-
# Tell roslynator not to eat unused parameters.
437-
dotnet_diagnostic.RCS1163.severity =none
438-
# Tell dotnet not to remove unused parameters.
439-
dotnet_diagnostic.IDE0060.severity =none
440-
# Tell roslynator not to remove `partial` modifiers.
441-
dotnet_diagnostic.RCS1043.severity =none
442-
# Tell roslynator not to make classes static so aggressively.
443-
dotnet_diagnostic.RCS1102.severity =none
444-
# Roslynator wants to make properties readonly all the time, so stop it.
445-
# The developer knows best when it comes to contract definitions with Godot.
446-
dotnet_diagnostic.RCS1170.severity =none
447402
# Allow expression values to go unused, even without discard variable.
448403
# Otherwise, using Moq would be way too verbose.
449404
dotnet_diagnostic.IDE0058.severity =none
450-
# Don't let roslynator turn every local variable into a const.
451-
# If we did, we'd have to specify the types of local variables far more often,
452-
# and this style prefers type inference.
453-
dotnet_diagnostic.RCS1118.severity =none
454-
# Enums don't need to declare explicit values. Everyone knows they start at 0.
455-
dotnet_diagnostic.RCS1161.severity =none
456-
# Allow unconstrained type parameter to be checked for null.
457-
dotnet_diagnostic.RCS1165.severity =none
458-
# Allow keyword-based names so that parameter names like `@event` can be used.
405+
# Allow me to use the word Collection if I want.
406+
dotnet_diagnostic.CA1711.severity =none
407+
# Don't warn about using reserved keywords (e.g., methods named "On")
459408
dotnet_diagnostic.CA1716.severity =none
460-
461-
# --------------------------------------------------------------------------- #
462-
# Project Overrides
463-
464-
# Let me put comments where I want.
465-
dotnet_diagnostic.RCS1181.severity =none
466-
467-
# This erroneously flags param elements in doc comments as invalid when using
468-
# primary constructors, so we disable it.
469-
dotnet_diagnostic.RCS1228.severity =none
470-
471-
# I like my stupid if statements, they make the code readable.
472-
dotnet_diagnostic.IDE0046.severity =none
473-
# I also like nesting ternary operators in specific cases.
474-
dotnet_diagnostic.RCS1238.severity =none
475-
# Let me compare strings how I want.
476-
dotnet_diagnostic.RCS1155.severity =none
477-
# Leave me alone about primary constructors.
409+
# Don't warn about public methods that can be marked static
410+
# (tests frequently don't access member data, and GoDotTest won't call static methods)
411+
dotnet_code_quality.CA1822.api_surface =private
412+
# No primary constructors — not supported well by tooling.
478413
dotnet_diagnostic.IDE0290.severity =none
479-
# Let me use unnecessary cases if it helps readability:
480-
dotnet_diagnostic.RCS1069.severity =none
481-
414+
# Let me write dumb if statements for readability.
415+
dotnet_diagnostic.IDE0046.severity =none
416+
# DO make me populate a *switch expression*
417+
dotnet_diagnostic.IDE0072.severity =warning
418+
# Don't make me populate a *switch statement*
419+
dotnet_diagnostic.IDE0010.severity =none
420+
# Make local functions static
421+
dotnet_diagnostic.IDE0062.severity =warning
422+
# Don't make me use properties if I don't want to.
423+
dotnet_diagnostic.IDE0032.severity =none

‎GodotEnv.Tests/reports/line_coverage.svg‎

Lines changed: 1 addition & 1 deletion
Loading

‎GodotEnv.Tests/src/MainTest.cs‎

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,17 @@ namespace Chickensoft.GodotEnv.Tests;
77
usingShouldly;
88
usingXunit;
99

10-
publicclassMainTest{
10+
publicclassMainTest
11+
{
1112
[Fact]
1213
publicasyncTaskCallsCliFx()
1314
=>awaitShould.NotThrowAsync(
1415
async()=>awaitGodotEnv.Main(["not-a-command"])
1516
);
1617

1718
[Fact]
18-
publicvoidCreateExecutionContextParsesArgs(){
19+
publicvoidCreateExecutionContextParsesArgs()
20+
{
1921
varconfig=newConfig();
2022
varargs=newstring[]{"a","--","b"};
2123
varworkingDir="/";
@@ -35,14 +37,17 @@ public void CreateExecutionContextParsesArgs() {
3537
}
3638
}
3739

38-
publicclassGodotEnvActivatorTest{
40+
publicclassGodotEnvActivatorTest
41+
{
3942
privatesealedclassITestCommand(IExecutionContextexecutionContext):
40-
ICliCommand{
43+
ICliCommand
44+
{
4145
publicIExecutionContextExecutionContext{get;}=executionContext;
4246
}
4347

4448
[Fact]
45-
publicvoidInitializes(){
49+
publicvoidInitializes()
50+
{
4651
varexecutionContext=newMock<IExecutionContext>();
4752
varactivator=newGodotEnvActivator(
4853
executionContext.Object,OSType.Windows
@@ -51,7 +56,8 @@ public void Initializes() {
5156
}
5257

5358
[Fact]
54-
publicvoidCreatesObjectInstance(){
59+
publicvoidCreatesObjectInstance()
60+
{
5561
varexecutionContext=newMock<IExecutionContext>();
5662
varactivator=newGodotEnvActivator(
5763
executionContext.Object,OSType.MacOS

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp