[PR #10268] [MERGED] Make the xaml formatting script work outside the root directory #27977

Open
opened 2026-01-31 09:25:30 +00:00 by claunia · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/microsoft/terminal/pull/10268
Author: @j4james
Created: 5/29/2021
Status: Merged
Merged: 6/2/2021
Merged by: @DHowett

Base: mainHead: fix-runformat


📝 Commits (1)

  • 05ffb02 Make XamlFormat work outside the root directory.

📊 Changes

1 file changed (+4 additions, -4 deletions)

View changed files

📝 tools/OpenConsole.psm1 (+4 -4)

📄 Description

Summary of the Pull Request

When the runformat script was updated to include xaml formatting, the new code failed to work if run from anywhere other than the project root. This PR updates the script so it can be run from anywhere.

PR Checklist

Detailed Description of the Pull Request / Additional comments

There were a couple of places in the script where it was collecting the list of xaml files by doing git ls-files **/*.xaml. That obviously relies on the code being executed from within the root of the project. I've now updated those queries to prefix the path with the $root variable, which points to the project root.

Validation Steps Performed

I've run the runformat script from within the tools directory and confirmed that it now works correctly from there. I've tested by changing some formatting in both .cpp and .xaml files, and also saved some .xaml files with a BOM to make sure those were appropriately stripped.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/microsoft/terminal/pull/10268 **Author:** [@j4james](https://github.com/j4james) **Created:** 5/29/2021 **Status:** ✅ Merged **Merged:** 6/2/2021 **Merged by:** [@DHowett](https://github.com/DHowett) **Base:** `main` ← **Head:** `fix-runformat` --- ### 📝 Commits (1) - [`05ffb02`](https://github.com/microsoft/terminal/commit/05ffb0211fadcd50f57211423e80db020a3568f9) Make XamlFormat work outside the root directory. ### 📊 Changes **1 file changed** (+4 additions, -4 deletions) <details> <summary>View changed files</summary> 📝 `tools/OpenConsole.psm1` (+4 -4) </details> ### 📄 Description ## Summary of the Pull Request When the `runformat` script was updated to include xaml formatting, the new code failed to work if run from anywhere other than the project root. This PR updates the script so it can be run from anywhere. ## PR Checklist * [x] Closes #9768 * [x] CLA signed. * [ ] Tests added/passed * [ ] Documentation updated. * [ ] Schema updated. * [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx ## Detailed Description of the Pull Request / Additional comments There were a couple of places in the script where it was collecting the list of xaml files by doing `git ls-files **/*.xaml`. That obviously relies on the code being executed from within the root of the project. I've now updated those queries to prefix the path with the `$root` variable, which points to the project root. ## Validation Steps Performed I've run the `runformat` script from within the tools directory and confirmed that it now works correctly from there. I've tested by changing some formatting in both .cpp and .xaml files, and also saved some .xaml files with a BOM to make sure those were appropriately stripped. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
claunia added the pull-request label 2026-01-31 09:25:30 +00:00
Sign in to join this conversation.
No Label pull-request
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#27977