Skip to content

Upgrade Meziantou.Analyzer to 3.0.141 - #2933

Merged
lahma merged 1 commit into
sebastienros:mainfrom
lahma:meziantou-upgrade
Aug 9, 2026
Merged

Upgrade Meziantou.Analyzer to 3.0.141#2933
lahma merged 1 commit into
sebastienros:mainfrom
lahma:meziantou-upgrade

Conversation

@lahma

@lahma lahma commented Aug 9, 2026

Copy link
Copy Markdown
Collaborator

Supersedes #2930, which fails to build on every leg.

3.0.140 generalized MA0060's do-not-ignore-return-value detection, and it now reaches the one deliberately ignored ParseUtils.TryParseInt32 call in the RFC 822 date parser:

Jint/Native/Date/MimeKit.cs(529,17): error MA0060: The return value of 'TryParseInt32' should be used

That call site already carried a #pragma warning disable CA1806 for exactly the same reason, so rather than add a second rule id to the pragma, both are replaced with an explicit discard — which satisfies either rule and puts the intent in the code instead of in a suppression. The accompanying comment records why the result carries no information there: the token is numeric (IsNumeric means every byte is '0''9') and one or two bytes long, so the parse can neither run out of digits nor overflow, and a failure would leave value at 0, which falls through all three range checks that follow.

The remaining 3.0.139/141 changes are a dropped obsolete Roslyn version and a transitive Meziantou.Polyfill bump; neither produces a diagnostic here.

While in the file: nothing else in the repository is behind. Every other entry in Directory.Packages.props is already at its latest stable version (dotnet list package --outdated is clean apart from the two deliberately pinned prereleases, ICU4N and Okojo), and the workflows are on checkout@v7 / setup-dotnet@v6 / cache@v6.

Verification

  • dotnet build -c Release — clean, 0 warnings across all five target frameworks.
  • dotnet test -c Release Jint.Tests — 4839 passed (net10.0), 4758 passed (net472).
  • JINT_HOST_CONTRACT_VERIFICATION=1 dotnet test -c Release Jint.Tests — same, 0 failures.
  • dotnet test -c Release Jint.Tests.PublicInterface — 1334 passed (net10.0), 1333 passed (net472).

The discard compiles to the same IL as the ignored call, so there is no behavioural change to measure.

🤖 Generated with Claude Code

3.0.140 generalized MA0060's do-not-ignore-return-value detection, which now
reaches the one deliberately ignored ParseUtils.TryParseInt32 call in the
RFC 822 date parser. That call site already carried a CA1806 suppression for
exactly the same reason, so replace both with an explicit discard, which
satisfies either rule and states the intent in the code rather than in a
pragma. The comment records why the result carries no information here.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@lahma
lahma merged commit e1416a1 into sebastienros:main Aug 9, 2026
5 checks passed
@lahma
lahma deleted the meziantou-upgrade branch August 9, 2026 07:47
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