-
Notifications
You must be signed in to change notification settings - Fork 0
Analyzers #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Analyzers #1
Conversation
…nd metadata files
…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
There was a problem hiding this 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.
…e references via MSBuild properties
…ersion in release script
There was a problem hiding this 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.
There was a problem hiding this 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.
…singInternalsVisibleToAttributeAnalyzer
There was a problem hiding this 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" | ||
| } |
There was a problem hiding this comment.
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.
Note
Introduces analyzer enforcement and modular MSBuild config, and integrates both into build/CI.
Sdk.Analyzerspackage: Adds KTSU0001 (missing standard packages) and KTSU0002 (missing InternalsVisibleTo) with a code fix providerSdk.targetspasses requiredCompilerVisiblePropertyvalues and auto-referencesktsu.Sdk.Analyzers(VersionOverride{version})make-analyzer-releases.ps1updates{version}placeholders and shipped analyzer release notes;commit-metadata.ps1now includes analyzer releasesDirectory.Build.propswith modular shared files (Sdk.Common.*.props/targets) and imports them inSdk,Sdk.ConsoleApp, andSdk.Appprojects; updates solution to include analyzersWritten by Cursor Bugbot for commit fd19ff6. This will update automatically on new commits. Configure here.