Skip to content

Commit

Permalink
fix strict top level inference lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jakemac53 committed Jan 2, 2025
1 parent 998d544 commit ff246d6
Show file tree
Hide file tree
Showing 15 changed files with 37 additions and 22 deletions.
2 changes: 1 addition & 1 deletion _test/pkgs/provides_builder/lib/builders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ Builder someBuilder(BuilderOptions options) =>
Builder notApplied(BuilderOptions options) => _SomeBuilder.fromOptions(options);
PostProcessBuilder somePostProcessBuilder(BuilderOptions options) =>
_SomePostProcessBuilder.fromOptions(options);
Builder throwingBuilder(_) => _ThrowingBuilder();
Builder throwingBuilder(BuilderOptions _) => _ThrowingBuilder();
2 changes: 2 additions & 0 deletions build_modules/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 5.0.11-wip

## 5.0.10

- Bump the min sdk to 3.6.0.
Expand Down
4 changes: 2 additions & 2 deletions build_modules/lib/builders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ import 'build_modules.dart';
import 'src/module_cleanup.dart';
import 'src/module_library_builder.dart';

Builder moduleLibraryBuilder(_) => const ModuleLibraryBuilder();
Builder moduleLibraryBuilder(BuilderOptions _) => const ModuleLibraryBuilder();

PostProcessBuilder moduleCleanup(_) => const ModuleCleanup();
PostProcessBuilder moduleCleanup(BuilderOptions _) => const ModuleCleanup();
2 changes: 1 addition & 1 deletion build_modules/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_modules
version: 5.0.10
version: 5.0.11-wip
description: >-
Builders to analyze and split Dart code into individually compilable modules
based on imports.
Expand Down
2 changes: 2 additions & 0 deletions build_resolvers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 2.4.4-wip

## 2.4.3

- Require the latest analyzer, and stop passing the `withNullability`
Expand Down
3 changes: 2 additions & 1 deletion build_resolvers/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ import 'package:crypto/crypto.dart';

import 'src/build_asset_uri_resolver.dart';

Builder transitiveDigestsBuilder(_) => _TransitiveDigestsBuilder();
Builder transitiveDigestsBuilder(BuilderOptions _) =>
_TransitiveDigestsBuilder();

PostProcessBuilder transitiveDigestCleanup(BuilderOptions options) =>
FileDeletingBuilder([transitiveDigestExtension],
Expand Down
2 changes: 1 addition & 1 deletion build_resolvers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: build_resolvers
version: 2.4.3
version: 2.4.4-wip
description: Resolve Dart code in a Builder
repository: https://github.com/dart-lang/build/tree/master/build_resolvers
resolution: workspace
Expand Down
2 changes: 2 additions & 0 deletions build_test/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 2.2.4-wip

## 2.2.3

- Bump the min sdk to 3.6.0.
Expand Down
10 changes: 7 additions & 3 deletions build_test/lib/builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

import 'package:build/build.dart';

import 'src/debug_test_builder.dart';
import 'src/test_bootstrap_builder.dart';

export 'src/debug_test_builder.dart' show DebugTestBuilder;
export 'src/test_bootstrap_builder.dart' show TestBootstrapBuilder;

DebugTestBuilder debugTestBuilder(_) => const DebugTestBuilder();
DebugIndexBuilder debugIndexBuilder(_) => const DebugIndexBuilder();
TestBootstrapBuilder testBootstrapBuilder(_) => TestBootstrapBuilder();
DebugTestBuilder debugTestBuilder(BuilderOptions _) => const DebugTestBuilder();
DebugIndexBuilder debugIndexBuilder(BuilderOptions _) =>
const DebugIndexBuilder();
TestBootstrapBuilder testBootstrapBuilder(BuilderOptions _) =>
TestBootstrapBuilder();
2 changes: 1 addition & 1 deletion build_test/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: build_test
description: Utilities for writing unit tests of Builders.
version: 2.2.3
version: 2.2.4-wip
repository: https://github.com/dart-lang/build/tree/master/build_test
resolution: workspace

Expand Down
2 changes: 2 additions & 0 deletions build_web_compilers/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
## 4.1.1-wip

## 4.1.0

- Support package:archive version 4.x.
Expand Down
17 changes: 10 additions & 7 deletions build_web_compilers/lib/builders.dart
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ Builder webEntrypointBuilder(BuilderOptions options) =>
// Ddc related builders
Builder ddcMetaModuleBuilder(BuilderOptions options) =>
MetaModuleBuilder.forOptions(ddcPlatform, options);
Builder ddcMetaModuleCleanBuilder(_) => MetaModuleCleanBuilder(ddcPlatform);
Builder ddcModuleBuilder([_]) => ModuleBuilder(ddcPlatform);
Builder ddcMetaModuleCleanBuilder(BuilderOptions _) =>
MetaModuleCleanBuilder(ddcPlatform);
Builder ddcModuleBuilder(BuilderOptions _) => ModuleBuilder(ddcPlatform);

Builder ddcBuilder(BuilderOptions options) {
validateOptions(options.config, _supportedOptions, 'build_web_compilers:ddc');
Expand Down Expand Up @@ -52,7 +53,7 @@ Builder ddcKernelBuilder(BuilderOptions options) {
trackUnusedInputs: _readTrackInputsCompilerOption(options));
}

Builder sdkJsCopyRequirejs(_) => SdkJsCopyBuilder();
Builder sdkJsCopyRequirejs(BuilderOptions _) => SdkJsCopyBuilder();
Builder sdkJsCompile(BuilderOptions options) => SdkJsCompileBuilder(
sdkKernelPath: 'lib/_internal/ddc_platform.dill',
outputPath: 'lib/src/dev_compiler/dart_sdk.js',
Expand All @@ -62,18 +63,20 @@ Builder sdkJsCompile(BuilderOptions options) => SdkJsCompileBuilder(
// Dart2js related builders
Builder dart2jsMetaModuleBuilder(BuilderOptions options) =>
MetaModuleBuilder.forOptions(dart2jsPlatform, options);
Builder dart2jsMetaModuleCleanBuilder(_) =>
Builder dart2jsMetaModuleCleanBuilder(BuilderOptions _) =>
MetaModuleCleanBuilder(dart2jsPlatform);
Builder dart2jsModuleBuilder([_]) => ModuleBuilder(dart2jsPlatform);
Builder dart2jsModuleBuilder(BuilderOptions _) =>
ModuleBuilder(dart2jsPlatform);
PostProcessBuilder dart2jsArchiveExtractor(BuilderOptions options) =>
Dart2JsArchiveExtractor.fromOptions(options);

// Dart2wasm related builders
Builder dart2wasmMetaModuleBuilder(BuilderOptions options) =>
MetaModuleBuilder.forOptions(dart2wasmPlatform, options);
Builder dart2wasmMetaModuleCleanBuilder(_) =>
Builder dart2wasmMetaModuleCleanBuilder(BuilderOptions _) =>
MetaModuleCleanBuilder(dart2wasmPlatform);
Builder dart2wasmModuleBuilder([_]) => ModuleBuilder(dart2wasmPlatform);
Builder dart2wasmModuleBuilder(BuilderOptions _) =>
ModuleBuilder(dart2wasmPlatform);

// General purpose builders
PostProcessBuilder dartSourceCleanup(BuilderOptions options) =>
Expand Down
4 changes: 1 addition & 3 deletions build_web_compilers/pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
name: build_web_compilers
version: 4.1.0
version: 4.1.1-wip
description: Builder implementations wrapping the dart2js and DDC compilers.
repository: https://github.com/dart-lang/build/tree/master/build_web_compilers
# This package can't be part of the workspace because it requires a very recent
# Dart SDK - see the top-level pubspec for details.
resolution: workspace

environment:
Expand Down
3 changes: 2 additions & 1 deletion build_web_compilers/test/dev_compiler_bootstrap_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ Future<void> runPrerequisites(Map<String, Object> assets) async {
// It is necessary to add a fake asset so that the build_web_compilers
// package exists.
var sdkAssets = <String, Object>{'build_web_compilers|fake.txt': ''};
await testBuilderAndCollectAssets(sdkJsCopyRequirejs(null), sdkAssets);
await testBuilderAndCollectAssets(
sdkJsCopyRequirejs(const BuilderOptions({})), sdkAssets);
await testBuilderAndCollectAssets(
sdkJsCompile(const BuilderOptions({})), sdkAssets);
assets.addAll(sdkAssets);
Expand Down
2 changes: 1 addition & 1 deletion build_web_compilers/tool/copy_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import 'package:build/build.dart';

/// Factory for the build script.
Builder copyBuilder(_) => _CopyBuilder();
Builder copyBuilder(BuilderOptions _) => _CopyBuilder();

/// Copies the [_stackTraceMapperJs] file to [_stackTraceMapperCopyJs].
class _CopyBuilder extends Builder {
Expand Down

0 comments on commit ff246d6

Please sign in to comment.