Skip to content

[UI Tests] Fix SA1208 analyzer warnings in module UI tests - #51262

Merged
Yu Leng (moooyo) merged 1 commit into
mainfrom
crutkas-uitest-warnings-sa1208
Oct 15, 2026
Merged

Yu Leng (moooyo) merged 1 commit into
mainfrom
crutkas-uitest-warnings-sa1208

Conversation

@crutkas

@crutkas Clint Rutkas (crutkas) commented Oct 13, 2026 •

Copy link
Copy Markdown
Member

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
  • 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
  • Localization: All end-user-facing strings can be localized
  • Dev docs: Added/updated
  • New binaries: Added on the required places
  • 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

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 [UI Tests] Fix analyzer warnings and treat warnings as errors in module UI test projects #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.

@github-actions github-actions Bot added Product-FancyZones Refers to the FancyZones PowerToy Ready for review labels Oct 13, 2026
@github-actions

Copy link
Copy Markdown

🧭 PR intake

Visual evidence: Not needed — The changed files do not indicate a visible UI change. No visual evidence is expected.

Recommendation

Link the issue this PR fixes using a closing keyword such as Closes #123.

✅ Ready for review

This PR passed the automated intake checks and is ready for maintainer review.

Automated PR intake; PowerToys maintainers make final decisions.

@crutkas

Copy link
Copy Markdown
Member Author

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 1 pipeline(s).

@moooyo
Yu Leng (moooyo) merged commit 8fd73f7 into main Oct 15, 2026
14 checks passed
@moooyo
Yu Leng (moooyo) deleted the crutkas-uitest-warnings-sa1208 branch October 15, 2026 01:49
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Product-FancyZones Refers to the FancyZones PowerToy Ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants