New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Converted about 25 *.test.ts files to --strictNullChecks (mostly automatically) #65581

Merged
merged 6 commits into from Dec 24, 2018

Conversation

Projects
None yet
2 participants
@JoshuaKGoldberg
Copy link
Contributor

JoshuaKGoldberg commented Dec 22, 2018

Continues #65233.

I can split this up into smaller PRs if you'd like 馃槃 figured I'd try to avoid spamming the PR system first...

These diffs were generated with the following strategy:

  1. Run TypeStat on a whitelist of files in src/**/*.test.ts with the fixes.strictNullChecks option
    • This added ! assertions everywhere and a small percentage of the | null / | undefined types
  2. Run npm run strict-null-check-watch and fixed up errors manually
  3. Manually touching up changes in some places (e.g. (void 0)! -> undefined!)

I also went manually did a bunch of these changes on a separate branch to confirm they seem reasonable. Most changes are just adding ! assertions. A few places, such as comparers.ts and terminalEnvironment.test.ts, I manually redid types in step 3 instead.

  • './vs/base/test/browser/ui/tree/asyncDataTree.test.ts",
  • './vs/editor/contrib/linesOperations/test/linesOperations.test.ts",
  • './vs/editor/contrib/linesOperations/test/moveLinesCommand.test.ts",
  • './vs/editor/contrib/multicursor/test/multicursor.test.ts",
  • './vs/editor/contrib/suggest/test/completionModel.test.ts",
  • './vs/editor/contrib/wordOperations/test/wordOperations.test.ts",
  • './vs/editor/contrib/wordPartOperations/test/wordPartOperations.test.ts",
  • './vs/platform/configuration/test/common/configurationModels.test.ts",
  • './vs/platform/extensions/test/node/extensionValidator.test.ts",
  • './vs/platform/instantiation/test/common/instantiationService.test.ts",
  • './vs/platform/keybinding/test/common/keybindingLabels.test.ts",
  • './vs/platform/keybinding/test/common/keybindingResolver.test.ts",
  • './vs/platform/markers/test/common/markerService.test.ts",
  • './vs/platform/telemetry/test/electron-browser/appInsightsAppender.test.ts",
  • './vs/platform/telemetry/test/electron-browser/telemetryService.test.ts",
  • './vs/workbench/parts/markers/test/electron-browser/markersModel.test.ts",
  • './vs/workbench/parts/snippets/test/electron-browser/snippetFile.test.ts",
  • './vs/workbench/parts/snippets/test/electron-browser/snippetsService.test.ts",
  • './vs/workbench/parts/terminal/test/electron-browser/terminalConfigHelper.test.ts",
  • './vs/workbench/parts/terminal/test/electron-browser/terminalLinkHandler.test.ts",
  • './vs/workbench/parts/terminal/test/node/terminalEnvironment.test.ts",
  • './vs/workbench/services/commands/test/common/commandService.test.ts",
  • './vs/workbench/services/configuration/test/common/configurationModels.test.ts",
  • './vs/workbench/services/decorations/test/browser/decorationsService.test.ts",
  • './vs/workbench/services/extensions/test/node/rpcProtocol.test.ts",
  • './vs/workbench/services/keybinding/test/keybindingIO.test.ts",
  • './vs/workbench/services/keybinding/test/macLinuxFallbackKeyboardMapper.test.ts",

JoshuaKGoldberg added some commits Dec 21, 2018

Merge branch 'master' into strict-null-checks-auto-1
# Conflicts:
#	src/tsconfig.strictNullChecks.json
#	src/vs/base/parts/quickopen/test/common/quickOpenScorer.test.ts
#	src/vs/base/test/browser/ui/grid/gridview.test.ts
#	src/vs/base/test/browser/ui/splitview/splitview.test.ts
#	src/vs/base/test/browser/ui/tree/asyncDataTree.test.ts
#	src/vs/base/test/common/async.test.ts
#	src/vs/base/test/common/diff/diff.test.ts
#	src/vs/base/test/common/strings.test.ts
#	src/vs/base/test/node/config.test.ts
#	src/vs/code/test/node/windowsFinder.test.ts
#	src/vs/editor/contrib/codeAction/test/codeAction.test.ts
#	src/vs/editor/contrib/codeAction/test/codeActionModel.test.ts
#	src/vs/editor/contrib/comment/test/lineCommentCommand.test.ts
#	src/vs/workbench/services/keybinding/test/windowsKeyboardMapper.test.ts
@JoshuaKGoldberg

This comment has been minimized.

Copy link
Contributor Author

JoshuaKGoldberg commented Dec 22, 2018

Heh, looks like some files here are already in PR. Will remove.

@JoshuaKGoldberg JoshuaKGoldberg changed the title Converted about 50 *.test.ts files to --strictNullChecks (mostly automatically) Converted about 25 *.test.ts files to --strictNullChecks (mostly automatically) Dec 22, 2018

@mjbvz mjbvz added this to the December/January 2019 milestone Dec 24, 2018

@mjbvz mjbvz merged commit d659000 into Microsoft:master Dec 24, 2018

1 of 2 checks passed

VS Code queued
Details
license/cla All CLA requirements met.
Details
@mjbvz

This comment has been minimized.

Copy link
Contributor

mjbvz commented Dec 24, 2018

Very nice work. Thanks!

@JoshuaKGoldberg JoshuaKGoldberg deleted the JoshuaKGoldberg:strict-null-checks-auto-1 branch Dec 24, 2018

JoshuaKGoldberg added a commit to JoshuaKGoldberg/vscode that referenced this pull request Dec 25, 2018

Converted another 78 test files to strictNullChecks
These are the remaining test files that didn't require any changes to non-test file types. I'll send those in separately.

Most changes were automatic and small (`!`)s.
The only non-trival change is that `extHostSearch.ts` needs an interface for its test data.

Again used [TypeStat](https://github.com/JoshuaKGoldberg/TypeStat) when possible per Microsoft#65581. I'm happy to split this up into smaller PRs if you'd prefer!

JoshuaKGoldberg added a commit to JoshuaKGoldberg/vscode that referenced this pull request Dec 25, 2018

Converted another ~70 test files to strictNullChecks
These are the remaining test files that didn't require any changes to non-test file types. I'll send those in separately.

Most changes were automatic and small (`!`s).
The only non-trival change is that `extHostSearch.ts` needs an interface for its test data.

Again used [TypeStat](https://github.com/JoshuaKGoldberg/TypeStat) when possible per Microsoft#65581. I'm happy to split this up into smaller PRs if you'd prefer!

mjbvz added a commit that referenced this pull request Dec 28, 2018

Converted another ~70 test files to strictNullChecks (#65672)
* Converted another ~70 test files to strictNullChecks

These are the remaining test files that didn't require any changes to non-test file types. I'll send those in separately.

Most changes were automatic and small (`!`s).
The only non-trival change is that `extHostSearch.ts` needs an interface for its test data.

Again used [TypeStat](https://github.com/JoshuaKGoldberg/TypeStat) when possible per #65581. I'm happy to split this up into smaller PRs if you'd prefer!

* Added missing `!`s to `commands.test.ts`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment