You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by bl...@apache.org on 2022/10/27 12:43:29 UTC
[pulsar-dotpulsar] branch master updated: Namespaces should File_scoped. (#119)
This is an automated email from the ASF dual-hosted git repository.
blankensteiner pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-dotpulsar.git
The following commit(s) were added to refs/heads/master by this push:
new 6bfe746 Namespaces should File_scoped. (#119)
6bfe746 is described below
commit 6bfe7469111a177e52920748be44d9cf0bc562b7
Author: entvex <en...@users.noreply.github.com>
AuthorDate: Thu Oct 27 14:43:23 2022 +0200
Namespaces should File_scoped. (#119)
Prefer long-form usings when using Rider/ReSharper
When using Visual Studio with ReSharper run Auto Clean on file save with the custom 'DotPulsar: Full Cleanup' profile
Co-authored-by: David Jensen <dj...@danskecommodities.com>
---
.editorconfig | 12 +++++++++++-
DotPulsar.sln.DotSettings | 11 ++++++-----
2 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/.editorconfig b/.editorconfig
index 8bb795d..24200ea 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -107,8 +107,10 @@ csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_inlined_variable_declaration = true:suggestion
# Namespace
+# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0065#csharp_using_directive_placement
csharp_using_directive_placement = inside_namespace:error
-csharp_style_namespace_declarations = block_scoped:silent
+# https://learn.microsoft.com/en-us/dotnet/fundamentals/code-analysis/style-rules/ide0160-ide0161#csharp_style_namespace_declarations
+csharp_style_namespace_declarations = file_scoped:error
###############################
# C# Formatting Rules #
###############################
@@ -186,6 +188,14 @@ resharper_constructor_or_destructor_body = expression_body
resharper_local_function_body = expression_body
# https://www.jetbrains.com/help/resharper/EditorConfig_CSHARP_CSharpCodeStylePageImplSchema.html?keymap=rs#resharper_csharp_method_or_operator_body
resharper_method_or_operator_body = expression_body
+####################################################################################
+## These are only active if enabled in code cleanup profile. ##
+## Editor | Code Cleanup | Optimize 'using' directives ##
+####################################################################################
+# https://www.jetbrains.com/help/rider/EditorConfig_CSHARP_CSharpCodeStylePageImplSchema.html#resharper_csharp_add_imports_to_deepest_scope
+resharper_csharp_add_imports_to_deepest_scope = true
+# https://www.jetbrains.com/help/rider/EditorConfig_CSHARP_CSharpCodeStylePageImplSchema.html#resharper_csharp_qualified_using_at_nested_scope
+resharper_csharp_qualified_using_at_nested_scope = true
################################################################
# Duplicates of options already set in .NET Coding Conventions #
################################################################
diff --git a/DotPulsar.sln.DotSettings b/DotPulsar.sln.DotSettings
index 574bd57..0996d2b 100644
--- a/DotPulsar.sln.DotSettings
+++ b/DotPulsar.sln.DotSettings
@@ -4,7 +4,8 @@
<s:Boolean x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeConstructorOrDestructorBody/@EntryIndexRemoved">True</s:Boolean>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=ArrangeRedundantParentheses/@EntryIndexedValue">DO_NOT_SHOW</s:String>
<s:String x:Key="/Default/CodeInspection/Highlighting/InspectionSeverities/=SuggestDiscardDeclarationVarStyle/@EntryIndexedValue">DO_NOT_SHOW</s:String>
- <s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=DotPulsar_003A_0020Full_0020Cleanup/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="DotPulsar: Full Cleanup"><CSCodeStyleAttributes ArrangeVarStyle="True" RemoveRedundantParentheses="True" /><CSOptimizeUsings></CSOptimizeUsings><IDEA_SETTINGS>&lt;profile version="1.0"&gt;
+ <s:Boolean x:Key="/Default/CodeStyle/CodeCleanup/CleanupOnSave/@EntryValue">True</s:Boolean>
+ <s:String x:Key="/Default/CodeStyle/CodeCleanup/Profiles/=DotPulsar_003A_0020Full_0020Cleanup/@EntryIndexedValue"><?xml version="1.0" encoding="utf-16"?><Profile name="DotPulsar: Full Cleanup"><CSCodeStyleAttributes ArrangeVarStyle="True" RemoveRedundantParentheses="True" ArrangeNamespaces="True" /><CSOptimizeUsings><OptimizeUsings>True</OptimizeUsings></CSOptimizeUsings><IDEA_SETTINGS>&lt;profile version="1.0"&gt;
&lt;option name="myName" value="DotPulsar: Full Cleanup" /&gt;
&lt;inspection_tool class="ES6ShorthandObjectProperty" enabled="false" level="WARNING" enabled_by_default="false" /&gt;
&lt;inspection_tool class="JSArrowFunctionBracesCanBeRemoved" enabled="false" level="WARNING" enabled_by_default="false" /&gt;
@@ -20,16 +21,16 @@
&lt;inspection_tool class="WrongPropertyKeyValueDelimiter" enabled="false" level="WEAK WARNING" enabled_by_default="false" /&gt;
&lt;/profile&gt;</IDEA_SETTINGS><CppCodeStyleCleanupDescriptor /><XAMLCollapseEmptyTags>False</XAMLCollapseEmptyTags><CSReformatCode>True</CSReformatCode><RIDER_SETTINGS>&lt;profile&gt;
&lt;Language id="CSS"&gt;
- &lt;Rearrange&gt;false&lt;/Rearrange&gt;
&lt;Reformat&gt;false&lt;/Reformat&gt;
+ &lt;Rearrange&gt;false&lt;/Rearrange&gt;
&lt;/Language&gt;
&lt;Language id="EditorConfig"&gt;
&lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;/Language&gt;
&lt;Language id="HTML"&gt;
+ &lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;Rearrange&gt;true&lt;/Rearrange&gt;
&lt;OptimizeImports&gt;true&lt;/OptimizeImports&gt;
- &lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;/Language&gt;
&lt;Language id="HTTP Request"&gt;
&lt;Reformat&gt;false&lt;/Reformat&gt;
@@ -47,9 +48,9 @@
&lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;/Language&gt;
&lt;Language id="JavaScript"&gt;
+ &lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;Rearrange&gt;false&lt;/Rearrange&gt;
&lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt;
- &lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;/Language&gt;
&lt;Language id="Markdown"&gt;
&lt;Reformat&gt;false&lt;/Reformat&gt;
@@ -64,9 +65,9 @@
&lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;/Language&gt;
&lt;Language id="XML"&gt;
+ &lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;Rearrange&gt;false&lt;/Rearrange&gt;
&lt;OptimizeImports&gt;false&lt;/OptimizeImports&gt;
- &lt;Reformat&gt;false&lt;/Reformat&gt;
&lt;/Language&gt;
&lt;Language id="yaml"&gt;
&lt;Reformat&gt;false&lt;/Reformat&gt;