Repository navigation
[UI Tests] Fix SA1208 analyzer warnings in module UI tests - #51262
Merged
Merged
Conversation
ð§ PR intakeVisual evidence: Not needed â The changed files do not indicate a visible UI change. No visual evidence is expected. Recommendation
â Ready for reviewThis PR passed the automated intake checks and is ready for maintainer review. Automated PR intake; PowerToys maintainers make final decisions. |
This was referenced Oct 13, 2026
Member
Author
|
/azp run |
|
Azure Pipelines: Successfully started running 1 pipeline(s). |
Yu Leng (moooyo)
approved these changes
Oct 15, 2026
Boliang Zhang (LegendaryBlair)
pushed a commit
that referenced
this pull request
Oct 15, 2026
## Summary of the Pull Request Fixes **SA1208** (System using directives must be placed before other using directives) in the module UI test projects: 8 warning(s) in 4 file(s). No test logic changes. Part of the split of #51088, now one PR per analyzer rule so each pattern can be reviewed across all modules at once. The projects keep their `TreatWarningsAsErrors=false` override for now, so this PR can merge on its own in any order. The override removal is the last PR in the series, #51283. ## PR Checklist - [ ] Closes: #xxx - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments Moves `System.*` using directives before the other usings. Unique warnings fixed on current `main` (x64, by containing folder): | Folder | Warnings | |---|---| | `FancyZonesEditor.UITests.Next` | 5 | | `Utils` | 3 | ## Validation Steps Performed - Built each project touched by this PR x64 Release on current `main` with this PR applied (`MSBuild.exe <project>.csproj /p:Platform=x64 /p:Configuration=Release`): 1 project(s), exit 0, 0 errors. - SA1208 warnings in those projects: 8 before, 2 after (the rest are in the files moved by the SA1402/SA1649 PR). Total warnings in those projects: 45 before, 39 after. No new warning rules. - All 27 PRs together reproduce #51088 exactly on current `main`, and they cherry-pick onto `main` in sequence without conflicts. - UI tests were not run locally; no test logic changed. (cherry picked from commit 8fd73f7) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Clint Rutkas (crutkas)
added a commit
that referenced
this pull request
Oct 25, 2026
## Summary of the Pull Request Removes `<TreatWarningsAsErrors>false</TreatWarningsAsErrors>` from 26 module UI test projects so they follow the repo default (warnings are errors), and updates the `ui-tests-migration` skill template and docs so new UI test projects start strict. Part of the split of #51088, now one PR per analyzer rule so each pattern can be reviewed across all modules at once. ## PR Checklist - [ ] Closes: #xxx - [x] **Communication:** I've discussed this with core contributors already. If the work hasn't been agreed, this work might be rejected - [ ] **Tests:** Added/updated and all pass - [x] **Localization:** All end-user-facing strings can be localized - [ ] **Dev docs:** Added/updated - [ ] **New binaries:** Added on the required places - [ ] [JSON for signing](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ESRPSigning_core.json) for new binaries - [ ] [WXS for installer](https://github.com/microsoft/PowerToys/blob/main/installer/PowerToysSetup/Product.wxs) for new binaries and localization folder - [ ] [YML for CI pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/ci/templates/build-powertoys-steps.yml) for new test projects - [ ] [YML for signed pipeline](https://github.com/microsoft/PowerToys/blob/main/.pipelines/release.yml) - [ ] **Documentation updated:** If checked, please file a pull request on [our docs repo](https://github.com/MicrosoftDocs/windows-uwp/tree/docs/hub/powertoys) and link it here: #xxx ## Detailed Description of the Pull Request / Additional comments **Merge this last.** It builds only after all of these rule PRs are merged: - #51257 SA1118 (Parameter must not span multiple lines) - #51258 SA1518 (Use line endings correctly at end of file) - #51259 SA1402/SA1649 (One type per file / file name must match first type name) - #51260 CA1305 (Specify IFormatProvider) - #51261 CA1304 (Specify CultureInfo) - #51262 SA1208 (System using directives must be placed before other using directives) - #51263 SA1512 (Single-line comments must not be followed by blank line) - #51264 SA1515 (Single-line comment must be preceded by blank line) - #51265 SA1116/SA1117 (Split parameters must start on line after declaration / parameters must be on same line or separate lines) - #51266 SA1114 (Parameter list must follow declaration) - #51267 SA1119 (Statement must not use unnecessary parentheses) - #51268 SA1137 (Elements should have the same indentation) - #51269 SA1516 (Elements must be separated by blank line) - #51270 SA1214 (Readonly fields must appear before non-readonly fields) - #51271 SA1313 (Parameter names must begin with lower-case letter) - #51272 SA1507 (Code must not contain multiple blank lines in a row) - #51273 SA1508 (Closing brace must not be preceded by blank line) - #51274 CS8602 (Dereference of a possibly null reference) - #51275 CS8604 (Possible null reference argument) - #51276 CS8620 (Argument nullability mismatch) - #51277 CA1716 (Identifiers should not match keywords) - #51278 CA1826 (Use indexer instead of Enumerable method on indexable collection) - #51279 CA1861 (Avoid constant arrays as arguments) - #51280 CA1869 (Cache and reuse JsonSerializerOptions) - #51281 CA2219 (Do not raise exceptions in finally clauses) - #51282 CS2002 (Source file specified multiple times) Projects: AdvancedPaste, AlwaysOnTop, ColorPicker, CropAndLock (UITests and TestApp), EnvironmentVariables, FancyZones, FancyZonesEditor, FileLocksmith, Hosts, ImageResizer, KeyboardManager, LightSwitch, MouseUtils, NewPlus, Peek, PowerAccent, PowerRename.Next, PreviewPane, RegistryPreview, ScreenRuler, Settings, Workspaces (UITests.Next and TestApp), ZoomIt. ## Validation Steps Performed - Built all 26 projects plus the legacy `PowerRename.UITests` x64 Release on current `main` with this PR and every rule PR applied: `MSBuild.exe <project>.csproj /restore /p:Platform=x64 /p:Configuration=Release` -> exit 0, 0 warnings, 0 errors for every project. - Earlier, as #51088, the same changes built x64 and ARM64 Release in CI. - On its own (without the rule PRs) this PR is expected to fail the build; that is the point of merging it last. - UI tests were not run locally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary of the Pull Request
Fixes SA1208 (System using directives must be placed before other using directives) in the module UI test projects: 8 warning(s) in 4 file(s). No test logic changes.
Part of the split of #51088, now one PR per analyzer rule so each pattern can be reviewed across all modules at once.
The projects keep their
TreatWarningsAsErrors=falseoverride for now, so this PR can merge on its own in any order. The override removal is the last PR in the series, #51283.PR Checklist
Detailed Description of the Pull Request / Additional comments
Moves
System.*using directives before the other usings.Unique warnings fixed on current
main(x64, by containing folder):FancyZonesEditor.UITests.NextUtilsValidation Steps Performed
mainwith this PR applied (MSBuild.exe <project>.csproj /p:Platform=x64 /p:Configuration=Release): 1 project(s), exit 0, 0 errors.main, and they cherry-pick ontomainin sequence without conflicts.