Skip to content

feat: BWFC013/014 analyzers, architecture guide, CI docs#487

Merged
csharpfritz merged 6 commits intodevfrom
feature/analyzer-sprint1
Mar 21, 2026
Merged

feat: BWFC013/014 analyzers, architecture guide, CI docs#487
csharpfritz merged 6 commits intodevfrom
feature/analyzer-sprint1

Conversation

@csharpfritz
Copy link
Copy Markdown
Collaborator

Analyzer Sprint 1 Expansion & Documentation

New Analyzers

BWFC013: Response Object Usage (WARNING)

Detects Response.Write(), Response.WriteFile(), Response.Clear(), Response.Flush(), Response.End() methods with no direct Blazor equivalent. Code fix inserts a TODO comment with migration guidance.

BWFC014: Request Object Usage (WARNING)

Detects Request.Form[], Request.Cookies[], Request.Headers[], Request.Files, Request.QueryString[], Request.ServerVariables[] patterns that need Blazor-specific replacements. Code fix inserts a TODO comment with migration guidance.

Documentation

  • dev-docs/ANALYZER-ARCHITECTURE.md Contributor guide for building new analyzers
  • docs/Migration/Analyzers.md Updated with BWFC013/014, CI/CD section, prioritization guide

Test Results

  • 111 tests passing (90 existing + 21 new), 0 failures

Files Changed (13 files, +2,046 lines)

Area Files
Analyzers 4 new (2 analyzers + 2 code fix providers)
Tests 2 new test files + 1 updated integration test
Docs 1 new architecture guide + 1 updated migration guide

Total analyzer count: 10 rules (BWFC001-005, 010-014)

csharpfritz added a commit that referenced this pull request Mar 20, 2026
…gs merged

Session: 2026-03-20T14-18-05Z-analyzer-sprint1
Requested by: Scribe

Changes:
- Orchestration logs for Cyclops (BWFC013/014 analyzers, 6 files, 111 tests) and Beast (architecture guide, 579 lines)
- Session log for analyzer sprint 1 execution
- Merged 10 decision inbox files  decisions.md (BWFC013/014 IDs, analyzer docs, deprecation guidance, ASHX/AXD middleware, RouteData fix, component audit, navigation UX, sample pages, middleware testing)
- Deleted all inbox files after merge
- Appended team updates to Cyclops, Beast, Forge, Jubilee, Rogue history.md files
- PR #487 opened on upstream targeting dev branch
csharpfritz added a commit that referenced this pull request Mar 20, 2026
…rm CI

Code fix providers for BWFC002, BWFC004, BWFC010, BWFC012 hardcoded \r\n
in EndOfLine trivia, causing test failures on Linux CI runners where
source files have \n line endings.

Added SyntaxExtensions.DetectEndOfLine() helper that reads the first
EndOfLineTrivia from the syntax tree, ensuring code fixes match the
document's existing line ending style.

Fixes failing tests in PR #487.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
csharpfritz and others added 5 commits March 21, 2026 09:12
Analyzer Expansion:
- BWFC013: Detects Response.Write/WriteFile/Clear/Flush/End usage
- BWFC014: Detects Request.Form/Cookies/Headers/Files/QueryString access
- Both produce WARNING diagnostics with guidance-only code fixes (TODO comments)
- 21 new tests (111 total, all passing)

Documentation:
- dev-docs/ANALYZER-ARCHITECTURE.md: Contributor guide for building analyzers
- docs/Migration/Analyzers.md: BWFC013/014 entries, CI/CD integration section,
  .editorconfig severity tuning, prioritization guide

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…gs merged

Session: 2026-03-20T14-18-05Z-analyzer-sprint1
Requested by: Scribe

Changes:
- Orchestration logs for Cyclops (BWFC013/014 analyzers, 6 files, 111 tests) and Beast (architecture guide, 579 lines)
- Session log for analyzer sprint 1 execution
- Merged 10 decision inbox files  decisions.md (BWFC013/014 IDs, analyzer docs, deprecation guidance, ASHX/AXD middleware, RouteData fix, component audit, navigation UX, sample pages, middleware testing)
- Deleted all inbox files after merge
- Appended team updates to Cyclops, Beast, Forge, Jubilee, Rogue history.md files
- PR #487 opened on upstream targeting dev branch
Task 1: Added ProjectReference from BlazorWebFormsComponents to
BlazorWebFormsComponents.Analyzers with OutputItemType=Analyzer so
consumers get Roslyn analyzers automatically via the main NuGet package.

Task 2: Added -Prescan switch to bwfc-migrate.ps1 that scans source
.cs files for 9 BWFC analyzer patterns (BWFC001-005, 011-014) and
outputs a JSON summary report without performing any migration.
Includes human-readable breakdown via Write-Host.

Build: 0 errors, 111 analyzer tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- build.yml: restore, build, run, upload, and publish analyzer test results
- squad-ci.yml: replace placeholder with dotnet restore/build/test for both suites
- Add setup-dotnet step to squad-ci.yml for .NET 10.0.x

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
All 4 code fix providers (BWFC001, BWFC004, BWFC013, BWFC014) used
hardcoded \r\n in SyntaxFactory.EndOfLine(), causing test failures
on Linux CI where source strings use \n.

- Add SyntaxExtensions.DetectEndOfLine() helper that reads line
  endings from the existing syntax tree
- Replace hardcoded \r\n with root.DetectEndOfLine() in all 4
  code fix providers
- Replace foreach+if with LINQ .Where() (CodeQL suggestion)

All 111 analyzer tests pass.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@csharpfritz csharpfritz force-pushed the feature/analyzer-sprint1 branch from fa30f3b to 6223eab Compare March 21, 2026 13:13
The using directive insertion used SyntaxFactory.CarriageReturnLineFeed
which hardcodes CRLF, failing on Linux CI where source uses LF.

Replace with newRoot.DetectEndOfLine() for cross-platform compatibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@csharpfritz csharpfritz merged commit ed49fd6 into dev Mar 21, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants