1
0
mirror of https://github.com/dart-lang/sdk synced 2024-07-05 17:30:16 +00:00

[bisect_dart] Enable further analysis for bisect_dart tool

I know this is just an unpublished tool, but enabling the expanded analysis at least makes the development experience consistent with other packages within `/pkg`.

Change-Id: Id4daf75cf37042662e3ab3c75dc4c4f856fd4099
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/329864
Auto-Submit: Parker Lougheed <parlough@gmail.com>
Commit-Queue: Daco Harkes <dacoharkes@google.com>
Reviewed-by: William Hesse <whesse@google.com>
Reviewed-by: Daco Harkes <dacoharkes@google.com>
This commit is contained in:
Parker Lougheed 2023-10-24 16:21:14 +00:00 committed by Commit Queue
parent 0c91d4195e
commit cecb0cabd6
5 changed files with 17 additions and 10 deletions

View File

@ -0,0 +1 @@
include: package:dart_flutter_team_lints/analysis_options.yaml

View File

@ -47,7 +47,7 @@ class BisectionConfig {
///
/// This will modify the SDK checkout!
///
/// Will be created if it doens't exist.
/// Will be created if it doesn't exist.
final Uri sdkPath;
static const _sdkPathKey = 'sdk_path';
@ -100,8 +100,8 @@ class BisectionConfig {
'python3 tools/test.py --build -n dartk-linux-debug-x64 lib_2/isolate/package_resolve_test',
],
sdkPath: Directory.current.uri,
failureString:
"Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.",
failureString: "Error: The argument type 'String' can't "
"be assigned to the parameter type 'Uri'.",
);
static const _argumentDescriptions = {
@ -130,7 +130,7 @@ The name is used for distinguishing logs.
final exampleArguments = _example.asMap().entries.map((e) {
var value = e.value;
if (value is List) {
value = value.first;
value = value.first as String;
}
if ((value as String).contains(' ')) {
value = '"$value"';
@ -159,5 +159,5 @@ $descriptions
}
extension on String {
toPattern() => RegExp(RegExp.escape(this));
RegExp toPattern() => RegExp(RegExp.escape(this));
}

View File

@ -77,7 +77,9 @@ Future<String> _bisect(
final pivotIndex = numCommits ~/ 2;
final pivot = commitHashes[pivotIndex];
logger.info(
'Bisecting ${commitHashes.first}...${commitHashes.last} ($numCommits commits). Trying $pivot.');
'Bisecting ${commitHashes.first}...${commitHashes.last} '
'($numCommits commits). Trying $pivot.',
);
final commitResult = await _checkCommit(
pivot,
testCommands,
@ -160,7 +162,7 @@ Future<void> _gclientSync(Uri sdkCheckout, Logger logger) {
Future<String> _runTest(
List<String> testCommands, Uri sdkCheckout, Logger logger) async {
var output = "";
var output = '';
for (final command in testCommands) {
final commandSplit = command.split(' ');
final result = await runProcess(

View File

@ -3,9 +3,12 @@ name: bisect_dart
publish_to: none
environment:
sdk: '>=3.0.0 <4.0.0'
sdk: ^3.1.0
dependencies:
cli_config: any
intl: any
logging: any
dev_dependencies:
dart_flutter_team_lints: any

View File

@ -230,9 +230,10 @@ class Package implements Comparable<Package> {
var extraDevDeclarations = Set<String>.from(_declaredDevDependencies)
..removeAll(devdeps);
// Remove package:lints - it's often declared as a dev dependency in order
// Remove package:lints and package:dart_flutter_team_lints -
// They are often declared as dev dependencies in order
// to bring in analysis_options configuration files.
extraDevDeclarations.removeAll(['lints']);
extraDevDeclarations.removeAll(const ['lints', 'dart_flutter_team_lints']);
if (extraDevDeclarations.isNotEmpty) {
out(' ${_printSet(extraDevDeclarations)} declared in '
"'dev_dependencies:' but not used in dev dirs.");