diff --git a/dev/bots/analyze.dart b/dev/bots/analyze.dart index 21f50ac58af..984b2ebbf74 100644 --- a/dev/bots/analyze.dart +++ b/dev/bots/analyze.dart @@ -2677,6 +2677,7 @@ const Set kExecutableAllowlist = { 'dev/bots/codelabs_build_test.sh', 'dev/bots/docs.sh', + 'dev/checks', 'dev/conductor/bin/conductor', 'dev/conductor/bin/packages_autoroller', 'dev/conductor/core/lib/src/proto/compile_proto.sh', diff --git a/dev/checks b/dev/checks new file mode 100755 index 00000000000..00a52f5b114 --- /dev/null +++ b/dev/checks @@ -0,0 +1,25 @@ +#!/usr/bin/env bash +# Copyright 2014 The Flutter Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +set -e + +# Needed because if it is set, cd may print the path it changed to. +unset CDPATH + +# Lookup the parent directory of the script (../), the Flutter SDK root. +PROG_NAME="${BASH_SOURCE[0]}" +DEV_DIR="$( + cd "${PROG_NAME%/*}" + pwd -P +)" +FLUTTER_ROOT="$( + cd "$DEV_DIR/.." + pwd -P +)" + +# Run the tool. +pushd "$FLUTTER_ROOT/dev/checks_tool" >/dev/null +dart run --resident --quiet bin/checks.dart +popd >/dev/null diff --git a/dev/checks_tool/README.md b/dev/checks_tool/README.md new file mode 100644 index 00000000000..a6ae7497113 --- /dev/null +++ b/dev/checks_tool/README.md @@ -0,0 +1,14 @@ +# Flutter Repository Checks + +Repository-wide (excluding `engine/**`) analysis and code health checks. + +This directory is an experimental project to modularize the code that lives +today in [`dev/bots/analyze.dart`](../bots/analyze.dart), and make it fast +enough (and compatible with) an optional git-commit hook. If you have any +questions or concerns, see [#170491](https://github.com/flutter/flutter/issues/170491). + +## Usage + +```sh +./dev/checks +``` diff --git a/dev/checks_tool/analysis_options.yaml b/dev/checks_tool/analysis_options.yaml new file mode 100644 index 00000000000..f04c6cf0f30 --- /dev/null +++ b/dev/checks_tool/analysis_options.yaml @@ -0,0 +1 @@ +include: ../../analysis_options.yaml diff --git a/dev/checks_tool/bin/checks.dart b/dev/checks_tool/bin/checks.dart new file mode 100644 index 00000000000..66dbcf4603a --- /dev/null +++ b/dev/checks_tool/bin/checks.dart @@ -0,0 +1,9 @@ +// Copyright 2014 The Flutter Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'dart:io' as io; + +void main(List args) { + io.stdout.writeln('Hello World'); +} diff --git a/dev/checks_tool/pubspec.yaml b/dev/checks_tool/pubspec.yaml new file mode 100644 index 00000000000..46420d7aa78 --- /dev/null +++ b/dev/checks_tool/pubspec.yaml @@ -0,0 +1,14 @@ +name: checks_tool + +environment: + sdk: ^3.7.0-0 + +resolution: workspace + +dependencies: + args: any + +dev_dependencies: + test: any + +# PUBSPEC CHECKSUM: foei0u \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index 42e7bdee1fb..50a477f5bb6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -16,6 +16,7 @@ workspace: - packages/fuchsia_remote_debug_protocol - packages/flutter_web_plugins - packages/flutter_goldens + - dev/checks_tool - dev/devicelab - dev/manual_tests - dev/tracing_tests