Skip to content

Commit d10b368

Browse files
authored
Merged main into release/7.x for 7.0 Preview 7
2 parents 5b659f2 + 9c1048f commit d10b368

File tree

188 files changed

+1709
-664
lines changed

Some content is hidden

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

188 files changed

+1709
-664
lines changed

.editorconfig

Lines changed: 239 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,239 @@
1+
root = true
2+
3+
#### Default Core EditorConfig Options ####
4+
[*]
5+
insert_final_newline = true
6+
indent_style = space
7+
indent_size = 4
8+
trim_trailing_whitespace = true
9+
10+
# C++ Files
11+
[*.{cpp,h,in}]
12+
curly_bracket_next_line = true
13+
indent_brace_style = Allman
14+
15+
# XML project files
16+
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
17+
indent_size = 2
18+
19+
# XML config files
20+
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
21+
indent_size = 2
22+
23+
# YAML config files
24+
[*.{yml,yaml}]
25+
indent_size = 2
26+
27+
# C# files
28+
[*.cs]
29+
30+
#### .NET Coding Conventions ####
31+
32+
# Organize usings
33+
dotnet_separate_import_directive_groups = false
34+
dotnet_sort_system_directives_first = false
35+
dotnet_diagnostic.IDE0005.severity = warning
36+
file_header_template = Licensed to the .NET Foundation under one or more agreements.\nThe .NET Foundation licenses this file to you under the MIT license.\nSee the LICENSE file in the project root for more information.
37+
38+
# this. and Me. preferences
39+
dotnet_style_qualification_for_event = false
40+
dotnet_style_qualification_for_field = false
41+
dotnet_style_qualification_for_method = false
42+
dotnet_style_qualification_for_property = false
43+
44+
# Language keywords vs BCL types preferences
45+
dotnet_style_predefined_type_for_locals_parameters_members = true
46+
dotnet_style_predefined_type_for_member_access = true
47+
48+
# Parentheses preferences
49+
dotnet_style_parentheses_in_arithmetic_binary_operators = always_for_clarity
50+
dotnet_style_parentheses_in_other_binary_operators = always_for_clarity
51+
dotnet_style_parentheses_in_other_operators = never_if_unnecessary
52+
dotnet_style_parentheses_in_relational_binary_operators = always_for_clarity
53+
54+
# Modifier preferences
55+
dotnet_style_require_accessibility_modifiers = for_non_interface_members
56+
57+
# Expression-level preferences
58+
dotnet_style_coalesce_expression = true
59+
dotnet_style_collection_initializer = true
60+
dotnet_style_explicit_tuple_names = true
61+
dotnet_style_namespace_match_folder = true
62+
dotnet_style_null_propagation = true
63+
dotnet_style_object_initializer = true
64+
dotnet_style_operator_placement_when_wrapping = beginning_of_line
65+
dotnet_style_prefer_auto_properties = true
66+
dotnet_style_prefer_compound_assignment = true
67+
dotnet_style_prefer_conditional_expression_over_assignment = true
68+
dotnet_style_prefer_conditional_expression_over_return = true
69+
dotnet_style_prefer_foreach_explicit_cast_in_source = when_strongly_typed
70+
dotnet_style_prefer_inferred_anonymous_type_member_names = true
71+
dotnet_style_prefer_inferred_tuple_names = true
72+
dotnet_style_prefer_is_null_check_over_reference_equality_method = true
73+
dotnet_style_prefer_simplified_boolean_expressions = true
74+
dotnet_style_prefer_simplified_interpolation = true
75+
76+
# Field preferences
77+
dotnet_style_readonly_field = true
78+
79+
# Parameter preferences
80+
dotnet_code_quality_unused_parameters = all
81+
82+
# Suppression preferences
83+
dotnet_remove_unnecessary_suppression_exclusions = none
84+
85+
# New line preferences
86+
dotnet_style_allow_multiple_blank_lines_experimental = true
87+
dotnet_style_allow_statement_immediately_after_block_experimental = true
88+
89+
#### C# Coding Conventions ####
90+
91+
# var preferences
92+
csharp_style_var_elsewhere = false
93+
csharp_style_var_for_built_in_types = false
94+
csharp_style_var_when_type_is_apparent = false
95+
96+
# Expression-bodied members
97+
csharp_style_expression_bodied_accessors = true
98+
csharp_style_expression_bodied_constructors = false
99+
csharp_style_expression_bodied_indexers = true
100+
csharp_style_expression_bodied_lambdas = true
101+
csharp_style_expression_bodied_local_functions = false
102+
csharp_style_expression_bodied_methods = false
103+
csharp_style_expression_bodied_operators = false
104+
csharp_style_expression_bodied_properties = true
105+
106+
# Pattern matching preferences
107+
csharp_style_pattern_matching_over_as_with_null_check = true
108+
csharp_style_pattern_matching_over_is_with_cast_check = true
109+
csharp_style_prefer_extended_property_pattern = true
110+
csharp_style_prefer_not_pattern = true
111+
csharp_style_prefer_pattern_matching = true
112+
csharp_style_prefer_switch_expression = true
113+
114+
# Null-checking preferences
115+
csharp_style_conditional_delegate_call = true
116+
csharp_style_prefer_parameter_null_checking = true
117+
118+
# Modifier preferences
119+
csharp_prefer_static_local_function = true
120+
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async
121+
122+
# Code-block preferences
123+
csharp_prefer_braces = true
124+
csharp_prefer_simple_using_statement = true
125+
csharp_style_namespace_declarations = block_scoped
126+
csharp_style_prefer_method_group_conversion = true
127+
csharp_style_prefer_top_level_statements = true
128+
129+
# Expression-level preferences
130+
csharp_prefer_simple_default_expression = true
131+
csharp_style_deconstructed_variable_declaration = true
132+
csharp_style_implicit_object_creation_when_type_is_apparent = true
133+
csharp_style_inlined_variable_declaration = true
134+
csharp_style_prefer_index_operator = true
135+
csharp_style_prefer_local_over_anonymous_function = true
136+
csharp_style_prefer_null_check_over_type_check = true
137+
csharp_style_prefer_range_operator = true
138+
csharp_style_prefer_tuple_swap = true
139+
csharp_style_prefer_utf8_string_literals = true
140+
csharp_style_throw_expression = true
141+
csharp_style_unused_value_assignment_preference = discard_variable
142+
csharp_style_unused_value_expression_statement_preference = discard_variable
143+
144+
# 'using' directive preferences
145+
csharp_using_directive_placement = outside_namespace
146+
147+
# New line preferences
148+
csharp_style_allow_blank_line_after_colon_in_constructor_initializer_experimental = true
149+
csharp_style_allow_blank_lines_between_consecutive_braces_experimental = true
150+
csharp_style_allow_embedded_statements_on_same_line_experimental = true
151+
152+
#### C# Formatting Rules ####
153+
154+
# New line preferences
155+
csharp_new_line_before_catch = true
156+
csharp_new_line_before_else = true
157+
csharp_new_line_before_finally = true
158+
csharp_new_line_before_members_in_anonymous_types = true
159+
csharp_new_line_before_members_in_object_initializers = true
160+
csharp_new_line_before_open_brace = all
161+
csharp_new_line_between_query_expression_clauses = true
162+
163+
# Indentation preferences
164+
csharp_indent_block_contents = true
165+
csharp_indent_braces = false
166+
csharp_indent_case_contents = true
167+
csharp_indent_case_contents_when_block = true
168+
csharp_indent_labels = one_less_than_current
169+
csharp_indent_switch_labels = true
170+
171+
# Space preferences
172+
csharp_space_after_cast = false
173+
csharp_space_after_colon_in_inheritance_clause = true
174+
csharp_space_after_comma = true
175+
csharp_space_after_dot = false
176+
csharp_space_after_keywords_in_control_flow_statements = true
177+
csharp_space_after_semicolon_in_for_statement = true
178+
csharp_space_around_binary_operators = before_and_after
179+
csharp_space_around_declaration_statements = false
180+
csharp_space_before_colon_in_inheritance_clause = true
181+
csharp_space_before_comma = false
182+
csharp_space_before_dot = false
183+
csharp_space_before_open_square_brackets = false
184+
csharp_space_before_semicolon_in_for_statement = false
185+
csharp_space_between_empty_square_brackets = false
186+
csharp_space_between_method_call_empty_parameter_list_parentheses = false
187+
csharp_space_between_method_call_name_and_opening_parenthesis = false
188+
csharp_space_between_method_call_parameter_list_parentheses = false
189+
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
190+
csharp_space_between_method_declaration_name_and_open_parenthesis = false
191+
csharp_space_between_method_declaration_parameter_list_parentheses = false
192+
csharp_space_between_parentheses = false
193+
csharp_space_between_square_brackets = false
194+
195+
# Wrapping preferences
196+
csharp_preserve_single_line_blocks = true
197+
csharp_preserve_single_line_statements = true
198+
199+
#### Naming styles ####
200+
201+
# Naming rules
202+
203+
dotnet_naming_rule.interface_should_be_begins_with_i.severity = suggestion
204+
dotnet_naming_rule.interface_should_be_begins_with_i.symbols = interface
205+
dotnet_naming_rule.interface_should_be_begins_with_i.style = begins_with_i
206+
207+
dotnet_naming_rule.types_should_be_pascal_case.severity = suggestion
208+
dotnet_naming_rule.types_should_be_pascal_case.symbols = types
209+
dotnet_naming_rule.types_should_be_pascal_case.style = pascal_case
210+
211+
dotnet_naming_rule.non_field_members_should_be_pascal_case.severity = suggestion
212+
dotnet_naming_rule.non_field_members_should_be_pascal_case.symbols = non_field_members
213+
dotnet_naming_rule.non_field_members_should_be_pascal_case.style = pascal_case
214+
215+
# Symbol specifications
216+
217+
dotnet_naming_symbols.interface.applicable_kinds = interface
218+
dotnet_naming_symbols.interface.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
219+
dotnet_naming_symbols.interface.required_modifiers =
220+
221+
dotnet_naming_symbols.types.applicable_kinds = class, struct, interface, enum
222+
dotnet_naming_symbols.types.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
223+
dotnet_naming_symbols.types.required_modifiers =
224+
225+
dotnet_naming_symbols.non_field_members.applicable_kinds = property, event, method
226+
dotnet_naming_symbols.non_field_members.applicable_accessibilities = public, internal, private, protected, protected_internal, private_protected
227+
dotnet_naming_symbols.non_field_members.required_modifiers =
228+
229+
# Naming styles
230+
231+
dotnet_naming_style.pascal_case.required_prefix =
232+
dotnet_naming_style.pascal_case.required_suffix =
233+
dotnet_naming_style.pascal_case.word_separator =
234+
dotnet_naming_style.pascal_case.capitalization = pascal_case
235+
236+
dotnet_naming_style.begins_with_i.required_prefix = I
237+
dotnet_naming_style.begins_with_i.required_suffix =
238+
dotnet_naming_style.begins_with_i.word_separator =
239+
dotnet_naming_style.begins_with_i.capitalization = pascal_case

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@
55
# However, we need /eng/ and global.json excluded for automatic updates
66
# but there's no include syntax. At least make sure source and documentation
77
# have proper ownership.
8+
/.github/ @dotnet/dotnet-monitor
89
/src/ @dotnet/dotnet-monitor
910
/documentation/ @dotnet/dotnet-monitor @IEvangelist

.github/dependabot.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "daily"
7+
target-branch: "main"

.github/workflows/backport.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ jobs:
3939
body: backport_start_body
4040
});
4141
- name: Checkout repo
42-
uses: actions/checkout@v2
42+
uses: actions/checkout@v3
4343
with:
4444
fetch-depth: 0
4545
- name: Run backport

.github/workflows/buildkicker.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353
});
5454
return comment.data.id
5555
- name: Checkout repo
56-
uses: actions/checkout@v2
56+
uses: actions/checkout@v3
5757
with:
5858
fetch-depth: 0
5959
- name: Run BuildKicker

.github/workflows/lint-csharp.yml

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
name: 'C# linting'
2+
on:
3+
pull_request:
4+
paths: ['src/**.cs']
5+
branches: ['main', 'release/6.x']
6+
7+
permissions:
8+
pull-requests: read
9+
10+
jobs:
11+
lint-csharp:
12+
name: 'C# Linting'
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v3
18+
19+
- name: Get base commit for the PR
20+
run: |
21+
git fetch origin ${{ github.base_ref }}
22+
echo "base_sha=$(git rev-parse origin/${{ github.base_ref }})" >> $GITHUB_ENV
23+
echo "Merging ${{ github.sha }} into ${{ github.base_ref }}"
24+
25+
- name: Get changed files
26+
run: |
27+
echo "Files changed: '$(git diff-tree --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }})'"
28+
changed_source_files=$(git diff-tree --no-commit-id --name-only -r ${{ env.base_sha }} ${{ github.sha }} | { grep "**.cs$" || test $? = 1; })
29+
echo "Files to validate: '${changed_source_files}'"
30+
echo "updated_files=$(echo ${changed_source_files})" >> $GITHUB_ENV
31+
32+
- name: Get dotnet version
33+
run: echo 'dotnet_version='$(jq -r '.tools.dotnet' global.json) >> $GITHUB_ENV
34+
35+
- name: Setup dotnet
36+
uses: actions/setup-dotnet@v2
37+
with:
38+
dotnet-version: ${{ env.dotnet_version }}
39+
include-prerelease: true
40+
41+
# Workaround for a bug in the dotnet-format build shipped in .NET 7.0 Preview 5. Ref: https://github.com/dotnet/core/blob/main/release-notes/7.0/known-issues.md#unhandled-exception-in-dotnet-format-app-in-net-70-preview-5
42+
- name: Setup dotnet format
43+
run: dotnet tool install -g dotnet-format --version "7.*" --configfile ./NuGet.config
44+
45+
- name: Run dotnet format
46+
run: dotnet-format --include ${{ env.updated_files }}
47+
48+
- name: Generate diff artifact
49+
run: |
50+
mkdir -p ./pr
51+
git diff > ./pr/linter.diff
52+
53+
- name: Upload diff artifact
54+
uses: actions/upload-artifact@v3
55+
with:
56+
name: pr-linter
57+
path: pr/
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
name: 'Submit linter suggestions'
2+
3+
on:
4+
workflow_run:
5+
workflows: ["C# linting"]
6+
types:
7+
- completed
8+
9+
permissions:
10+
pull-requests: write
11+
12+
jobs:
13+
submit-linter-suggestions:
14+
name: 'Submit linter suggestions'
15+
runs-on: ubuntu-latest
16+
if: >
17+
${{ github.event.workflow_run.event == 'pull_request' &&
18+
github.event.workflow_run.conclusion == 'success' }}
19+
20+
steps:
21+
- name: Checkout
22+
uses: actions/checkout@v3
23+
24+
# Download the artifact from the workflow that kicked off this one.
25+
# The default artifact download action doesn't support cross-workflow
26+
# artifacts, so use a 3rd party one.
27+
- name: 'Download linting results'
28+
uses: dawidd6/action-download-artifact@v2
29+
with:
30+
workflow: lint-csharp.yml
31+
run_id: ${{github.event.workflow_run.id }}
32+
name: pr-linter
33+
path: ./pr-linter
34+
35+
- name: 'Setup reviewdog'
36+
uses: reviewdog/action-setup@v1
37+
38+
- name: Submit formatting suggestions
39+
run: |
40+
new_event_file=${{github.workspace}}/reviewdog_event.json
41+
jq -j ".check_suite = .${GITHUB_EVENT_NAME}" ${GITHUB_EVENT_PATH} > ${new_event_file}
42+
43+
GITHUB_EVENT_PATH="${new_event_file}" REVIEWDOG_GITHUB_API_TOKEN="${{ secrets.GITHUB_TOKEN }}" reviewdog \
44+
-name="dotnet format" \
45+
-f=diff \
46+
-f.diff.strip=1 \
47+
-reporter="github-pr-review" \
48+
-filter-mode="diff_context" \
49+
-fail-on-error="false" \
50+
-level="warning" \
51+
< "./pr-linter/linter.diff"

0 commit comments

Comments
 (0)