[PR #9589] Auto-format our XAML files and enforce in CI #27656

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

Original Pull Request: https://github.com/microsoft/terminal/pull/9589

State: closed
Merged: Yes


This adds XamlStyler.Console to our solution, and calls it when we
format the code, to also format
our .xaml files.

  • XamlStyler.Console is a dotnet tool so it needs to be restored with
    dotnet tool restore
  • I've added a set of rules to approximately follow @cmaneu's XAML guidelines.
    Those guidelines also recommend things based on the code-behind, which
    this tool can't figure out, but also don't matter that much.
  • There's an extra step to strip BOMs from the output, since Xaml Styler
    adds a BOM by default. Some had them before and others didn't. BOMs
    have been nothing but trouble though.
**Original Pull Request:** https://github.com/microsoft/terminal/pull/9589 **State:** closed **Merged:** Yes --- This adds [`XamlStyler.Console`] to our solution, and calls it when we format the code, to also format our .xaml files. * `XamlStyler.Console` is a dotnet tool so it needs to be restored with `dotnet tool restore` * I've added a set of rules to approximately follow [@cmaneu's XAML guidelines]. Those guidelines also recommend things based on the code-behind, which this tool can't figure out, but also _don't matter that much_. * There's an extra step to strip BOMs from the output, since Xaml Styler adds a BOM by default. Some had them before and others didn't. BOMs have been nothing but trouble though. [`XamlStyler.Console`]: https://github.com/Xavalon/XamlStyler [@cmaneu's XAML guidelines]: https://github.com/cmaneu/xaml-coding-guidelines
claunia added the pull-request label 2026-01-31 09:23:18 +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#27656