Add many more global analyses. (#47875)
* Update packages. * Add many more global analyses. * Catch trailing spaces and trailing newlines in all text files. Before we were only checking newly added files, but that means we missed some. * Port the trailing spaces logic to work on Windows too. * Correct all the files with trailing spaces and newlines. * Refactor some of the dev/bots logic into a utils.dart library. Notably, the "exit" and "print" shims for testing are now usable from test.dart, analyze.dart, and run_command.dart. * Add an "exitWithError" function that prints the red lines and then exits. This is the preferred way to exit from test.dart, analyze.dart, and run_command.dart. * More consistency in the output of analyze.dart. * Refactor analyze.dart to use the _allFiles file enumerating logic more widely. * Add some double-checking logic to the _allFiles logic to catch cases where changes to that logic end up catching fewer files than expected (helps prevent future false positives). * Add a check to prevent new binary files from being added to the repository. Grandfather in the binaries that we've already added. * Update all the dependencies (needed because we now import crypto in dev/bots/analyze.dart).
This commit is contained in:
@@ -191,5 +191,3 @@ Set<String> readDepfile(String depfilePath) {
|
||||
.where((String path) => path.isNotEmpty)
|
||||
.toSet();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -290,4 +290,3 @@ const Target androidx64ProfileBundle = AndroidAotBundle(androidx64Profile);
|
||||
const Target androidArmReleaseBundle = AndroidAotBundle(androidArmRelease);
|
||||
const Target androidArm64ReleaseBundle = AndroidAotBundle(androidArm64Release);
|
||||
const Target androidx64ReleaseBundle = AndroidAotBundle(androidx64Release);
|
||||
|
||||
|
||||
@@ -275,11 +275,12 @@ class UpdatePackagesCommand extends FlutterCommand {
|
||||
// here.
|
||||
for (PubspecYaml pubspec in pubspecs) {
|
||||
final String package = pubspec.name;
|
||||
final String version = pubspec.version;
|
||||
specialDependencies.add(package);
|
||||
tree._versions[package] = pubspec.version;
|
||||
assert(!tree._dependencyTree.containsKey(package));
|
||||
tree._dependencyTree[package] = <String>{};
|
||||
for (PubspecDependency dependency in pubspec.dependencies) {
|
||||
if (dependency.kind == DependencyKind.normal) {
|
||||
tree._versions[package] = version;
|
||||
tree._dependencyTree[package] ??= <String>{};
|
||||
tree._dependencyTree[package].add(dependency.name);
|
||||
}
|
||||
}
|
||||
@@ -765,12 +766,16 @@ class PubspecYaml {
|
||||
final List<String> transitiveDependenciesAsList = transitiveDependencies.toList()..sort();
|
||||
final List<String> transitiveDevDependenciesAsList = transitiveDevDependencies.toList()..sort();
|
||||
|
||||
String computeTransitiveDependencyLineFor(String package) {
|
||||
return ' $package: ${versions.versionFor(package)} $kTransitiveMagicString';
|
||||
}
|
||||
|
||||
// Add a line for each transitive dependency and transitive dev dependency using our magic string to recognize them later.
|
||||
for (String package in transitiveDependenciesAsList) {
|
||||
transitiveDependencyOutput.add(' $package: ${versions.versionFor(package)} $kTransitiveMagicString');
|
||||
transitiveDependencyOutput.add(computeTransitiveDependencyLineFor(package));
|
||||
}
|
||||
for (String package in transitiveDevDependenciesAsList) {
|
||||
transitiveDevDependencyOutput.add(' $package: ${versions.versionFor(package)} $kTransitiveMagicString');
|
||||
transitiveDevDependencyOutput.add(computeTransitiveDependencyLineFor(package));
|
||||
}
|
||||
|
||||
// Build a sorted list of all dependencies for the checksum.
|
||||
@@ -1239,7 +1244,7 @@ class PubDependencyTree {
|
||||
}
|
||||
|
||||
/// The transitive closure of all the dependencies for the given package,
|
||||
/// excluding any listen in `seen`.
|
||||
/// excluding any listed in `seen`.
|
||||
Iterable<String> getTransitiveDependenciesFor(
|
||||
String package, {
|
||||
@required Set<String> seen,
|
||||
|
||||
@@ -11,12 +11,12 @@ dependencies:
|
||||
# To update these, use "flutter update-packages --force-upgrade".
|
||||
archive: 2.0.11
|
||||
args: 1.5.2
|
||||
dwds: 0.8.1
|
||||
dwds: 0.8.5
|
||||
completion: 0.2.1+1
|
||||
coverage: 0.13.3+1
|
||||
coverage: 0.13.3+3
|
||||
crypto: 2.1.3
|
||||
file: 5.1.0
|
||||
http: 0.12.0+2
|
||||
http: 0.12.0+3
|
||||
intl: 0.16.0
|
||||
json_rpc_2: 2.1.0
|
||||
linter: 0.1.101
|
||||
@@ -46,7 +46,7 @@ dependencies:
|
||||
test_core: 0.2.15
|
||||
|
||||
# Code generation dependencies
|
||||
build_runner_core: 4.2.0
|
||||
build_runner_core: 4.3.0
|
||||
dart_style: 1.3.3
|
||||
code_builder: 3.2.1
|
||||
build: 1.2.2
|
||||
@@ -78,7 +78,7 @@ dependencies:
|
||||
http_parser: 3.1.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
io: 0.3.3 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
js: 0.6.1+1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
json_annotation: 3.0.0 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
json_annotation: 3.0.1 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
kernel: 0.3.27 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
logging: 0.11.3+2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
matcher: 0.12.6 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
@@ -118,7 +118,7 @@ dev_dependencies:
|
||||
test: 1.9.4
|
||||
build_runner: 1.7.2
|
||||
build_vm_compilers: 1.0.4
|
||||
build_test: 0.10.10
|
||||
build_test: 0.10.11
|
||||
|
||||
multi_server_socket: 1.0.2 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
node_preamble: 1.4.8 # THIS LINE IS AUTOGENERATED - TO UPDATE USE "flutter update-packages --force-upgrade"
|
||||
@@ -128,4 +128,4 @@ dartdoc:
|
||||
# Exclude this package from the hosted API docs.
|
||||
nodoc: true
|
||||
|
||||
# PUBSPEC CHECKSUM: de88
|
||||
# PUBSPEC CHECKSUM: a092
|
||||
|
||||
@@ -35,7 +35,7 @@ end
|
||||
target 'Runner' do
|
||||
use_frameworks!
|
||||
use_modular_headers!
|
||||
|
||||
|
||||
# Flutter Pod
|
||||
|
||||
copied_flutter_dir = File.join(__dir__, 'Flutter')
|
||||
|
||||
@@ -197,4 +197,3 @@ flutter:
|
||||
}
|
||||
|
||||
class MockDirectory extends Mock implements Directory {}
|
||||
|
||||
|
||||
@@ -135,4 +135,3 @@ file:///Users/foo/canonicalized_map.dart
|
||||
FileSystem: () => MemoryFileSystem(style: FileSystemStyle.posix)
|
||||
}));
|
||||
}
|
||||
|
||||
|
||||
@@ -185,4 +185,3 @@ void main() {
|
||||
}
|
||||
|
||||
class MockGenSnapshot extends Mock implements GenSnapshot {}
|
||||
|
||||
|
||||
@@ -674,6 +674,4 @@ flutter:
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -107,4 +107,3 @@ void main() {
|
||||
class MockProcessManager extends Mock implements ProcessManager {}
|
||||
class MockPlatform extends Mock implements Platform {}
|
||||
class MockOperatingSystemUtils extends Mock implements OperatingSystemUtils {}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user