8000 Clean up CodeFactor style issues coming in commits for the last month by iSazonov · Pull Request #10591 · PowerShell/PowerShell · GitHub
[go: up one dir, main page]

Skip to content

Conversation

@iSazonov
Copy link
Collaborator
@iSazonov iSazonov commented Sep 21, 2019

PR Summary

Fix style issues in commits for last month. Only formatting changes, no code changes.

PR Context

Most of merged commits has no style issues in CodeFactor reports but sometimes we pass some style issues to speed up code review and focus on functional changes so we have to fix them from time to time.
CodeFactor statistics says that we fix up to 780 style issues in last month and add 98 new ones. Good trend!

PR Checklist

@iSazonov iSazonov added the CL-CodeCleanup Indicates that a PR should be marked as a Code Cleanup change in the Change Log label Sep 21, 2019
@iSazonov iSazonov added this to the 7.0.0-preview.5 milestone Sep 21, 2019
@iSazonov iSazonov self-assigned this Sep 21, 2019
@TravisEz13
Copy link
Member

@iSazonov Can you clean up the title to say what you changed. The fact that the last commit caused issues should go in the PR context

@iSazonov iSazonov changed the title Clean style issues in last commits Clean up CodeFactor style issues coming in commits for the last month Sep 24, 2019
@iSazonov
Copy link
Collaborator Author

@TravisEz13 I hope I addressed your request, otherwise please do this for me.

else if (rawIntValue == 0)
{
propertyValue = false;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is a fairly straightforward bit of logic; perhaps it might be a bit tidier here using ternary syntax?

    propertyValue = rawIntValue == 1 ? true : false;

Unless there's actually a third possible outcome here, but that seems like something that isn't handled here anyway. 🙂

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@vexx32 Thanks! You are right but no code changes is in the PR, only formatting. I don't want second review round in the simple style PR.

else
{
return true;
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

We could just return the result of the boolean expression in the if statement here if we invert the condition. 🙂

return peekResult != -1;

@iSazonov iSazonov merged commit eb22206 into PowerShell:master Sep 28, 2019
@iSazonov iSazonov deleted the clean-style-last-commits-1 branch September 28, 2019 07:47
@ghost
Copy link
ghost commented Oct 23, 2019

🎉v7.0.0-preview.5 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

0