Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
flutter-version:
# The version of Flutter to use should use the minimum Dart SDK version supported by the package,
# refer to https://docs.flutter.dev/development/tools/sdk/releases.
- "3.24.0"
- "3.29.3"
- "3.x"
test:
# E2E tests for the test command
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/spdx_license.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ jobs:
- name: 🎯 Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 3.5.0
sdk: 3.7.2

- name: 📦 Install Dependencies
run: dart pub get
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
- name: 🎯 Setup Dart
uses: dart-lang/setup-dart@v1
with:
sdk: 3.5.0
sdk: 3.7.2

- name: 📦 Install Dependencies
run: dart pub get
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_optimizer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
build_hooks:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/dart_package.yml@v1
with:
dart_sdk: 3.5.0
dart_sdk: 3.7.2
working_directory: bricks/test_optimizer/hooks

verify_bundle:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/very_good_cli.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:

- uses: subosito/[email protected]
with:
flutter-version: 3.24.0
flutter-version: 3.29.3

- name: Install Dependencies
run: flutter pub get
Expand Down
10 changes: 6 additions & 4 deletions bricks/test_optimizer/hooks/lib/pre_gen.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ Future<void> run(HookContext context) async {

final identifierGenerator = DartIdentifierGenerator();
final testIdentifierTable = <Map<String, String>>[];
for (final entity
in testDir.listSync(recursive: true).where((entity) => entity.isTest)) {
final relativePath =
path.relative(entity.path, from: testDir.path).replaceAll(r'\', '/');
for (final entity in testDir
.listSync(recursive: true)
.where((entity) => entity.isTest)) {
final relativePath = path
.relative(entity.path, from: testDir.path)
.replaceAll(r'\', '/');
testIdentifierTable.add({
'path': relativePath,
'identifier': identifierGenerator.next(),
Expand Down
2 changes: 1 addition & 1 deletion bricks/test_optimizer/hooks/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: hooks
publish_to: none

environment:
sdk: ^3.5.0
sdk: ^3.7.2

dependencies:
mason: ^0.1.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,12 @@ void main() {
ids.add(id);
}

expect(
ids.where((id) => _dartReservedKeywords.contains(id)),
isEmpty,
);
expect(ids.where((id) => _dartReservedKeywords.contains(id)), isEmpty);
expect(
ids.every((id) {
final idStart = id.codeUnitAt(0);
final isAlphabetic = (idStart >= 65 && idStart <= 90) ||
final isAlphabetic =
(idStart >= 65 && idStart <= 90) ||
(idStart >= 97 && idStart <= 122);
final isUnderscore = idStart == 95;
final isDollarSign = idStart == 36;
Expand Down
7 changes: 4 additions & 3 deletions e2e/helpers/command_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ void Function() withRunner(
Logger logger,
PubUpdater pubUpdater,
List<String> printLogs,
) runnerFn,
)
runnerFn,
) {
return _overridePrint((printLogs) async {
final logger = _MockLogger();
Expand All @@ -45,8 +46,8 @@ void Function() withRunner(
environment: {'CI': 'true'},
);

when(() => progress.complete(any())).thenAnswer((_) {
final message = _.positionalArguments.elementAt(0) as String?;
when(() => progress.complete(any())).thenAnswer((invocation) {
final message = invocation.positionalArguments.first as String?;
if (message != null) progressLogs.add(message);
});
when(() => logger.progress(any())).thenReturn(progress);
Expand Down
2 changes: 1 addition & 1 deletion e2e/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
publish_to: none

environment:
sdk: ^3.5.0
sdk: ^3.7.2

dev_dependencies:
mason: ^0.1.0
Expand Down
2 changes: 1 addition & 1 deletion e2e/test/commands/test/async_main/fixture/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ version: 0.1.0+1
publish_to: none

environment:
sdk: ^3.5.0
sdk: ^3.6.0

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

question: shouldn't this also be ^3.7.2?


dev_dependencies:
test: ^1.24.3
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// ignore_for_file: prefer_const_constructors
import 'package:test/test.dart';

void main() async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: 0.1.0+1
publish_to: none

environment:
sdk: ^3.5.0
sdk: ^3.7.2

dev_dependencies:
test: ^1.24.3
18 changes: 8 additions & 10 deletions lib/src/cli/cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,13 @@ part 'git_cli.dart';
const _asyncRunZoned = runZoned;

/// Type definition for [Process.run].
typedef RunProcess = Future<ProcessResult> Function(
String executable,
List<String> arguments, {
String? workingDirectory,
bool runInShell,
});
typedef RunProcess =
Future<ProcessResult> Function(
String executable,
List<String> arguments, {
String? workingDirectory,
bool runInShell,
});

/// This class facilitates overriding [Process.run].
/// It should be extended by another class in client code with overrides
Expand All @@ -47,10 +48,7 @@ abstract class ProcessOverrides {
}

/// Runs [body] in a fresh [Zone] using the provided overrides.
static R runZoned<R>(
R Function() body, {
RunProcess? runProcess,
}) {
static R runZoned<R>(R Function() body, {RunProcess? runProcess}) {
final overrides = _ProcessOverridesScope(runProcess);
return _asyncRunZoned(body, zoneValues: {_token: overrides});
}
Expand Down
17 changes: 8 additions & 9 deletions lib/src/cli/dart_cli.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ part of 'cli.dart';
/// Dart CLI
class Dart {
/// Determine whether dart is installed.
static Future<bool> installed({
required Logger logger,
}) async {
static Future<bool> installed({required Logger logger}) async {
try {
await _Cmd.run('dart', ['--version'], logger: logger);
return true;
Expand Down Expand Up @@ -79,12 +77,13 @@ class Dart {
}

final processes = _Cmd.runWhere(
run: (entity) => _Cmd.run(
'dart',
['fix', '--apply'],
workingDirectory: entity.parent.path,
logger: logger,
),
run:
(entity) => _Cmd.run(
'dart',
['fix', '--apply'],
workingDirectory: entity.parent.path,
logger: logger,
),
where: (entity) => !ignore.excludes(entity) && _isPubspec(entity),
cwd: cwd,
);
Expand Down
Loading
Loading