Skip to content

Commit

Permalink
TransactionalSession v7 backport (#37)
Browse files Browse the repository at this point in the history
* GitHubSync update - main

* transactional session base types

* transactional session types

* initial att

* adapter and synchronizedstore in the custom persister

* more tests

* next batch of tests

* rest of acceptance tests

* cleaning up att from duplicated features and making sure alle types are loaded

* aligning core behavior with v8 version

* Update to core pre-release

* backporting generic atts

* add ci workflow

* add test helpers project

* add mongodb acceptance test

* sln file

* return wrapped storage session

* update to latest version of the backport

* Bring in current V8 code

* Fix compilation and unit tests

* Trying to fix acceptance tests

* Adjust the acceptance testing code to changes in V8

* including test context in the type scan

* passing tcs to custom persister via send options

* updating core ref

* aligning custom persister names and namespaces with v8 branch

* Bring back range

* Switch to netstandard

* Remove wildcard

* Add minver information

Co-authored-by: particularbot6 <[email protected]>
Co-authored-by: Szymon Pobiega <[email protected]>
Co-authored-by: Tim Bussmann <[email protected]>
Co-authored-by: danielmarbach <[email protected]>
  • Loading branch information
5 people authored Sep 9, 2022
1 parent 29eb217 commit 1722605
Show file tree
Hide file tree
Showing 62 changed files with 3,607 additions and 104 deletions.
339 changes: 339 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,339 @@
# TODO: Uncomment when analyzer line ending problem is fixed
#root = true

[*.{csproj,xml}]
indent_style = space
indent_size = 2

[*.cs]

dotnet_analyzer_diagnostic.severity = default

#### Core EditorConfig Options ####

# Indentation and spacing
indent_style = space
indent_size = 4

# New line preferences
# TODO: Uncomment when analyzer line ending problem is fixed
#end_of_line = unset
insert_final_newline = false


#### Code quality analysis

dotnet_diagnostic.CA1068.severity = error
dotnet_diagnostic.CA1710.severity = error
dotnet_diagnostic.CA1711.severity = error
dotnet_diagnostic.CA2007.severity = error
dotnet_diagnostic.CA2016.severity = error


#### .NET Coding Conventions ####

# this. and Me. preferences
dotnet_diagnostic.IDE0003.severity = error
dotnet_diagnostic.IDE0009.severity = error
dotnet_style_qualification_for_event = false:error
dotnet_style_qualification_for_field = false:error
dotnet_style_qualification_for_method = false:error
dotnet_style_qualification_for_property = false:error

# Language keywords vs BCL types preferences
dotnet_diagnostic.IDE0049.severity = error
dotnet_style_predefined_type_for_locals_parameters_members = true:error
dotnet_style_predefined_type_for_member_access = true:error

# Modifier preferences
dotnet_diagnostic.IDE0040.severity = error
dotnet_style_require_accessibility_modifiers = omit_if_default:error

# TODO: Change to error
dotnet_diagnostic.IDE0044.severity = suggestion
dotnet_style_readonly_field = true:suggestion

# Parentheses preferences
dotnet_diagnostic.IDE0047.severity = error
dotnet_diagnostic.IDE0048.severity = error
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity:error
dotnet_style_parentheses_in_other_operators = never_if_unnecessary:error
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity:error

# Expression-level preferences
dotnet_diagnostic.IDE0017.severity = error
dotnet_style_object_initializer = true:error

dotnet_diagnostic.IDE0028.severity = error
dotnet_style_collection_initializer = true:error

dotnet_diagnostic.IDE0033.severity = error
dotnet_style_explicit_tuple_names = true:error

dotnet_diagnostic.IDE0037.severity = error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error

dotnet_diagnostic.IDE0032.severity = error
dotnet_style_prefer_auto_properties = true:error

dotnet_diagnostic.IDE0054.severity = error
dotnet_diagnostic.IDE0074.severity = error
dotnet_style_prefer_compound_assignment = true:error

dotnet_diagnostic.IDE0071.severity = error
dotnet_style_prefer_simplified_interpolation = true:error

dotnet_diagnostic.IDE0075.severity = error
dotnet_style_prefer_simplified_boolean_expressions = true:error

dotnet_diagnostic.IDE0010.severity = error
dotnet_diagnostic.IDE0072.severity = error

dotnet_diagnostic.IDE0082.severity = error

dotnet_diagnostic.IDE0029.severity = error
dotnet_diagnostic.IDE0030.severity = error
dotnet_style_coalesce_expression = true:error

dotnet_diagnostic.IDE0031.severity = error
dotnet_style_null_propagation = true:error

dotnet_diagnostic.IDE0041.severity = error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error

dotnet_diagnostic.IDE0045.severity = silent
dotnet_style_prefer_conditional_expression_over_assignment = true:silent

dotnet_diagnostic.IDE0046.severity = silent
dotnet_style_prefer_conditional_expression_over_return = true:silent

# Undocumented: https://github.com/MicrosoftDocs/visualstudio-docs/issues/3641
dotnet_style_operator_placement_when_wrapping = beginning_of_line


#### C# Coding Conventions ####

# var preferences
dotnet_diagnostic.IDE0007.severity = error
csharp_style_var_elsewhere = false:silent
csharp_style_var_for_built_in_types = false:silent
csharp_style_var_when_type_is_apparent = true:error

# Expression-bodied members
# TODO: Change this entire category to error
dotnet_diagnostic.IDE0027.severity = suggestion
csharp_style_expression_bodied_accessors = true:suggestion

dotnet_diagnostic.IDE0021.severity = suggestion
csharp_style_expression_bodied_constructors = true:suggestion

dotnet_diagnostic.IDE0026.severity = suggestion
csharp_style_expression_bodied_indexers = true:suggestion

dotnet_diagnostic.IDE0053.severity = suggestion
csharp_style_expression_bodied_lambdas = true:suggestion

dotnet_diagnostic.IDE0061.severity = suggestion
csharp_style_expression_bodied_local_functions = true:suggestion

dotnet_diagnostic.IDE0022.severity = suggestion
csharp_style_expression_bodied_methods = true:suggestion

dotnet_diagnostic.IDE0023.severity = suggestion
dotnet_diagnostic.IDE0024.severity = suggestion
csharp_style_expression_bodied_operators = true:suggestion

dotnet_diagnostic.IDE0025.severity = error
csharp_style_expression_bodied_properties = true:error

# Pattern matching preferences
dotnet_diagnostic.IDE0019.severity = error
csharp_style_pattern_matching_over_as_with_null_check = true:error

dotnet_diagnostic.IDE0020.severity = error
dotnet_diagnostic.IDE0038.severity = error
csharp_style_pattern_matching_over_is_with_cast_check = true:error

dotnet_diagnostic.IDE0083.severity = error
csharp_style_prefer_not_pattern = true:error

dotnet_diagnostic.IDE0078.severity = error
csharp_style_prefer_pattern_matching = true:error

dotnet_diagnostic.IDE0066.severity = error
csharp_style_prefer_switch_expression = true:error

# Null-checking preferences
dotnet_diagnostic.IDE1005.severity = error
csharp_style_conditional_delegate_call = true:error

# Modifier preferences
# TODO: Change to error when we can use C# 8
dotnet_diagnostic.IDE0062.severity = suggestion
csharp_prefer_static_local_function = true:suggestion

dotnet_diagnostic.IDE0036.severity = error
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:error

# Code-block preferences
dotnet_diagnostic.IDE0011.severity = error
csharp_prefer_braces = true:error

dotnet_diagnostic.IDE0063.severity = suggestion
csharp_prefer_simple_using_statement = true:suggestion

# Expression-level preferences
dotnet_diagnostic.IDE0034.severity = error
csharp_prefer_simple_default_expression = true:error

dotnet_diagnostic.IDE0042.severity = suggestion
csharp_style_deconstructed_variable_declaration = true:suggestion

dotnet_diagnostic.IDE0018.severity = error
csharp_style_inlined_variable_declaration = true:error

dotnet_diagnostic.IDE0039.severity = suggestion
csharp_style_pattern_local_over_anonymous_function = true:suggestion

dotnet_diagnostic.IDE0056.severity = suggestion
csharp_style_prefer_index_operator = true:suggestion

dotnet_diagnostic.IDE0057.severity = suggestion
csharp_style_prefer_range_operator = true:suggestion

dotnet_diagnostic.IDE0016.severity = error
csharp_style_throw_expression = true:error

# 'using' directive preferences
dotnet_diagnostic.IDE0065.severity = error
csharp_using_directive_placement = inside_namespace:error

# File header preferences
dotnet_diagnostic.IDE0073.severity = error
file_header_template = unset


#### Unnecessary Code Rules ####

dotnet_diagnostic.IDE0001.severity = error
dotnet_diagnostic.IDE0002.severity = error
dotnet_diagnostic.IDE0004.severity = error
dotnet_diagnostic.IDE0005.severity = error
dotnet_diagnostic.IDE0035.severity = error
dotnet_diagnostic.IDE0051.severity = error
dotnet_diagnostic.IDE0052.severity = error

# TODO: Change to error
dotnet_diagnostic.IDE0058.severity = suggestion
csharp_style_unused_value_expression_statement_preference = discard_variable

dotnet_diagnostic.IDE0059.severity = error
csharp_style_unused_value_assignment_preference = discard_variable

dotnet_diagnostic.IDE0060.severity = error
dotnet_code_quality_unused_parameters = non_public

dotnet_diagnostic.IDE0079.severity = error
dotnet_remove_unnecessary_suppression_exclusions = none

dotnet_diagnostic.IDE0080.severity = error
dotnet_diagnostic.IDE0100.severity = error
dotnet_diagnostic.IDE0110.severity = error


#### Formatting Rules ####

dotnet_diagnostic.IDE0055.severity = error

# New line preferences
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_open_brace = all
csharp_new_line_between_query_expression_clauses = true

# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = true
csharp_indent_labels = one_less_than_current
csharp_indent_switch_labels = true

# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = false
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false

# Wrapping preferences
csharp_preserve_single_line_blocks = true
csharp_preserve_single_line_statements = false

# 'using' directive preferences
dotnet_sort_system_directives_first = true
dotnet_separate_import_directive_groups = false


#### Naming styles ####

dotnet_diagnostic.IDE1006.severity = error

# Naming rules
dotnet_naming_rule.interface_should_be_begins_with_i.severity = error
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i

dotnet_naming_rule.types_should_be_pascal_case.severity = error
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case

dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = error
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case

# Symbol specifications
dotnet_naming_symbols.interface.applicable_kinds = interface
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.interface.required_modifiers =

dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.types.required_modifiers =

dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
dotnet_naming_symbols.non_field_members.required_modifiers =

# Naming styles
dotnet_naming_style.pascal_case.required_prefix =
dotnet_naming_style.pascal_case.required_suffix =
dotnet_naming_style.pascal_case.word_separator =
dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_style.begins_with_i.required_prefix = I
dotnet_naming_style.begins_with_i.required_suffix =
dotnet_naming_style.begins_with_i.word_separator =
dotnet_naming_style.begins_with_i.capitalization = pascal_case
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: CI
on:
push:
branches:
- main
- release-*
pull_request:
workflow_dispatch:
env:
DOTNET_NOLOGO: true
jobs:
build:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: windows-2019
name: Windows
- os: ubuntu-20.04
name: Linux
fail-fast: false
steps:
- name: Checkout
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/[email protected]
with:
dotnet-version: 6.0.x
- name: Build
run: dotnet build src --configuration Release
- name: Upload packages
if: matrix.upload-packages && runner.os == 'Windows'
uses: actions/[email protected]
with:
name: NuGet packages
path: nugets/
retention-days: 7
- name: Run tests
uses: Particular/[email protected]
Loading

0 comments on commit 1722605

Please sign in to comment.