Skip to content

Enable IDE0031: Null check can be simplified - #13548

Merged
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
xtqqczze:IDE0031
Nov 20, 2020
Merged

Enable IDE0031: Null check can be simplified#13548
Ilya (iSazonov) merged 4 commits into
PowerShell:masterfrom
xtqqczze:IDE0031

Conversation

@xtqqczze

@xtqqczze xtqqczze commented Aug 30, 2020

Copy link
Copy Markdown
Contributor

PR Summary

Use C# 6.0 null propagation:

  • (result == null) ? null : result.Instance -> result?.Instance
  • (result != null) ? result.Instance : null -> result?.Instance

https://docs.microsoft.com/dotnet/fundamentals/code-analysis/style-rules/ide0031

PR Context

PR Checklist

@iSazonov

Copy link
Copy Markdown
Collaborator

My personal feeling is that it doesn't add to readability. I would prefer that we move the CodeFactor index to the green area.

@iSazonov Ilya (iSazonov) added the Review - Maintainer The PR/issue needs a review from the PowerShell repo Maintainers label Sep 2, 2020
@ghost ghost added the Review - Needed The PR is being reviewed label Sep 9, 2020
@ghost

Copy link
Copy Markdown

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

@daxian-dbw

Copy link
Copy Markdown
Member

@PowerShell/powershell-maintainers reviewed this PR and agreed to accept it. But please delay merging the PR until after the 7.1.0-RC.1 release branch is created.

@ghost ghost removed the Review - Needed The PR is being reviewed label Sep 15, 2020
@daxian-dbw Dongbo Wang (daxian-dbw) removed the Review - Maintainer The PR/issue needs a review from the PowerShell repo Maintainers label Sep 15, 2020
@iSazonov
Ilya (iSazonov) marked this pull request as draft September 16, 2020 13:58
@iSazonov

Ilya (iSazonov) commented Sep 16, 2020

Copy link
Copy Markdown
Collaborator

Convert to draft until 7.1 RC1.

@ghost ghost added the Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept label Sep 19, 2020
@ghost ghost added the Stale label Oct 4, 2020
@ghost

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 15 days. It will be closed if no further activity occurs within 10 days of this comment.

@xtqqczze
xtqqczze marked this pull request as ready for review October 13, 2020 00:01
@ghost ghost removed Waiting on Author The PR was reviewed and requires changes or comments from the author before being accept Stale labels Oct 13, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

needs triage

@ghost ghost added the Review - Needed The PR is being reviewed label Oct 20, 2020
@ghost

Copy link
Copy Markdown

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

Copy link
Copy Markdown
Contributor Author

updated PR description

@xtqqczze

Copy link
Copy Markdown
Contributor Author

Dongbo Wang (@daxian-dbw) Can you review?

@iSazonov Ilya (iSazonov) added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Oct 21, 2020
@xtqqczze

Copy link
Copy Markdown
Contributor Author

rebased

@TravisEz13 Travis Plunk (TravisEz13) left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

reviewed 13/42

@TravisEz13

Copy link
Copy Markdown
Member

PoshChan-Bot (@PoshChan) Please remind me in 7 days

@ghost ghost removed the Review - Needed The PR is being reviewed label Oct 25, 2020
@xtqqczze xtqqczze changed the title Fix IDE0031: Null check can be simplified Enable IDE0031: Null check can be simplified Oct 26, 2020
@ghost ghost added the Review - Needed The PR is being reviewed label Nov 3, 2020
@ghost

Copy link
Copy Markdown

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

@ghost ghost removed the Review - Needed The PR is being reviewed label Nov 5, 2020
@iSazonov

Copy link
Copy Markdown
Collaborator

xtqqczze Please resolve merge conflicts.

@xtqqczze

xtqqczze commented Nov 5, 2020

Copy link
Copy Markdown
Contributor Author

Resolved merge conflicts.

@iSazonov

Copy link
Copy Markdown
Collaborator

Travis Plunk (@TravisEz13) Do you want to continue the code review?

@ghost ghost added the Review - Needed The PR is being reviewed label Nov 13, 2020
@ghost

Copy link
Copy Markdown

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

@iSazonov
Ilya (iSazonov) merged commit 9e28529 into PowerShell:master Nov 20, 2020
@ghost ghost removed the Review - Needed The PR is being reviewed label Nov 20, 2020
@iSazonov Ilya (iSazonov) added this to the 7.2.0-preview.2 milestone Nov 20, 2020
@xtqqczze
xtqqczze deleted the IDE0031 branch November 20, 2020 08:41
@ghost

Copy link
Copy Markdown

🎉v7.2.0-preview.2 has been released which incorporates this pull request.:tada:

Handy links:

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants