mirror of
https://github.com/dart-lang/sdk
synced 2024-10-04 20:39:38 +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:
parent
0c91d4195e
commit
cecb0cabd6
1
pkg/bisect_dart/analysis_options.yaml
Normal file
1
pkg/bisect_dart/analysis_options.yaml
Normal file
|
@ -0,0 +1 @@
|
||||||
|
include: package:dart_flutter_team_lints/analysis_options.yaml
|
|
@ -47,7 +47,7 @@ class BisectionConfig {
|
||||||
///
|
///
|
||||||
/// This will modify the SDK checkout!
|
/// 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;
|
final Uri sdkPath;
|
||||||
|
|
||||||
static const _sdkPathKey = 'sdk_path';
|
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',
|
'python3 tools/test.py --build -n dartk-linux-debug-x64 lib_2/isolate/package_resolve_test',
|
||||||
],
|
],
|
||||||
sdkPath: Directory.current.uri,
|
sdkPath: Directory.current.uri,
|
||||||
failureString:
|
failureString: "Error: The argument type 'String' can't "
|
||||||
"Error: The argument type 'String' can't be assigned to the parameter type 'Uri'.",
|
"be assigned to the parameter type 'Uri'.",
|
||||||
);
|
);
|
||||||
|
|
||||||
static const _argumentDescriptions = {
|
static const _argumentDescriptions = {
|
||||||
|
@ -130,7 +130,7 @@ The name is used for distinguishing logs.
|
||||||
final exampleArguments = _example.asMap().entries.map((e) {
|
final exampleArguments = _example.asMap().entries.map((e) {
|
||||||
var value = e.value;
|
var value = e.value;
|
||||||
if (value is List) {
|
if (value is List) {
|
||||||
value = value.first;
|
value = value.first as String;
|
||||||
}
|
}
|
||||||
if ((value as String).contains(' ')) {
|
if ((value as String).contains(' ')) {
|
||||||
value = '"$value"';
|
value = '"$value"';
|
||||||
|
@ -159,5 +159,5 @@ $descriptions
|
||||||
}
|
}
|
||||||
|
|
||||||
extension on String {
|
extension on String {
|
||||||
toPattern() => RegExp(RegExp.escape(this));
|
RegExp toPattern() => RegExp(RegExp.escape(this));
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,9 @@ Future<String> _bisect(
|
||||||
final pivotIndex = numCommits ~/ 2;
|
final pivotIndex = numCommits ~/ 2;
|
||||||
final pivot = commitHashes[pivotIndex];
|
final pivot = commitHashes[pivotIndex];
|
||||||
logger.info(
|
logger.info(
|
||||||
'Bisecting ${commitHashes.first}...${commitHashes.last} ($numCommits commits). Trying $pivot.');
|
'Bisecting ${commitHashes.first}...${commitHashes.last} '
|
||||||
|
'($numCommits commits). Trying $pivot.',
|
||||||
|
);
|
||||||
final commitResult = await _checkCommit(
|
final commitResult = await _checkCommit(
|
||||||
pivot,
|
pivot,
|
||||||
testCommands,
|
testCommands,
|
||||||
|
@ -160,7 +162,7 @@ Future<void> _gclientSync(Uri sdkCheckout, Logger logger) {
|
||||||
|
|
||||||
Future<String> _runTest(
|
Future<String> _runTest(
|
||||||
List<String> testCommands, Uri sdkCheckout, Logger logger) async {
|
List<String> testCommands, Uri sdkCheckout, Logger logger) async {
|
||||||
var output = "";
|
var output = '';
|
||||||
for (final command in testCommands) {
|
for (final command in testCommands) {
|
||||||
final commandSplit = command.split(' ');
|
final commandSplit = command.split(' ');
|
||||||
final result = await runProcess(
|
final result = await runProcess(
|
||||||
|
|
|
@ -3,9 +3,12 @@ name: bisect_dart
|
||||||
publish_to: none
|
publish_to: none
|
||||||
|
|
||||||
environment:
|
environment:
|
||||||
sdk: '>=3.0.0 <4.0.0'
|
sdk: ^3.1.0
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
cli_config: any
|
cli_config: any
|
||||||
intl: any
|
intl: any
|
||||||
logging: any
|
logging: any
|
||||||
|
|
||||||
|
dev_dependencies:
|
||||||
|
dart_flutter_team_lints: any
|
||||||
|
|
|
@ -230,9 +230,10 @@ class Package implements Comparable<Package> {
|
||||||
|
|
||||||
var extraDevDeclarations = Set<String>.from(_declaredDevDependencies)
|
var extraDevDeclarations = Set<String>.from(_declaredDevDependencies)
|
||||||
..removeAll(devdeps);
|
..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.
|
// to bring in analysis_options configuration files.
|
||||||
extraDevDeclarations.removeAll(['lints']);
|
extraDevDeclarations.removeAll(const ['lints', 'dart_flutter_team_lints']);
|
||||||
if (extraDevDeclarations.isNotEmpty) {
|
if (extraDevDeclarations.isNotEmpty) {
|
||||||
out(' ${_printSet(extraDevDeclarations)} declared in '
|
out(' ${_printSet(extraDevDeclarations)} declared in '
|
||||||
"'dev_dependencies:' but not used in dev dirs.");
|
"'dev_dependencies:' but not used in dev dirs.");
|
||||||
|
|
Loading…
Reference in a new issue