Skip to content

Add MA0205 rule to suggest using the XOR operator#1192

Merged
meziantou merged 2 commits into
mainfrom
add-ma0205-xor-condition-rule
Jun 20, 2026
Merged

Add MA0205 rule to suggest using the XOR operator#1192
meziantou merged 2 commits into
mainfrom
add-ma0205-xor-condition-rule

Conversation

@meziantou

Copy link
Copy Markdown
Owner

Summary

  • Add MA0205 analyzer and code fix to detect boolean expressions that can be simplified with ^
  • Include tests covering supported expression shapes and non-matches
  • Update rule documentation and analyzer pack severity presets

Testing

  • Added analyzer and code fix tests for valid replacements and no-diagnostic cases
  • Documentation generation and repository validation were not run in this turn

…ion-rule

# Conflicts:
#	README.md
#	docs/README.md
#	src/Meziantou.Analyzer.Pack/configuration/all-errors.editorconfig
#	src/Meziantou.Analyzer.Pack/configuration/all-suggestions.editorconfig
#	src/Meziantou.Analyzer.Pack/configuration/all-warnings.editorconfig
#	src/Meziantou.Analyzer.Pack/configuration/default.editorconfig
#	src/Meziantou.Analyzer.Pack/configuration/none.editorconfig
#	src/Meziantou.Analyzer/RuleIdentifiers.cs
@meziantou meziantou merged commit 067edb6 into main Jun 20, 2026
13 checks passed
@meziantou meziantou deleted the add-ma0205-xor-condition-rule branch June 20, 2026 16:58
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 Jul 10, 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