diff --git a/dotnet/.editorconfig b/dotnet/.editorconfig new file mode 100644 index 0000000000..56b926dd0c --- /dev/null +++ b/dotnet/.editorconfig @@ -0,0 +1,431 @@ +# To learn more about .editorconfig see https://aka.ms/editorconfigdocs +############################### +# Core EditorConfig Options # +############################### +root = true +# All files +[*] +indent_style = space +end_of_line = lf + +# XML project files +[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}] +indent_size = 2 + +# XML config files +[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}] +indent_size = 2 + +# YAML config files +[*.{yml,yaml}] +tab_width = 2 +indent_size = 2 +insert_final_newline = true +trim_trailing_whitespace = true + +# JSON config files +[*.json] +tab_width = 2 +indent_size = 2 +insert_final_newline = false +trim_trailing_whitespace = true + +# Typescript files +[*.{ts,tsx}] +insert_final_newline = true +trim_trailing_whitespace = true +tab_width = 4 +indent_size = 4 +file_header_template = Copyright (c) Microsoft. All rights reserved. + +# Stylesheet files +[*.{css,scss,sass,less}] +insert_final_newline = true +trim_trailing_whitespace = true +tab_width = 4 +indent_size = 4 + +# Code files +[*.{cs,csx,vb,vbx}] +tab_width = 4 +indent_size = 4 +insert_final_newline = true +trim_trailing_whitespace = true +charset = utf-8-bom +file_header_template = Copyright (c) Microsoft. All rights reserved. + +############################### +# .NET Coding Conventions # +############################### +[*.{cs,vb}] +# Organize usings +dotnet_sort_system_directives_first = true +# this. preferences +dotnet_style_qualification_for_field = true:error +dotnet_style_qualification_for_property = true:error +dotnet_style_qualification_for_method = true:error +dotnet_style_qualification_for_event = true:error +# Language keywords vs BCL types preferences +dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion +dotnet_style_predefined_type_for_member_access = true:suggestion +# Parentheses preferences +dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:suggestion +dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:suggestion +dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:silent +dotnet_style_parentheses_in_other_operators = never_if_unnecessary:silent +# Modifier preferences +dotnet_style_require_accessibility_modifiers = for_non_interface_members:error +dotnet_style_readonly_field = true:warning +# Expression-level preferences +dotnet_style_object_initializer = true:suggestion +dotnet_style_collection_initializer = true:suggestion +dotnet_style_explicit_tuple_names = true:suggestion +dotnet_style_null_propagation = true:suggestion +dotnet_style_coalesce_expression = true:suggestion +dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion +dotnet_style_prefer_inferred_tuple_names = true:suggestion +dotnet_style_prefer_inferred_anonymous_type_member_names = true:silent +dotnet_style_prefer_auto_properties = true:suggestion +dotnet_style_prefer_conditional_expression_over_assignment = true:silent +dotnet_style_prefer_conditional_expression_over_return = true:silent +dotnet_style_prefer_simplified_interpolation = true:suggestion +dotnet_style_operator_placement_when_wrapping = beginning_of_line +dotnet_style_prefer_simplified_boolean_expressions = true:suggestion +dotnet_style_prefer_compound_assignment = true:suggestion +# Code quality rules +dotnet_code_quality_unused_parameters = all:suggestion + +[*.cs] +# Note: these settings cause "dotnet format" to fix the code. You should review each change if you uses "dotnet format". +dotnet_diagnostic.RCS1036.severity = warning # Remove unnecessary blank line. +dotnet_diagnostic.RCS1037.severity = warning # Remove trailing white-space. +dotnet_diagnostic.RCS1097.severity = warning # Remove redundant 'ToString' call. +dotnet_diagnostic.RCS1138.severity = warning # Add summary to documentation comment. +dotnet_diagnostic.RCS1139.severity = warning # Add summary element to documentation comment. +dotnet_diagnostic.RCS1168.severity = warning # Parameter name 'foo' differs from base name 'bar'. +dotnet_diagnostic.RCS1175.severity = warning # Unused 'this' parameter 'operation'. +dotnet_diagnostic.RCS1192.severity = warning # Unnecessary usage of verbatim string literal. +dotnet_diagnostic.RCS1194.severity = warning # Implement exception constructors. +dotnet_diagnostic.RCS1211.severity = warning # Remove unnecessary else clause. +dotnet_diagnostic.RCS1214.severity = warning # Unnecessary interpolated string. +dotnet_diagnostic.RCS1225.severity = warning # Make class sealed. +dotnet_diagnostic.RCS1232.severity = warning # Order elements in documentation comment. + +# Commented out because `dotnet format` change can be disruptive. +# dotnet_diagnostic.RCS1085.severity = warning # Use auto-implemented property. + +# Commented out because `dotnet format` removes the xmldoc element, while we should add the missing documentation instead. +# dotnet_diagnostic.RCS1228.severity = warning # Unused element in documentation comment. + +# Diagnostics elevated as warnings +dotnet_diagnostic.CA1000.severity = warning # Do not declare static members on generic types +dotnet_diagnostic.CA1031.severity = warning # Do not catch general exception types +dotnet_diagnostic.CA1050.severity = warning # Declare types in namespaces +dotnet_diagnostic.CA1063.severity = warning # Implement IDisposable correctly +dotnet_diagnostic.CA1064.severity = warning # Exceptions should be public +dotnet_diagnostic.CA1416.severity = warning # Validate platform compatibility +dotnet_diagnostic.CA1508.severity = warning # Avoid dead conditional code +dotnet_diagnostic.CA1852.severity = warning # Sealed classes +dotnet_diagnostic.CA1859.severity = warning # Use concrete types when possible for improved performance +dotnet_diagnostic.CA1860.severity = warning # Prefer comparing 'Count' to 0 rather than using 'Any()', both for clarity and for performance +dotnet_diagnostic.CA2000.severity = warning # Call System.IDisposable.Dispose on object before all references to it are out of scope +dotnet_diagnostic.CA2201.severity = warning # Exception type System.Exception is not sufficiently specific + +dotnet_diagnostic.IDE0001.severity = warning # Simplify name +dotnet_diagnostic.IDE0005.severity = warning # Remove unnecessary using directives +dotnet_diagnostic.IDE0009.severity = warning # Add this or Me qualification +dotnet_diagnostic.IDE0011.severity = warning # Add braces +dotnet_diagnostic.IDE0018.severity = warning # Inline variable declaration + +dotnet_diagnostic.IDE0032.severity = warning # Use auto-implemented property +dotnet_diagnostic.IDE0034.severity = warning # Simplify 'default' expression +dotnet_diagnostic.IDE0035.severity = warning # Remove unreachable code +dotnet_diagnostic.IDE0040.severity = warning # Add accessibility modifiers +dotnet_diagnostic.IDE0049.severity = warning # Use language keywords instead of framework type names for type references +dotnet_diagnostic.IDE0050.severity = warning # Convert anonymous type to tuple +dotnet_diagnostic.IDE0051.severity = warning # Remove unused private member +dotnet_diagnostic.IDE0055.severity = warning # Formatting rule +dotnet_diagnostic.IDE0060.severity = warning # Remove unused parameter +dotnet_diagnostic.IDE0070.severity = warning # Use 'System.HashCode.Combine' +dotnet_diagnostic.IDE0071.severity = warning # Simplify interpolation +dotnet_diagnostic.IDE0073.severity = warning # Require file header +dotnet_diagnostic.IDE0082.severity = warning # Convert typeof to nameof +dotnet_diagnostic.IDE0090.severity = warning # Simplify new expression +dotnet_diagnostic.IDE0161.severity = warning # Use file-scoped namespace + +# Suppressed diagnostics +dotnet_diagnostic.CA1002.severity = none # Change 'List' in '...' to use 'Collection' ... +dotnet_diagnostic.CA1032.severity = none # We're using RCS1194 which seems to cover more ctors +dotnet_diagnostic.CA1034.severity = none # Do not nest type. Alternatively, change its accessibility so that it is not externally visible +dotnet_diagnostic.CA1062.severity = none # Disable null check, C# already does it for us +dotnet_diagnostic.CA1303.severity = none # Do not pass literals as localized parameters +dotnet_diagnostic.CA1305.severity = none # Operation could vary based on current user's locale settings +dotnet_diagnostic.CA1307.severity = none # Operation has an overload that takes a StringComparison +dotnet_diagnostic.CA1508.severity = none # Avoid dead conditional code. Too many false positives. +dotnet_diagnostic.CA1510.severity = none # ArgumentNullException.Throw +dotnet_diagnostic.CA1512.severity = none # ArgumentOutOfRangeException.Throw +dotnet_diagnostic.CA1515.severity = none # Making public types from exes internal +dotnet_diagnostic.CA1805.severity = none # Member is explicitly initialized to its default value +dotnet_diagnostic.CA1822.severity = none # Member does not access instance data and can be marked as static +dotnet_diagnostic.CA1848.severity = none # For improved performance, use the LoggerMessage delegates +dotnet_diagnostic.CA1849.severity = none # Use async equivalent; analyzer is currently noisy +dotnet_diagnostic.CA1865.severity = none # StartsWith(char) +dotnet_diagnostic.CA1867.severity = none # EndsWith(char) +dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task +dotnet_diagnostic.CA2225.severity = none # Operator overloads have named alternates +dotnet_diagnostic.CA2227.severity = none # Change to be read-only by removing the property setter +dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters +dotnet_diagnostic.CA2253.severity = none # Named placeholders in the logging message template should not be comprised of only numeric characters +dotnet_diagnostic.CA2263.severity = suggestion # Use generic overload + +dotnet_diagnostic.VSTHRD003.severity = none # Waiting on thread from another context +dotnet_diagnostic.VSTHRD103.severity = none # Use async equivalent; analyzer is currently noisy +dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave +dotnet_diagnostic.VSTHRD200.severity = none # Use Async suffix for async methods +dotnet_diagnostic.xUnit1004.severity = none # Test methods should not be skipped. Remove the Skip property to start running the test again. + +dotnet_diagnostic.RCS1021.severity = none # Use expression-bodied lambda. +dotnet_diagnostic.RCS1032.severity = none # Remove redundant parentheses. +dotnet_diagnostic.RCS1061.severity = none # Merge 'if' with nested 'if'. +dotnet_diagnostic.RCS1069.severity = none # Remove unnecessary case label. +dotnet_diagnostic.RCS1074.severity = none # Remove redundant constructor. +dotnet_diagnostic.RCS1077.severity = none # Optimize LINQ method call. +dotnet_diagnostic.RCS1118.severity = none # Mark local variable as const. +dotnet_diagnostic.RCS1124.severity = none # Inline local variable. +dotnet_diagnostic.RCS1129.severity = none # Remove redundant field initialization. +dotnet_diagnostic.RCS1140.severity = none # Add exception to documentation comment. +dotnet_diagnostic.RCS1141.severity = none # Add 'param' element to documentation comment. +dotnet_diagnostic.RCS1142.severity = none # Add 'typeparam' element to documentation comment. +dotnet_diagnostic.RCS1146.severity = none # Use conditional access. +dotnet_diagnostic.RCS1151.severity = none # Remove redundant cast. +dotnet_diagnostic.RCS1158.severity = none # Static member in generic type should use a type parameter. +dotnet_diagnostic.RCS1161.severity = none # Enum should declare explicit value +dotnet_diagnostic.RCS1163.severity = none # Unused parameter 'foo'. +dotnet_diagnostic.RCS1170.severity = none # Use read-only auto-implemented property. +dotnet_diagnostic.RCS1173.severity = none # Use coalesce expression instead of 'if'. +dotnet_diagnostic.RCS1181.severity = none # Convert comment to documentation comment. +dotnet_diagnostic.RCS1186.severity = none # Use Regex instance instead of static method. +dotnet_diagnostic.RCS1188.severity = none # Remove redundant auto-property initialization. +dotnet_diagnostic.RCS1189.severity = none # Add region name to #endregion. +dotnet_diagnostic.RCS1197.severity = none # Optimize StringBuilder.AppendLine call. +dotnet_diagnostic.RCS1201.severity = none # Use method chaining. +dotnet_diagnostic.RCS1205.severity = none # Order named arguments according to the order of parameters. +dotnet_diagnostic.RCS1212.severity = none # Remove redundant assignment. +dotnet_diagnostic.RCS1217.severity = none # Convert interpolated string to concatenation. +dotnet_diagnostic.RCS1222.severity = none # Merge preprocessor directives. +dotnet_diagnostic.RCS1226.severity = none # Add paragraph to documentation comment. +dotnet_diagnostic.RCS1229.severity = none # Use async/await when necessary. +dotnet_diagnostic.RCS1234.severity = none # Enum duplicate value +dotnet_diagnostic.RCS1238.severity = none # Avoid nested ?: operators. +dotnet_diagnostic.RCS1241.severity = none # Implement IComparable when implementing IComparable. + +dotnet_diagnostic.IDE0001.severity = none # Simplify name +dotnet_diagnostic.IDE0002.severity = none # Simplify member access +dotnet_diagnostic.IDE0004.severity = none # Remove unnecessary cast +dotnet_diagnostic.IDE0010.severity = none # Populate switch +dotnet_diagnostic.IDE0021.severity = none # Use block body for constructors +dotnet_diagnostic.IDE0022.severity = none # Use block body for methods +dotnet_diagnostic.IDE0024.severity = none # Use block body for operator +dotnet_diagnostic.IDE0035.severity = none # Remove unreachable code +dotnet_diagnostic.IDE0051.severity = none # Remove unused private member +dotnet_diagnostic.IDE0052.severity = none # Remove unread private member +dotnet_diagnostic.IDE0058.severity = none # Remove unused expression value +dotnet_diagnostic.IDE0059.severity = none # Unnecessary assignment of a value +dotnet_diagnostic.IDE0060.severity = none # Remove unused parameter +dotnet_diagnostic.IDE0061.severity = none # Use block body for local function +dotnet_diagnostic.IDE0079.severity = none # Remove unnecessary suppression. +dotnet_diagnostic.IDE0080.severity = none # Remove unnecessary suppression operator. +dotnet_diagnostic.IDE0100.severity = none # Remove unnecessary equality operator +dotnet_diagnostic.IDE0110.severity = none # Remove unnecessary discards +dotnet_diagnostic.IDE0130.severity = none # Namespace does not match folder structure +dotnet_diagnostic.IDE0290.severity = none # Use primary constructor +dotnet_diagnostic.IDE0032.severity = none # Use auto property +dotnet_diagnostic.IDE0160.severity = none # Use block-scoped namespace +dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations +dotnet_diagnostic.IDE0046.severity = suggestion # If statement can be simplified +dotnet_diagnostic.IDE0056.severity = suggestion # Indexing can be simplified +dotnet_diagnostic.IDE0057.severity = suggestion # Substring can be simplified + +dotnet_diagnostic.CA2007.severity = error # Do not directly await a Task +dotnet_diagnostic.VSTHRD111.severity = error # Use .ConfigureAwait(bool) +dotnet_diagnostic.IDE1006.severity = error # Naming rule violations + +# Testing +dotnet_diagnostic.Moq1400.severity = none # Explicitly choose a mocking behavior instead of relying on the default (Loose) behavior + +# Resharper disabled rules: https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#CodeSmell +resharper_not_resolved_in_text_highlighting = none # Disable Resharper's "Not resolved in text" highlighting +resharper_check_namespace_highlighting = none # Disable Resharper's "Check namespace" highlighting +resharper_object_creation_as_statement_highlighting = none # Disable Resharper's "Object creation as statement" highlighting + +############################### +# Naming Conventions # +############################### + +# Styles + +dotnet_naming_style.pascal_case_style.capitalization = pascal_case + +dotnet_naming_style.camel_case_style.capitalization = camel_case + +dotnet_naming_style.static_underscored.capitalization = camel_case +dotnet_naming_style.static_underscored.required_prefix = s_ + +dotnet_naming_style.underscored.capitalization = camel_case +dotnet_naming_style.underscored.required_prefix = _ + +dotnet_naming_style.uppercase_with_underscore_separator.capitalization = all_upper +dotnet_naming_style.uppercase_with_underscore_separator.word_separator = _ + +dotnet_naming_style.end_in_async.required_prefix = +dotnet_naming_style.end_in_async.required_suffix = Async +dotnet_naming_style.end_in_async.capitalization = pascal_case +dotnet_naming_style.end_in_async.word_separator = + +# Symbols + +dotnet_naming_symbols.constant_fields.applicable_kinds = field +dotnet_naming_symbols.constant_fields.applicable_accessibilities = * +dotnet_naming_symbols.constant_fields.required_modifiers = const + +dotnet_naming_symbols.local_constant.applicable_kinds = local +dotnet_naming_symbols.local_constant.applicable_accessibilities = * +dotnet_naming_symbols.local_constant.required_modifiers = const + +dotnet_naming_symbols.private_static_fields.applicable_kinds = field +dotnet_naming_symbols.private_static_fields.applicable_accessibilities = private +dotnet_naming_symbols.private_static_fields.required_modifiers = static + +dotnet_naming_symbols.private_fields.applicable_kinds = field +dotnet_naming_symbols.private_fields.applicable_accessibilities = private + +dotnet_naming_symbols.any_async_methods.applicable_kinds = method +dotnet_naming_symbols.any_async_methods.applicable_accessibilities = * +dotnet_naming_symbols.any_async_methods.required_modifiers = async + +# Rules + +dotnet_naming_rule.constant_fields_should_be_pascal_case.symbols = constant_fields +dotnet_naming_rule.constant_fields_should_be_pascal_case.style = pascal_case_style +dotnet_naming_rule.constant_fields_should_be_pascal_case.severity = error + +dotnet_naming_rule.local_constant_should_be_pascal_case.symbols = local_constant +dotnet_naming_rule.local_constant_should_be_pascal_case.style = pascal_case_style +dotnet_naming_rule.local_constant_should_be_pascal_case.severity = error + +dotnet_naming_rule.private_static_fields_underscored.symbols = private_static_fields +dotnet_naming_rule.private_static_fields_underscored.style = static_underscored +dotnet_naming_rule.private_static_fields_underscored.severity = error + +dotnet_naming_rule.private_fields_underscored.symbols = private_fields +dotnet_naming_rule.private_fields_underscored.style = underscored +dotnet_naming_rule.private_fields_underscored.severity = error + +dotnet_naming_rule.async_methods_end_in_async.symbols = any_async_methods +dotnet_naming_rule.async_methods_end_in_async.style = end_in_async +dotnet_naming_rule.async_methods_end_in_async.severity = error + +############################### +# C# Coding Conventions # +############################### + +# var preferences +csharp_style_var_for_built_in_types = false:none +csharp_style_var_when_type_is_apparent = false:none +csharp_style_var_elsewhere = false:none +# Expression-bodied members +csharp_style_expression_bodied_methods = false:silent +csharp_style_expression_bodied_constructors = false:silent +csharp_style_expression_bodied_operators = false:silent +csharp_style_expression_bodied_properties = true:silent +csharp_style_expression_bodied_indexers = true:silent +csharp_style_expression_bodied_accessors = true:silent +# Pattern matching preferences +csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion +csharp_style_pattern_matching_over_as_with_null_check = true:suggestion +# Null-checking preferences +csharp_style_throw_expression = true:suggestion +csharp_style_conditional_delegate_call = true:suggestion +# Modifier preferences +csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion +# Expression-level preferences +csharp_prefer_braces = true:error +csharp_style_deconstructed_variable_declaration = true:suggestion +csharp_prefer_simple_default_expression = true:suggestion +csharp_style_prefer_local_over_anonymous_function = true:error +csharp_style_inlined_variable_declaration = true:suggestion + +############################### +# C# Formatting Rules # +############################### + +# New line preferences +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 = false # Does not work with resharper, forcing code to be on long lines instead of wrapping +csharp_new_line_before_members_in_anonymous_types = true +csharp_new_line_between_query_expression_clauses = true +# Indentation preferences +csharp_indent_braces = false +csharp_indent_case_contents = true +csharp_indent_case_contents_when_block = false +csharp_indent_switch_labels = true +csharp_indent_labels = flush_left +# Space preferences +csharp_space_after_cast = false +csharp_space_after_keywords_in_control_flow_statements = true +csharp_space_between_method_call_parameter_list_parentheses = false +csharp_space_between_method_declaration_parameter_list_parentheses = false +csharp_space_between_parentheses = false +csharp_space_before_colon_in_inheritance_clause = true +csharp_space_after_colon_in_inheritance_clause = true +csharp_space_around_binary_operators = before_and_after +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_empty_parameter_list_parentheses = false +# Wrapping preferences +csharp_preserve_single_line_statements = true +csharp_preserve_single_line_blocks = true +csharp_using_directive_placement = outside_namespace:warning +csharp_prefer_simple_using_statement = true:suggestion +csharp_style_namespace_declarations = file_scoped:warning +csharp_style_prefer_method_group_conversion = true:silent +csharp_style_prefer_top_level_statements = true:silent +csharp_style_expression_bodied_lambdas = true:silent +csharp_style_expression_bodied_local_functions = false:silent + +############################### +# Resharper Rules # +############################### + +# Resharper disabled rules: https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#CodeSmell +resharper_redundant_linebreak_highlighting = none # Disable Resharper's "Redundant line break" highlighting +resharper_missing_linebreak_highlighting = none # Disable Resharper's "Missing line break" highlighting +resharper_bad_empty_braces_line_breaks_highlighting = none # Disable Resharper's "Bad empty braces line breaks" highlighting +resharper_missing_indent_highlighting = none # Disable Resharper's "Missing indent" highlighting +resharper_missing_blank_lines_highlighting = none # Disable Resharper's "Missing blank lines" highlighting +resharper_wrong_indent_size_highlighting = none # Disable Resharper's "Wrong indent size" highlighting +resharper_bad_indent_highlighting = none # Disable Resharper's "Bad indent" highlighting +resharper_bad_expression_braces_line_breaks_highlighting = none # Disable Resharper's "Bad expression braces line breaks" highlighting +resharper_multiple_spaces_highlighting = none # Disable Resharper's "Multiple spaces" highlighting +resharper_bad_expression_braces_indent_highlighting = none # Disable Resharper's "Bad expression braces indent" highlighting +resharper_bad_control_braces_indent_highlighting = none # Disable Resharper's "Bad control braces indent" highlighting +resharper_bad_preprocessor_indent_highlighting = none # Disable Resharper's "Bad preprocessor indent" highlighting +resharper_redundant_blank_lines_highlighting = none # Disable Resharper's "Redundant blank lines" highlighting +resharper_multiple_statements_on_one_line_highlighting = none # Disable Resharper's "Multiple statements on one line" highlighting +resharper_bad_braces_spaces_highlighting = none # Disable Resharper's "Bad braces spaces" highlighting +resharper_outdent_is_off_prev_level_highlighting = none # Disable Resharper's "Outdent is off previous level" highlighting +resharper_bad_symbol_spaces_highlighting = none # Disable Resharper's "Bad symbol spaces" highlighting +resharper_bad_colon_spaces_highlighting = none # Disable Resharper's "Bad colon spaces" highlighting +resharper_bad_semicolon_spaces_highlighting = none # Disable Resharper's "Bad semicolon spaces" highlighting +resharper_bad_square_brackets_spaces_highlighting = none # Disable Resharper's "Bad square brackets spaces" highlighting +resharper_bad_parens_spaces_highlighting = none # Disable Resharper's "Bad parens spaces" highlighting + +# Resharper enabled rules: https://www.jetbrains.com/help/resharper/Reference__Code_Inspections_CSHARP.html#CodeSmell +resharper_comment_typo_highlighting = suggestion # Resharper's "Comment typo" highlighting +resharper_redundant_using_directive_highlighting = warning # Resharper's "Redundant using directive" highlighting +resharper_inconsistent_naming_highlighting = warning # Resharper's "Inconsistent naming" highlighting +resharper_redundant_this_qualifier_highlighting = warning # Resharper's "Redundant 'this' qualifier" highlighting +resharper_arrange_this_qualifier_highlighting = warning # Resharper's "Arrange 'this' qualifier" highlighting diff --git a/dotnet/.gitignore b/dotnet/.gitignore new file mode 100644 index 0000000000..ce1409abe9 --- /dev/null +++ b/dotnet/.gitignore @@ -0,0 +1,405 @@ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/main/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +[Aa][Rr][Mm]64[Ee][Cc]/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +# but not Directory.Build.rsp, as it configures directory-level build defaults +!Directory.Build.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.tlog +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio 6 auto-generated project file (contains which files were open etc.) +*.vbp + +# Visual Studio 6 workspace and project file (working project files containing files to include in project) +*.dsw +*.dsp + +# Visual Studio 6 technical files +*.ncb +*.aps + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# AWS SAM Build and Temporary Artifacts folder +.aws-sam + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# Visual Studio History (VSHistory) files +.vshistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +# VS Code files for those working on multiple tools +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json +*.code-workspace + +# Local History for Visual Studio Code +.history/ + +# Windows Installer files from build outputs +*.cab +*.msi +*.msix +*.msm +*.msp + +# JetBrains Rider +*.sln.iml \ No newline at end of file diff --git a/dotnet/Directory.Build.props b/dotnet/Directory.Build.props new file mode 100644 index 0000000000..fb3fcfdef2 --- /dev/null +++ b/dotnet/Directory.Build.props @@ -0,0 +1,46 @@ + + + + true + true + AllEnabledByDefault + latest + true + 12 + enable + disable + $(NoWarn);IDE0290;IDE0079 + net472;net8.0;net9.0;netstandard2.0 + net9.0 + true + + + + false + + + + + disable + + + + True + + + + + $(NoWarn);CS8604;CS8602 + + + + $([System.IO.Path]::GetDirectoryName($([MSBuild]::GetPathOfFileAbove('CODE_OF_CONDUCT.md', '$(MSBuildThisFileDirectory)')))) + + + + + + <_Parameter1>false + + + diff --git a/dotnet/Directory.Build.targets b/dotnet/Directory.Build.targets new file mode 100644 index 0000000000..834abad11b --- /dev/null +++ b/dotnet/Directory.Build.targets @@ -0,0 +1,13 @@ + + + + + + + + + + + + diff --git a/dotnet/Directory.Packages.props b/dotnet/Directory.Packages.props new file mode 100644 index 0000000000..d863e4cbc3 --- /dev/null +++ b/dotnet/Directory.Packages.props @@ -0,0 +1,60 @@ + + + + + true + + + + + + + + + + + + + + + + + + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + + diff --git a/dotnet/agent-framework-dotnet.slnx b/dotnet/agent-framework-dotnet.slnx new file mode 100644 index 0000000000..34e2890d2e --- /dev/null +++ b/dotnet/agent-framework-dotnet.slnx @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/dotnet/global.json b/dotnet/global.json new file mode 100644 index 0000000000..402d97f665 --- /dev/null +++ b/dotnet/global.json @@ -0,0 +1,7 @@ +{ + "sdk": { + "version": "9.0.300", + "rollForward": "latestMajor", + "allowPrerelease": false + } +} \ No newline at end of file diff --git a/dotnet/nuget/NUGET.md b/dotnet/nuget/NUGET.md new file mode 100644 index 0000000000..fb422cf9b1 --- /dev/null +++ b/dotnet/nuget/NUGET.md @@ -0,0 +1,10 @@ +# About Microsoft Agent Framework + +To be filled in. + +# Getting Started ⚡ + +- Learn more at the [documentation site](https://aka.ms/TBD). +- Join the [Discord community](https://aka.ms/TBD). +- Follow the team on [Semantic Kernel blog](https://aka.ms/TBD). +- Check out the [GitHub repository](https://github.com/microsoft/agent-framework) for the latest updates. diff --git a/dotnet/nuget/icon.png b/dotnet/nuget/icon.png new file mode 100644 index 0000000000..3b0b19bd41 Binary files /dev/null and b/dotnet/nuget/icon.png differ diff --git a/dotnet/nuget/nuget-package.props b/dotnet/nuget/nuget-package.props new file mode 100644 index 0000000000..64d8cb2ebf --- /dev/null +++ b/dotnet/nuget/nuget-package.props @@ -0,0 +1,70 @@ + + + + 0.0.1 + $(VersionPrefix)-$(VersionSuffix) + $(VersionPrefix) + + Debug;Release;Publish + true + + + 0.0.1 + + $(NoWarn);CP0003 + + $(NoWarn);CP1002 + + + true + + + all + + + low + + + Microsoft + Microsoft + Agent Framework + Empowers app owners to integrate Agents quickly and easily into their apps. + AI, Artificial Intelligence, Agent, SDK, Framework + $(AssemblyName) + + + MIT + © Microsoft Corporation. All rights reserved. + https://aka.ms/tbd + https://github.com/microsoft/agent-framework + true + + + icon.png + icon.png + NUGET.md + + + true + snupkg + + + bin\$(Configuration)\$(TargetFramework)\$(AssemblyName).xml + + + + + + + + + + + + + + + + true + + diff --git a/dotnet/src/Microsoft.Agents.Abstractions/Agent.cs b/dotnet/src/Microsoft.Agents.Abstractions/Agent.cs new file mode 100644 index 0000000000..f028d80468 --- /dev/null +++ b/dotnet/src/Microsoft.Agents.Abstractions/Agent.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft. All rights reserved. + +namespace Microsoft.Agents; + +/// +/// Placeholder class. +/// +public class Agent +{ +} diff --git a/dotnet/src/Microsoft.Agents.Abstractions/Microsoft.Agents.Abstractions.csproj b/dotnet/src/Microsoft.Agents.Abstractions/Microsoft.Agents.Abstractions.csproj new file mode 100644 index 0000000000..4b684d423b --- /dev/null +++ b/dotnet/src/Microsoft.Agents.Abstractions/Microsoft.Agents.Abstractions.csproj @@ -0,0 +1,21 @@ + + + + $(ProjectsTargetFrameworks) + Microsoft.Agents + alpha + + + + $(ProjectsDebugTargetFrameworks) + + + + + + + Microsoft Agent Framework Abstractions + Contains the Microsoft Agent Framework interfaces and abstractions. + + + diff --git a/dotnet/src/Microsoft.Agents/AgentImplementation.cs b/dotnet/src/Microsoft.Agents/AgentImplementation.cs new file mode 100644 index 0000000000..f7b14b0536 --- /dev/null +++ b/dotnet/src/Microsoft.Agents/AgentImplementation.cs @@ -0,0 +1,10 @@ +// Copyright (c) Microsoft. All rights reserved. + +namespace Microsoft.Agents; + +/// +/// Placeholder class. +/// +public class AgentImplementation +{ +} diff --git a/dotnet/src/Microsoft.Agents/Microsoft.Agents.csproj b/dotnet/src/Microsoft.Agents/Microsoft.Agents.csproj new file mode 100644 index 0000000000..993dd889cc --- /dev/null +++ b/dotnet/src/Microsoft.Agents/Microsoft.Agents.csproj @@ -0,0 +1,24 @@ + + + + $(ProjectsTargetFrameworks) + alpha + + + + $(ProjectsDebugTargetFrameworks) + + + + + + + + + + + Microsoft Agent Framework + Contains the Microsoft Agent Framework core functionality. + + + diff --git a/dotnet/tests/.editorconfig b/dotnet/tests/.editorconfig new file mode 100644 index 0000000000..d8ab5b5399 --- /dev/null +++ b/dotnet/tests/.editorconfig @@ -0,0 +1,6 @@ +# Suppressing errors for Test projects under dotnet folder +[*.cs] +dotnet_diagnostic.CA2007.severity = none # Do not directly await a Task +dotnet_diagnostic.CS1591.severity = none # Missing XML comment for publicly visible type or member +dotnet_diagnostic.IDE1006.severity = warning # Naming rule violations +dotnet_diagnostic.VSTHRD111.severity = none # Use .ConfigureAwait(bool) is hidden by default, set to none to prevent IDE from changing on autosave diff --git a/dotnet/tests/Directory.Build.props b/dotnet/tests/Directory.Build.props new file mode 100644 index 0000000000..1847b29642 --- /dev/null +++ b/dotnet/tests/Directory.Build.props @@ -0,0 +1,25 @@ + + + + + + false + true + false + net472;net9.0 + net9.0 + + + + + + + + + + + + + + + diff --git a/dotnet/tests/Microsoft.Agents.Abstractions.UnitTests/Microsoft.Agents.Abstractions.UnitTests.csproj b/dotnet/tests/Microsoft.Agents.Abstractions.UnitTests/Microsoft.Agents.Abstractions.UnitTests.csproj new file mode 100644 index 0000000000..e7f7c13861 --- /dev/null +++ b/dotnet/tests/Microsoft.Agents.Abstractions.UnitTests/Microsoft.Agents.Abstractions.UnitTests.csproj @@ -0,0 +1,15 @@ + + + + $(ProjectsTargetFrameworks) + + + + $(ProjectsDebugTargetFrameworks) + + + + + + + diff --git a/dotnet/tests/Microsoft.Agents.Abstractions.UnitTests/UnitTest1.cs b/dotnet/tests/Microsoft.Agents.Abstractions.UnitTests/UnitTest1.cs new file mode 100644 index 0000000000..b5b95f77dc --- /dev/null +++ b/dotnet/tests/Microsoft.Agents.Abstractions.UnitTests/UnitTest1.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft. All rights reserved. + +namespace Microsoft.Agents.Abstractions.Tests; + +/// +/// Placeholder. +/// +public class UnitTest1 +{ + [Fact] + public void Test1() + { + } +} diff --git a/dotnet/tests/Microsoft.Agents.UnitTests/Microsoft.Agents.UnitTests.csproj b/dotnet/tests/Microsoft.Agents.UnitTests/Microsoft.Agents.UnitTests.csproj new file mode 100644 index 0000000000..6ca2dca2fd --- /dev/null +++ b/dotnet/tests/Microsoft.Agents.UnitTests/Microsoft.Agents.UnitTests.csproj @@ -0,0 +1,15 @@ + + + + $(ProjectsTargetFrameworks) + + + + $(ProjectsDebugTargetFrameworks) + + + + + + + diff --git a/dotnet/tests/Microsoft.Agents.UnitTests/UnitTest1.cs b/dotnet/tests/Microsoft.Agents.UnitTests/UnitTest1.cs new file mode 100644 index 0000000000..5b4e09b237 --- /dev/null +++ b/dotnet/tests/Microsoft.Agents.UnitTests/UnitTest1.cs @@ -0,0 +1,14 @@ +// Copyright (c) Microsoft. All rights reserved. + +namespace Microsoft.Agents.Tests; + +/// +/// Placeholder. +/// +public class UnitTest1 +{ + [Fact] + public void Test1() + { + } +}