Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
b5da082
breaking: Remove .NET Standard 2.0, modernize AOT compatibility, and…
glennawatson Jan 4, 2026
e54dd88
Add AppBuilder pre-assembly hooks to init all the project's
glennawatson Jan 5, 2026
e866ae5
api fixes
glennawatson Jan 5, 2026
6b467d3
moved WPF tests and Winforms tests out (will not work with Linux/Mac …
glennawatson Jan 5, 2026
e36bcaa
Add platform-specific converter affinity tests and update existing ty…
glennawatson Jan 5, 2026
cfd26ab
Further cleanup of the tests.
glennawatson Jan 5, 2026
8c8874a
More unit test fixes.
glennawatson Jan 6, 2026
363c407
Merge branch 'main' into glennawatson/aot-warnings
glennawatson Jan 6, 2026
6a474f0
Remove claude files
glennawatson Jan 6, 2026
cc37628
Resolve merge conflicts in test files
glennawatson Jan 6, 2026
8c10beb
Split ReactiveUI.Testing to remove xunit dependency
glennawatson Jan 6, 2026
677aa16
Add ReactiveProperty and validation tests
glennawatson Jan 13, 2026
76a2e1f
feat: Add nullable type converters for various numeric types and enha…
glennawatson Jan 15, 2026
c885ad5
feat: Update PropertyBindView to use dependency properties for SomeTe…
glennawatson Jan 15, 2026
5af5fb6
Move the mock over to wpf
glennawatson Jan 16, 2026
01e2a3b
fix: Property binding converter fallbacks and command rebinding race …
glennawatson Jan 17, 2026
afba8b1
Fix the unit tests
glennawatson Jan 17, 2026
8605195
Fix builds and removing unused usings
glennawatson Jan 17, 2026
8d50e78
Refactor test executors to use AppBuilderTestHelper for consistent Ap…
glennawatson Jan 17, 2026
dd10002
Fix WinForms test project references to be conditional for cross-plat…
glennawatson Jan 17, 2026
826f677
Add SwitchSubscribe mixin for observables that follow property changes
glennawatson Jan 17, 2026
a6622e1
fix build
glennawatson Jan 17, 2026
a1b2e36
Fix WinUI Mac/Unix build by conditionalizing Maui global using
glennawatson Jan 17, 2026
268658b
Merge branch 'main' into glennawatson/aot-warnings
glennawatson Jan 17, 2026
4852241
Add tunit.core instead of tunit to the utilities to prevent them bein…
glennawatson Jan 17, 2026
fdf922d
Remove extension block
glennawatson Jan 17, 2026
545961c
Remove windows only restrictions for running api approval, it's a no-…
glennawatson Jan 17, 2026
7123360
Remove another extension block
glennawatson Jan 17, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
12 changes: 0 additions & 12 deletions .claude/settings.local.json

This file was deleted.

916 changes: 524 additions & 392 deletions .editorconfig

Large diffs are not rendered by default.

111 changes: 100 additions & 11 deletions .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,21 @@ Invoke-WebRequest -Uri https://dot.net/v1/dotnet-install.ps1 -OutFile dotnet-ins

### Solution Files

* Main solution: `src/ReactiveUI.sln` (repository `root/src` directory)
* Main solution: `src/reactiveui.slnx` (repository `root/src` directory)
* Integration tests: `integrationtests/` directory contains platform-specific solutions. These are not required for most tasks to compile.

**About SLNX Format:**

This repository uses **SLNX** (XML-based solution format) introduced in Visual Studio 2022 17.10+, instead of the legacy `.sln` format.

**Key characteristics:**
- Structured XML format vs. proprietary text format
- Better support for complex multi-platform projects like ReactiveUI
- Full compatibility with `dotnet` CLI (works identically to .sln)
- Requires Visual Studio 2022 17.10+ or JetBrains Rider 2024.1+ for IDE support

All commands in this document reference `src/reactiveui.slnx`.

---

## 🛠️ Build & Test Commands
Expand All @@ -67,24 +79,42 @@ dotnet workload restore
cd ..

# Restore NuGet packages
dotnet restore src/ReactiveUI.sln
dotnet restore src/reactiveui.slnx

# Build the solution (requires Windows for platform-specific targets)
dotnet build src/ReactiveUI.sln -c Release -warnaserror
dotnet build src/reactiveui.slnx -c Release -warnaserror
```

### Test Commands (Microsoft Testing Platform)

**CRITICAL:** This repository uses MTP configured in `src/global.json`. All TUnit-specific arguments must be passed after `--`.

**Microsoft Testing Platform (MTP) Overview:**

MTP is the modern test execution platform replacing VSTest, providing:
- Native integration with `dotnet test` command
- Better performance and modern architecture for .NET 6.0+
- Enhanced test filtering and parallel execution control
- Required for TUnit framework (ReactiveUI's chosen test framework)

**Key Differences from VSTest:**
- Arguments passed AFTER `--`: `dotnet test -- --treenode-filter "..."`
- Configured via `global.json` (specifies "Microsoft.Testing.Platform")
- Test settings in `testconfig.json` (parallel execution, coverage format)

**Best Practices:**
- **Never use `--no-build`** - always build before testing to avoid stale binaries
- Use `--output Detailed` BEFORE `--` to see Console.WriteLine output
- TUnit runs non-parallel (`"parallel": false`) to prevent test interference

**Note:** Commands below assume repository root as working directory. Use `src/` prefix for paths.

```powershell
# Run all tests
dotnet test src/ReactiveUI.sln -c Release --no-build
dotnet test src/reactiveui.slnx -c Release

# Run tests with code coverage (Microsoft Code Coverage)
dotnet test src/ReactiveUI.sln -- --coverage --coverage-output-format cobertura
dotnet test src/reactiveui.slnx --coverage --coverage-output-format cobertura

# Run specific test project
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj
Expand All @@ -96,16 +126,16 @@ dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj -- --tr
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj -- --treenode-filter "/*/*/MyClassName/*"

# Filter by test property (e.g., Category)
dotnet test src/ReactiveUI.sln -- --treenode-filter "/*/*/*/*[Category=Integration]"
dotnet test src/reactiveui.slnx -- --treenode-filter "/*/*/*/*[Category=Integration]"

# List all available tests
dotnet test --project src/tests/ReactiveUI.Tests/ReactiveUI.Tests.csproj -- --list-tests

# Fail fast (stop on first failure)
dotnet test src/ReactiveUI.sln -- --fail-fast
dotnet test src/reactiveui.slnx -- --fail-fast

# Generate TRX report with coverage
dotnet test src/ReactiveUI.sln -- --coverage --coverage-output-format cobertura --report-trx --output Detailed
dotnet test src/reactiveui.slnx --coverage --coverage-output-format cobertura -- --report-trx --output Detailed
```

**TUnit Treenode-Filter Syntax:**
Expand All @@ -118,10 +148,14 @@ Examples:
- All tests in namespace: `--treenode-filter "/*/MyNamespace/*/*"`
- Filter by property: `--treenode-filter "/*/*/*/*[Category=Integration]"`

**Key TUnit Command-Line Flags:**
- `--treenode-filter` - Filter tests by path or properties
**Key Command-Line Flags:**

**dotnet test flags (BEFORE `--`):**
- `--coverage` - Enable Microsoft Code Coverage
- `--coverage-output-format` - Set format (cobertura, xml, coverage)

**TUnit flags (AFTER `--`):**
- `--treenode-filter` - Filter tests by path or properties
- `--report-trx` - Generate TRX reports
- `--output` - Verbosity (Normal or Detailed)
- `--list-tests` - Display tests without running
Expand Down Expand Up @@ -528,11 +562,66 @@ _total = this.WhenAnyValue(

```powershell
# Build with warnings as errors (includes StyleCop violations)
dotnet build src/ReactiveUI.sln -c Release -warnaserror
dotnet build src/reactiveui.slnx -c Release -warnaserror
```

**Important:** Style violations will cause build failures. Use an IDE with EditorConfig support (Visual Studio, VS Code, Rider) to automatically format code according to project standards.

### Zero Pragma Policy for Warning Suppression

**CRITICAL: This project enforces a strict zero pragma policy.**

* **NO `#pragma warning disable` statements are allowed** in any code files
* **All StyleCop analyzer warnings (SA****) MUST be fixed**, never suppressed
* **Code analyzer warnings (CA****) may ONLY be suppressed as an absolute last resort** using `[SuppressMessage]` attribute with these requirements:
1. You have attempted to fix the warning first
2. Fixing it would make the code worse or is not technically feasible
3. You use `[SuppressMessage]` attribute (NOT pragma)
4. You provide a clear, valid justification in the `Justification` parameter

#### Examples

```csharp
// ❌ WRONG - Never use pragma directives
#pragma warning disable CA1062
public void ProcessData(object data)
{
data.ToString(); // CA1062: Validate parameter is non-null
}
#pragma warning restore CA1062

// ✅ CORRECT - Fix the issue
public void ProcessData(object data)
{
ArgumentNullException.ThrowIfNull(data);
data.ToString();
}

// ⚠️ ACCEPTABLE - SuppressMessage with justification (last resort only)
[SuppressMessage("Microsoft.Design", "CA1062:ValidateArgumentsOfPublicMethods",
Justification = "TUnit framework guarantees non-null parameters from test data sources")]
public async Task ValidateConverter(IBindingTypeConverter converter, int expectedAffinity)
{
var affinity = converter.GetAffinityForObjects(); // converter is never null
await Assert.That(affinity).IsEqualTo(expectedAffinity);
}
```

#### Common StyleCop Fixes (Must Be Fixed, Never Suppressed)

* **SA1202** (Static members before instance members): Reorder class members
* **SA1204** (Static members before non-static): Move static members to top
* **SA1402** (One type per file): Convert file-scoped types to nested private classes
* **SA1611** (Parameter documentation missing): Add `<param>` XML tags
* **SA1615** (Return value documentation missing): Add `<returns>` XML tags
* **SA1600** (Elements should be documented): Add XML documentation to public members

#### Enforcement

* Builds fail with `-warnaserror` if any analyzer warnings exist
* Any pragma directives will be flagged and rejected during code review
* `SuppressMessage` usage requires clear justification and approval

---

## 📋 Testing Guidelines
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ jobs:
with:
configuration: Release
productNamespacePrefix: "ReactiveUI"
solutionFile: "ReactiveUI.sln"
installWorkloads: true
secrets:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -450,3 +450,6 @@ src/Tools/
**/*.GeneratedMSBuildEditorConfig.editorconfig
/app
.dotnet/

# Claude Settings
.claude/
Loading
Loading