Skip to content

Add MA0204 to remove unnecessary partial modifiers#1190

Merged
meziantou merged 3 commits into
mainfrom
add-partial-type-analyzer
Jun 20, 2026
Merged

Add MA0204 to remove unnecessary partial modifiers#1190
meziantou merged 3 commits into
mainfrom
add-partial-type-analyzer

Conversation

@meziantou

Copy link
Copy Markdown
Owner

Summary

  • Add MA0204 analyzer and code fix to report and remove partial when a type has a single declaration.
  • Cover classes, structs, interfaces, and records, while preserving trivia during the fix.
  • Update rule documentation, rule identifiers, and analyzer pack severity presets.
  • Add unit tests for compliant and non-compliant cases, including nested partial types and partial members.

Testing

  • Not run (not requested)

@meziantou meziantou merged commit 1707924 into main Jun 20, 2026
13 checks passed
@meziantou meziantou deleted the add-partial-type-analyzer branch June 20, 2026 16:18
This was referenced Jun 20, 2026
IhateTrains pushed a commit to ParadoxGameConverters/ImperatorToCK3 that referenced this pull request Jun 22, 2026
Updated
[Meziantou.Analyzer](https://github.com/meziantou/Meziantou.Analyzer)
from 3.0.104 to 3.0.108.

<details>
<summary>Release notes</summary>

_Sourced from [Meziantou.Analyzer's
releases](https://github.com/meziantou/Meziantou.Analyzer/releases)._

## 3.0.108

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.108>

## What's Changed
* Add MA0206 for unnecessary braces in type declarations by @​meziantou
in meziantou/Meziantou.Analyzer#1191


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.107...3.0.108

## 3.0.107

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.107>

## What's Changed
* Add MA0205 rule to suggest using the XOR operator by @​meziantou in
meziantou/Meziantou.Analyzer#1192


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.106...3.0.107

## 3.0.106

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.106>

## What's Changed
* Add MA0204 to remove unnecessary partial modifiers by @​meziantou in
meziantou/Meziantou.Analyzer#1190


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.105...3.0.106

## 3.0.105

NuGet package:
<https://www.nuget.org/packages/Meziantou.Analyzer/3.0.105>

## What's Changed
* Add MA0203 to flag `<returns>` tags on `void` methods by @​meziantou
in meziantou/Meziantou.Analyzer#1189


**Full Changelog**:
meziantou/Meziantou.Analyzer@3.0.104...3.0.105

Commits viewable in [compare
view](meziantou/Meziantou.Analyzer@3.0.104...3.0.108).
</details>

[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=Meziantou.Analyzer&package-manager=nuget&previous-version=3.0.104&new-version=3.0.108)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't
alter it yourself. You can also trigger a rebase manually by commenting
`@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits
that have been made to it
- `@dependabot show <dependency name> ignore conditions` will show all
of the ignore conditions of the specified dependency
- `@dependabot ignore this major version` will close this PR and stop
Dependabot creating any more for this major version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop
Dependabot creating any more for this minor version (unless you reopen
the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop
Dependabot creating any more for this dependency (unless you reopen the
PR or upgrade to it yourself)


</details>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
This was referenced Jun 22, 2026
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