Skip to content

Update coding-style.md #116317

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

Merged
merged 1 commit into from
Jun 4, 2025
Merged

Update coding-style.md #116317

merged 1 commit into from
Jun 4, 2025

Conversation

tonyhallett
Copy link
Contributor

@Copilot Copilot AI review requested due to automatic review settings June 4, 2025 18:23
@github-actions github-actions bot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Jun 4, 2025
Copy link
Contributor

@Copilot 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 refines the wording of the coding-style guideline around using var to make it clear that its use is allowed but not mandatory.

  • Rule 10 is updated to “permit” rather than “use” var, emphasizing it’s optional.
  • Adjusts parenthetical phrasing for clarity.
Comments suppressed due to low confidence (1)

docs/coding-guidelines/coding-style.md:22

  • [nitpick] Consider rephrasing for readability and grammatical correctness, e.g.:

"10. We permit (but do not enforce) var when the type is explicitly named on the right-hand side…"

10. We only permit ( not enforce ) `var` when the type is explicitly named on the right-hand side, typically due to either `new` or an explicit cast, e.g. `var stream = new FileStream(...)` not `var stream = OpenStandardInput()`.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Jun 4, 2025
Copy link
Member

@stephentoub stephentoub left a comment

Choose a reason for hiding this comment

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

Thanks

@stephentoub stephentoub enabled auto-merge (squash) June 4, 2025 18:43
@stephentoub
Copy link
Member

/ba-g hung

@stephentoub stephentoub merged commit b5b51f9 into dotnet:main Jun 4, 2025
16 of 17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community-contribution Indicates that the PR has been added by a community member needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants