Skip to content

Enable IDE0083: UseNotPattern#26231

Open
xtqqczze wants to merge 1 commit into
PowerShell:masterfrom
xtqqczze:IDE0083-p3
Open

Enable IDE0083: UseNotPattern#26231
xtqqczze wants to merge 1 commit into
PowerShell:masterfrom
xtqqczze:IDE0083-p3

Conversation

@xtqqczze
Copy link
Copy Markdown
Contributor

@xtqqczze xtqqczze commented Oct 17, 2025

@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Oct 18, 2025
@xtqqczze xtqqczze marked this pull request as ready for review October 18, 2025 18:57
@TravisEz13 TravisEz13 requested a review from Copilot October 20, 2025 18:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enables the IDE0083 code style analyzer rule by upgrading it from "silent" to "warning" severity and refactors existing code to use the modern "is not" pattern syntax instead of the older "!(x is Type)" negated type check pattern. This improves code readability and aligns with current C# best practices.

Key changes:

  • Updated .globalconfig to enforce IDE0083 as a warning
  • Replaced negated type checks !(x is Type) with the cleaner x is not Type pattern across multiple files

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.globalconfig Changed IDE0083 severity from silent to warning to enforce the pattern
src/System.Management.Automation/help/ProviderContext.cs Modernized type check pattern in provider help retrieval
src/System.Management.Automation/help/CommandHelpProvider.cs Modernized type check pattern in help data processing
src/System.Management.Automation/engine/parser/ast.cs Updated multiple type check patterns in AST-related methods including equality checks and value assignments
src/System.Management.Automation/engine/parser/TypeResolver.cs Modernized type check pattern in equality comparison
src/System.Management.Automation/engine/parser/TypeInferenceVisitor.cs Updated type check patterns in type inference logic
src/System.Management.Automation/engine/parser/SemanticChecks.cs Modernized type check patterns in semantic validation
src/System.Management.Automation/engine/parser/Position.cs Updated type check pattern in extent equality check
src/System.Management.Automation/engine/parser/Parser.cs Modernized type check patterns in hashtable parsing
src/System.Management.Automation/engine/parser/ConstantValues.cs Updated type check patterns in constant value visitors
src/System.Management.Automation/engine/parser/Compiler.cs Modernized type check patterns in binary expression compilation

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the Review - Needed The PR is being reviewed label Oct 27, 2025
@microsoft-github-policy-service
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as Review Needed because it has been there has not been any activity for 7 days.
Maintainer, please provide feedback and/or mark it as Waiting on Author

@xtqqczze xtqqczze requested a review from a team as a code owner May 7, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log Review - Needed The PR is being reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enable IDE0083: UseNotPattern

3 participants