-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Code Quality: Enforced code style in EditorConfig #16441
Draft
Lamparter
wants to merge
7
commits into
files-community:main
Choose a base branch
from
Lamparter:editorconfig
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
bc1e574
Enforce code style
Lamparter 2070ee8
Merge branch 'files-community:main' into editorconfig
Lamparter cef327a
Merge branch 'files-community:main' into editorconfig
Lamparter 29efe17
Add VERY detailed rule for requiring the use of async suffix in methods
Lamparter 589ca67
Merge branch 'files-community:main' into editorconfig
Lamparter 4c59c12
Merge branch 'main' into editorconfig
Lamparter 26e8cab
Code readability and clarity
Lamparter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,125 @@ | ||
root = true | ||
|
||
[**/*.cs] | ||
[**/*.xaml] | ||
indent_style = tab | ||
indent_size = 4 | ||
tab_width = 4 | ||
|
||
[**/*.xaml] | ||
[**/*.cs] | ||
indent_style = tab | ||
indent_size = 4 | ||
tab_width = 4 | ||
tab_width = 4 | ||
|
||
# https://files.community/docs/contributing/code-style | ||
|
||
dotnet_naming_rule.pascal_case_for_classes.symbols = classes | ||
dotnet_naming_symbols.classes.applicable_kinds = class | ||
dotnet_naming_symbols.classes.applicable_accessibilities = * | ||
dotnet_naming_symbols.classes.required_prefix = | ||
dotnet_naming_symbols.classes.required_suffix = | ||
|
||
dotnet_naming_rule.pascal_case_for_interfaces.symbols = interfaces | ||
dotnet_naming_symbols.interfaces.applicable_kinds = interface | ||
dotnet_naming_symbols.interfaces.applicable_accessibilities = * | ||
dotnet_naming_symbols.interfaces.required_prefix = I | ||
dotnet_naming_symbols.interfaces.required_suffix = | ||
|
||
dotnet_naming_rule.pascal_case_for_structs.symbols = structs | ||
dotnet_naming_symbols.structs.applicable_kinds = struct | ||
dotnet_naming_symbols.structs.applicable_accessibilities = * | ||
dotnet_naming_symbols.structs.required_prefix = | ||
dotnet_naming_symbols.structs.required_suffix = | ||
|
||
dotnet_naming_rule.pascal_case_for_methods.symbols = methods | ||
dotnet_naming_symbols.methods.applicable_kinds = method | ||
dotnet_naming_symbols.methods.applicable_accessibilities = * | ||
dotnet_naming_symbols.methods.required_prefix = | ||
|
||
dotnet_naming_rule.camel_case_for_variables.symbols = variables | ||
dotnet_naming_symbols.variables.applicable_kinds = field | ||
dotnet_naming_symbols.variables.applicable_accessibilities = private | ||
dotnet_naming_symbols.variables.required_prefix = _ | ||
dotnet_naming_symbols.variables.required_suffix = | ||
|
||
dotnet_naming_rule.camel_case_for_parameters.symbols = parameters | ||
dotnet_naming_symbols.parameters.applicable_kinds = parameter | ||
dotnet_naming_symbols.parameters.applicable_accessibilities = * | ||
dotnet_naming_symbols.parameters.required_prefix = | ||
dotnet_naming_symbols.parameters.required_suffix = | ||
|
||
dotnet_naming_rule.pascal_case_for_properties.symbols = properties | ||
dotnet_naming_symbols.properties.applicable_kinds = property | ||
dotnet_naming_symbols.properties.applicable_accessibilities = * | ||
dotnet_naming_symbols.properties.required_prefix = | ||
dotnet_naming_symbols.properties.required_suffix = | ||
|
||
dotnet_naming_rule.upper_case_for_constants.symbols = constants | ||
dotnet_naming_symbols.constants.applicable_kinds = field | ||
dotnet_naming_symbols.constants.applicable_accessibilities = * | ||
dotnet_naming_symbols.constants.required_prefix = | ||
dotnet_naming_symbols.constants.required_suffix = | ||
dotnet_naming_symbols.constants.required_capitalization = all_upper | ||
|
||
dotnet_style_require_accessibility_modifiers = always:suggestion | ||
dotnet_style_readonly_field = true:suggestion | ||
dotnet_style_qualify_field_access = false | ||
dotnet_style_qualify_property_access = false | ||
dotnet_style_qualify_method_access = false | ||
dotnet_style_qualify_event_access = false | ||
dotnet_style_prefer_auto_properties = true:suggestion | ||
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion | ||
|
||
csharp_new_line_before_open_brace = all | ||
csharp_new_line_before_else = true | ||
csharp_new_line_before_catch = true | ||
csharp_new_line_before_finally = true | ||
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 | ||
|
||
csharp_style_var_for_built_in_types = true:suggestion | ||
csharp_style_var_when_type_is_apparent = true:suggestion | ||
csharp_style_var_elsewhere = true:suggestion | ||
|
||
csharp_style_namespace_declarations = file_scoped | ||
|
||
dotnet_naming_rule.pascal_case_for_classes.style = pascal_case | ||
dotnet_naming_rule.pascal_case_for_interfaces.style = pascal_case | ||
dotnet_naming_rule.pascal_case_for_structs.style = pascal_case | ||
dotnet_naming_rule.pascal_case_for_methods.style = pascal_case | ||
dotnet_naming_rule.camel_case_for_variables.style = camel_case | ||
dotnet_naming_rule.camel_case_for_parameters.style = camel_case | ||
dotnet_naming_rule.pascal_case_for_properties.style = pascal_case | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As above. |
||
dotnet_naming_rule.upper_case_for_constants.style = all_upper | ||
|
||
dotnet_naming_style.pascal_case.capitalization = pascal_case | ||
dotnet_naming_style.camel_case.capitalization = camel_case | ||
dotnet_naming_style.all_upper.capitalization = all_upper | ||
|
||
dotnet_naming_rule.suffix_async_should_be_asyncsuffix.severity = error | ||
dotnet_naming_rule.suffix_async_should_be_asyncsuffix.symbols = suffix_async | ||
dotnet_naming_rule.suffix_async_should_be_asyncsuffix.style = asyncsuffix | ||
dotnet_naming_symbols.suffix_async.applicable_kinds = method | ||
dotnet_naming_symbols.suffix_async.applicable_accessibilities = * | ||
dotnet_naming_symbols.suffix_async.required_modifiers = async | ||
dotnet_naming_style.asyncsuffix.required_prefix = | ||
dotnet_naming_style.asyncsuffix.required_suffix = Async | ||
dotnet_naming_style.asyncsuffix.word_separator = | ||
dotnet_naming_style.asyncsuffix.capitalization = pascal_case | ||
|
||
csharp_preserve_single_line_statements = true | ||
csharp_style_allow_embedded_statements_on_same_line_experimental = false | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true | ||
csharp_style_allow_blank_line_after_block = true | ||
csharp_prefer_braces = true |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think Pascal is fine. Title case is used in C/C++
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, we require this. The normal C# convention is to use PascalCase for constants, we should amend.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, you mean use PascalCase here? I don't understand
The docs literally say use UPPER for constant variables.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@0x5bfa