Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inline out variables #6193

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Conversation

SimonCropp
Copy link
Contributor

Bug

Fixes:

Description

PR Checklist

  • Meaningful title, helpful description and a linked NuGet/Home issue
  • Added tests
  • Link to an issue or pull request to update docs if this PR changes settings, environment variables, new feature, etc.

@SimonCropp SimonCropp requested a review from a team as a code owner December 14, 2024 12:22
@microsoft-github-policy-service microsoft-github-policy-service bot added the Community PRs created by someone not in the NuGet team label Dec 14, 2024
@@ -432,8 +432,7 @@ public string InitializeProperties(Packaging.IPackageMetadata metadata)

public string GetPropertyValue(string propertyName)
{
string value;
if (!_properties.TryGetValue(propertyName, out value) &&
if (!_properties.TryGetValue(propertyName, out var value) &&
Copy link
Member

Choose a reason for hiding this comment

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

This is a violation of our repo's coding guideline number 10: https://github.com/NuGet/NuGet.Client/blob/dev/docs/coding-guidelines.md

it's not obvious what value's type is, so it shouldn't be var. While I'm not a big fan of this coding guideline (if I really care, I'll open VS and use intellisense), it's what the team voted for (to make reviewing PRs easiler, maybe?).

Searching GitHub's PR page for var out, there are over 300 instances, and I expect most of them will be "non-obvious" and therefore should be changed if we follow the coding guidelines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@zivkan given that convention. can we merge this one first #6202

@SimonCropp SimonCropp mentioned this pull request Dec 22, 2024
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community PRs created by someone not in the NuGet team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants