Skip to content

Add ability to format your branch - #41699

Merged
JohnMcPMS merged 2 commits into
microsoft:masterfrom
JohnMcPMS:format-branch
Sep 25, 2026
Merged

JohnMcPMS merged 2 commits into
microsoft:masterfrom
JohnMcPMS:format-branch

Conversation

@JohnMcPMS

Copy link
Copy Markdown
Member

Summary of the Pull Request

Adds -Branch to the format script to target files changed by your current branch.

PR Checklist

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

I am always forgetting to format files before committing them, so I added a way to just target my current branch. By default it diffs against master, but you can pass -BaseBranch branch if needed.

Validation Steps Performed

cmake generated and ran it locally, found expected files.

@JohnMcPMS
JohnMcPMS requested a review from a team as a code owner September 24, 2026 22:08
Copilot AI lite review requested due to automatic review settings September 24, 2026 22:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟡 Changes recommended

Address untracked file handling and preserve the selected base branch in verification remediation.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds branch-scoped formatting with configurable base branches and documents the workflow.

Changes:

  • Adds -Branch and -BaseBranch options.
  • Selects files changed from the configured base branch.
  • Documents branch formatting usage.
File Summary
tools/​FormatSource.ps1.in Implements branch-based file selection; requires handling untracked files and preserving BaseBranch in remediation commands.
doc/​docs/​dev-loop.md Documents the new branch formatting workflow.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread tools/FormatSource.ps1.in Outdated
Copilot AI review requested due to automatic review settings September 25, 2026 16:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The only noted issue is a minor nit regarding preserving -BaseBranch in the remediation command.

Review effort: Lite
Findings: None

Resolved since last review (1)

@JohnMcPMS
JohnMcPMS merged commit 0064f02 into microsoft:master Sep 25, 2026
11 checks passed
@JohnMcPMS
JohnMcPMS deleted the format-branch branch September 25, 2026 22:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants