Skip to content

test: enable default-disabled rule tests via per-rule rulesets (#350)#354

Merged
Arthurvdv merged 1 commit into
mainfrom
test/enable-default-disabled-rules
Jun 18, 2026
Merged

test: enable default-disabled rule tests via per-rule rulesets (#350)#354
Arthurvdv merged 1 commit into
mainfrom
test/enable-default-disabled-rules

Conversation

@Arthurvdv

Copy link
Copy Markdown
Member

Enables tests for default-disabled rules using per-rule rulesets.

Moved into main from release/v1.0.0 (commit 2ec84ec, originally PR #350) so it lands without implying a v1.0.0 release.

Depends on #351 (RoslynTestKit 1.3.0 bump): the test .csproj changes here build on that bump. This PR is therefore based on chore/roslyntestkit-1.3.0. After #351 merges, retarget this PR's base to main (gh pr edit --base main); GitHub will then show only this PR's diff.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Five test classes were gated behind a TODO because their analyzer rules are
declared isEnabledByDefault: false, so the diagnostics never ran in tests
(the in-memory test compilation never applied any ruleset). The tests were
commented out as a result.

RoslynTestKit 1.4.0 now loads a ruleset and applies it to the test
compilation's diagnostic options. This change:

- Bumps ALCops.RoslynTestKit to 1.4.0 across all test projects (also
  unifying the pre-existing 1.3.0 / 1.1.1 split between the package and CI
  binary references).
- Adds a co-located {Rule}.ruleset.json per affected rule that enables only
  that rule at its default severity.
- Rewrites the five test classes to compute the test-case path first, create
  the fixture with AnalyzerTestFixtureConfig.RuleSetPath, uncomment the
  tests, and remove the TODO.
- Drops the invalid EnumObject cases from ExtensiblePropertyExplicitlySet
  (the analyzer never registers for enum objects and no fixtures exist) and
  wires RuleSetPath into its HasFix CodeFixTestFixtureConfig.
- Updates ac0013 and testing instruction files accordingly.

Affected rules: AC0013, AC0021, AC0008, PC0006, PC0005.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Base automatically changed from chore/roslyntestkit-1.3.0 to main June 18, 2026 14:44
@Arthurvdv Arthurvdv merged commit d143bb9 into main Jun 18, 2026
@Arthurvdv Arthurvdv deleted the test/enable-default-disabled-rules branch June 18, 2026 15:20
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.

1 participant