Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
205 changes: 205 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,205 @@
# EditorConfig helps developers define and
# maintain consistent coding styles between
# different editors and IDEs

# https://editorconfig.org

# top-most EditorConfig file
root = true

[*]
indent_style = space
insert_final_newline = true
charset = utf-8

[*.{sln,slnx,*proj,props}]
charset = utf-8-bom
indent_style = space
indent_size = 2
tab_width = 2

[*.{cs,cake}]
indent_style = space
indent_size = 4
tab_width = 4

[*]
file_header_template = Copyright (c) Charlie Poole, Rob Prouse and Contributors. MIT License - see LICENSE.txt

# https://github.com/nunit/docs/wiki/Coding-Standards#namespace-class-structure-interface-enumeration-and-method-definitions
csharp_indent_braces = false
csharp_new_line_before_catch = true
csharp_new_line_before_else = true
csharp_new_line_before_finally = true

# https://github.com/nunit/docs/wiki/Coding-Standards#spaces
csharp_space_after_cast = false
csharp_space_after_comma = true
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
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 = none
csharp_space_between_square_brackets = false

# https://github.com/nunit/docs/wiki/Coding-Standards#indentation
csharp_indent_block_contents = true
csharp_indent_case_contents = true
csharp_indent_switch_labels = true

csharp_prefer_braces = when_multiline:silent

# https://github.com/nunit/docs/wiki/Coding-Standards#naming
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion

# The first matching rule wins, more specific rules at the top

# dotnet_naming_rule.*.symbols does not yet support a comma-separated list https://github.com/dotnet/roslyn/issues/20891
# dotnet_naming_symbols.*.applicable_kinds does not yet support namespace, type_parameter or local https://github.com/dotnet/roslyn/issues/18121

dotnet_naming_style.pascal_case.capitalization = pascal_case

dotnet_naming_symbols.namespaces_types_and_non_field_members.applicable_kinds = namespace, class, struct, enum, interface, delegate, type_parameter, method, property, event
dotnet_naming_rule.namespaces_types_and_non_field_members.severity = error
dotnet_naming_rule.namespaces_types_and_non_field_members.symbols = namespaces_types_and_non_field_members
dotnet_naming_rule.namespaces_types_and_non_field_members.style = pascal_case

dotnet_naming_symbols.visible_fields.applicable_kinds = field
dotnet_naming_symbols.visible_fields.applicable_accessibilities = public, protected, protected_internal
dotnet_naming_rule.visible_fields.severity = error
dotnet_naming_rule.visible_fields.symbols = visible_fields
dotnet_naming_rule.visible_fields.style = pascal_case

dotnet_naming_symbols.internal_fields.applicable_kinds = field
dotnet_naming_symbols.internal_fields.applicable_accessibilities = internal
dotnet_naming_rule.internal_fields.severity = error
dotnet_naming_rule.internal_fields.symbols = internal_fields
dotnet_naming_rule.internal_fields.style = pascal_case

dotnet_naming_symbols.static_readonly_fields.applicable_kinds = field
dotnet_naming_symbols.static_readonly_fields.required_modifiers = static, readonly
dotnet_naming_rule.static_readonly_fields.severity = error
dotnet_naming_rule.static_readonly_fields.symbols = static_readonly_fields
dotnet_naming_rule.static_readonly_fields.style = pascal_case

dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_rule.constant_fields.severity = error
dotnet_naming_rule.constant_fields.symbols = constant_fields
dotnet_naming_rule.constant_fields.style = pascal_case

dotnet_naming_style.underscore_camel_case.capitalization = camel_case
dotnet_naming_style.underscore_camel_case.required_prefix = _

dotnet_naming_symbols.remaining_fields.applicable_kinds = field
dotnet_naming_rule.remaining_fields.severity = error
dotnet_naming_rule.remaining_fields.symbols = remaining_fields
dotnet_naming_rule.remaining_fields.style = underscore_camel_case

dotnet_naming_style.camel_case.capitalization = camel_case

dotnet_naming_symbols.parameters_and_locals.applicable_kinds = parameter, local
dotnet_naming_rule.parameters_and_locals.severity = error
dotnet_naming_rule.parameters_and_locals.symbols = parameters_and_locals
dotnet_naming_rule.parameters_and_locals.style = camel_case

# https://github.com/nunit/docs/wiki/Coding-Standards#file-organization
dotnet_sort_system_directives_first = true

# https://github.com/nunit/docs/wiki/Coding-Standards#use-of-the-var-keyword
# Would be true:warning, except that that so much existing code is not consistent with the coding standard.
csharp_style_var_when_type_is_apparent = true:suggestion

# DOC100: Place text in paragraphs
dotnet_diagnostic.DOC100.severity = silent


# Expression-bodied members
csharp_style_expression_bodied_accessors = when_on_single_line:warning
csharp_style_expression_bodied_constructors = false:none
csharp_style_expression_bodied_indexers = when_on_single_line:warning
csharp_style_expression_bodied_lambdas = when_on_single_line:suggestion
csharp_style_expression_bodied_local_functions = when_on_single_line:suggestion
csharp_style_expression_bodied_methods = false:none
csharp_style_expression_bodied_operators = when_on_single_line:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion

############################################################################################
# CSharp Analysis
############################################################################################


# CS3016: Arrays as attribute arguments is not CLS-compliant
# Microsofts own MemberNotNull attribute expects an array
dotnet_diagnostic.CS3016.severity = none

# CA1512: Use ArgumentOutOfRangeException throw helper
dotnet_diagnostic.CA1512.severity = warning
# CA1510: Use ArgumentNullException throw helper
dotnet_diagnostic.CA1510.severity = warning

############################################################################################
# IDE Analysis
############################################################################################

# IDE0003: Remove qualification
dotnet_diagnostic.IDE0003.severity = warning

# IDE0005: Remove unnecessary usings/imports
dotnet_diagnostic.IDE0005.severity = error

# IDE0011: Add braces
dotnet_diagnostic.IDE0011.severity = warning

# IDE0044: Add readonly modifier
dotnet_diagnostic.IDE0044.severity = warning

# IDE0055: Fix formatting (Skipping this as it doesnt say WHAT is wrong. Rely on StyleCop instead)
dotnet_diagnostic.IDE0055.severity = none

# IDE1006: Naming Styles
dotnet_diagnostic.IDE1006.severity = warning

# IDE0036: Order modifiers
dotnet_diagnostic.IDE0036.severity = warning

# IDE0290: Use primary constructor
dotnet_diagnostic.IDE0290.severity = none

##################################################################################
# CSharpIsNull Analyzers

dotnet_style_prefer_is_null_check_over_reference_equality_method = true:warning

# CSIsNull001: Use `is null` for null checks
dotnet_diagnostic.CSIsNull001.severity = warning

# CSIsNull002: Use `is object` for non-null checks
dotnet_diagnostic.CSIsNull002.severity = warning
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
csharp_indent_labels = one_less_than_current
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_auto_properties = true:silent
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
csharp_using_directive_placement = outside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* text=auto eol=lf
*.cs text eol=crlf
*.py text eol=lf
*.yml text eol=lf
*.json text eol=lf
75 changes: 75 additions & 0 deletions .github/workflows/compatibility.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Adapter compatibility

on:
push:
pull_request:
workflow_dispatch:
inputs:
profile:
description: Reviewed package and lock profile
type: choice
options:
- historical-alpha
default: historical-alpha
require_cooperative_stop:
description: Also require token delivery, finally and teardown for every runner-stop probe
type: boolean
default: false

permissions:
contents: read

concurrency:
group: compatibility-${{ github.ref }}
cancel-in-progress: false

jobs:
compatibility:
name: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-2025, ubuntu-24.04, macos-15]
runs-on: ${{ matrix.os }}
timeout-minutes: 25
defaults:
run:
shell: bash
env:
VALIDATION_PROFILE: ${{ inputs.profile || 'historical-alpha' }}
REQUIRE_STOP: ${{ inputs.require_cooperative_stop || false }}
DOTNET_CLI_TELEMETRY_OPTOUT: '1'
DOTNET_NOLOGO: '1'
PYTHONDONTWRITEBYTECODE: '1'
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@ece7cb06caefa5fff74198d8649806c4678c61a1 # v6
with:
python-version: '3.13'
- name: Check reporting and profile guards
run: python -m unittest discover -s tests -v
- name: Read reviewed SDK selection
id: profile
run: python run.py profile --profile "profiles/$VALIDATION_PROFILE.json" --github-output "$GITHUB_OUTPUT"
- name: Install SDK and target runtimes
uses: actions/setup-dotnet@a98b56852c35b8e3190ac28c8c2271da59106c68 # v6
with:
dotnet-version: ${{ steps.profile.outputs.dotnet-versions }}
cache: false
- name: Run compatibility checks and observe runner stop
run: python run.py run --profile "profiles/$VALIDATION_PROFILE.json" --output artifacts/run
- name: Publish separate statuses and apply selected stop policy
if: ${{ always() }}
run: python ci_summary.py --results artifacts/run/results.json --summary "$GITHUB_STEP_SUMMARY" --require-stop "$REQUIRE_STOP"
- name: Retain reports, failures and process evidence
if: ${{ always() }}
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7
with:
name: compatibility-${{ matrix.os }}-${{ github.run_id }}-${{ github.run_attempt }}
path: artifacts/run
if-no-files-found: warn
retention-days: 14
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
artifacts/
**/bin/
**/obj/
__pycache__/
*.pyc
.packages/
.http-cache/
.cli-home/
reviewed-packages/
14 changes: 14 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<Project>
<PropertyGroup>
<LangVersion>14</LangVersion>
<Nullable>enable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<IsPackable>false</IsPackable>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<RestorePackagesWithLockFile>true</RestorePackagesWithLockFile>
<BaselineFrameworkVersion>4.6.1</BaselineFrameworkVersion>
<CandidateFrameworkVersion>5.1.0-alpha.0.50</CandidateFrameworkVersion>
<AdapterVersion>6.4.0-alpha.0.46</AdapterVersion>
</PropertyGroup>
</Project>
12 changes: 12 additions & 0 deletions EscapedNames.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[
{
"uid": "NUnit.AdapterCompatibility.CompatibilityCases.Named case (with space)",
"displayName": "Named case (with space)",
"escaped": "NUnit.AdapterCompatibility.CompatibilityCases.Named case \\(with space\\)"
},
{
"uid": "NUnit.AdapterCompatibility.CompatibilityCases.ParameterizedIdentity(\"a \\\"quoted\\\" value\")",
"displayName": "ParameterizedIdentity(\"a \\\"quoted\\\" value\")",
"escaped": "NUnit.AdapterCompatibility.CompatibilityCases.ParameterizedIdentity\\(\"a \\\\\"quoted\\\\\" value\"\\)"
}
]
9 changes: 9 additions & 0 deletions Harness/Harness.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<OutputType>Exe</OutputType>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.TestPlatform.TranslationLayer" Version="18.11.0" />
</ItemGroup>
</Project>
Loading
Loading