Skip to content

Conversation

@matt-edmondson
Copy link
Contributor

@matt-edmondson matt-edmondson commented Jan 18, 2026

Note

Introduces analyzer enforcement and modular MSBuild config, and integrates both into build/CI.

  • New Sdk.Analyzers package: Adds KTSU0001 (missing standard packages) and KTSU0002 (missing InternalsVisibleTo) with a code fix provider
  • SDK integration: Sdk.targets passes required CompilerVisibleProperty values and auto-references ktsu.Sdk.Analyzers (VersionOverride {version})
  • CI updates: GitHub workflow adds “Update Analyzer Releases” step; new make-analyzer-releases.ps1 updates {version} placeholders and shipped analyzer release notes; commit-metadata.ps1 now includes analyzer releases
  • MSBuild refactor: Replaces Directory.Build.props with modular shared files (Sdk.Common.*.props/targets) and imports them in Sdk, Sdk.ConsoleApp, and Sdk.App projects; updates solution to include analyzers
  • Docs: README/CLAUDE updated to document analyzer rules and behavior

Written by Cursor Bugbot for commit fd19ff6. This will update automatically on new commits. Configure here.

…seStringLengthAnalyzer

This release introduces the ktsu.Sdk.Analyzers package with two new error-level analyzers that enforce SDK requirements, and removes the UseStringLengthAnalyzer.

  **KTSU0001: Missing required package reference (Error)**
  - Enforces that projects include required standard packages based on target framework
  - Required packages include:
    - Microsoft.SourceLink.GitHub (all frameworks)
    - Polyfill (net8.0, net7.0, net6.0, net5.0, netstandard2.0, netstandard2.1)
    - System.Memory (netstandard2.0, netstandard2.1)
    - System.Threading.Tasks.Extensions (netstandard2.0, netstandard2.1)
  - Test projects are exempt from all requirements except SourceLink
  - Provides clear error messages with exact PackageReference XML to add

  **KTSU0002: Missing InternalsVisibleTo attribute for test project (Error)**
  - Enforces that non-test projects expose internals to their test projects
  - Only triggers when a corresponding test project exists
  - Includes automatic code fixer to add the InternalsVisibleTo attribute
  - Enables comprehensive testing of internal members

  ## Breaking Changes

  Projects using ktsu.Sdk will now encounter build errors if they:
  1. Do not reference required standard packages for their target framework
  2. Have a test project but do not expose internals via InternalsVisibleToAttribute
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 4 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

This PR is being reviewed by Cursor Bugbot

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 2 potential issues.

Bugbot Autofix is OFF. To automatically fix reported issues with Cloud Agents, enable Autofix in the Cursor dashboard.

Write-Host "Updated $TARGET_FILE"
} else {
Write-Host "No {version} placeholder found in $TARGET_FILE, skipping update"
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Version placeholder replacement fails after first release

High Severity

The make-analyzer-releases.ps1 script only replaces the literal {version} placeholder. After the first release, the Sdk.targets file gets committed with an actual version number (e.g., "1.0.0"). On subsequent releases, the regex '\{version\}' won't match the committed version, so the script skips the update. This causes all future SDK releases to reference the first-ever analyzer package version instead of the matching version.

Additional Locations (1)

Fix in Cursor Fix in Web

@matt-edmondson matt-edmondson merged commit a7f32d9 into main Jan 18, 2026
3 checks passed
@github-project-automation github-project-automation bot moved this to Done in ktsu.dev Jan 18, 2026
@matt-edmondson matt-edmondson deleted the analyzer branch January 18, 2026 06:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants