Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove usage of flutter format #461

Merged
merged 2 commits into from
Oct 4, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/dart.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions mono_repo/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 6.6.2
parlough marked this conversation as resolved.
Show resolved Hide resolved

- Remove usage of removed `flutter format` command in
the generated `tool/ci.sh` file.

## 6.6.1

- Update to latest action versions.
Expand Down
17 changes: 14 additions & 3 deletions mono_repo/lib/src/ci_test_script.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,19 @@ import 'package_config.dart';
import 'shell_utils.dart';
import 'user_exception.dart';

String _commandContent(String commandName) => '''
String _commandContent(String commandName, {bool dartOnly = false}) {
if (dartOnly) {
return '''

function $commandName() {
command dart $commandName "\$@"
}''';
}

return '''

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter $commandName" is called instead of "dart $commandName".
# This assumes that the Flutter SDK has been installed in a previous step.
function $commandName() {
if grep -Fq "sdk: flutter" "\${PWD}/pubspec.yaml"; then
Expand All @@ -18,14 +28,15 @@ function $commandName() {
command dart $commandName "\$@"
fi
}''';
}

final bashScriptHeader = '''
#!/bin/bash
$createdWith

# Support built in commands on windows out of the box.
${_commandContent('pub')}
${_commandContent('format')}
${_commandContent('format', dartOnly: true)}
${_commandContent('analyze')}''';

String generateTestScript(
Expand Down
2 changes: 1 addition & 1 deletion mono_repo/lib/src/version.dart

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion mono_repo/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: mono_repo
description: >-
CLI tools to make it easier to manage a single source repository containing
multiple Dart packages.
version: 6.6.1
version: 6.6.2
repository: https://github.com/google/mono_repo.dart

topics:
Expand Down
16 changes: 6 additions & 10 deletions mono_repo/test/script_integration_outputs/readme_ci.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@
# Created with package:mono_repo v1.2.3

# Support built in commands on windows out of the box.

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter pub" is called instead of "dart pub".
# This assumes that the Flutter SDK has been installed in a previous step.
function pub() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
Expand All @@ -12,18 +13,13 @@ function pub() {
command dart pub "$@"
fi
}
# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# This assumes that the Flutter SDK has been installed in a previous step.

function format() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
command flutter format "$@"
else
command dart format "$@"
fi
command dart format "$@"
}

# When it is a flutter repo (check the pubspec.yaml for "sdk: flutter")
# then "flutter" is called instead of "pub".
# then "flutter analyze" is called instead of "dart analyze".
# This assumes that the Flutter SDK has been installed in a previous step.
function analyze() {
if grep -Fq "sdk: flutter" "${PWD}/pubspec.yaml"; then
Expand Down
18 changes: 7 additions & 11 deletions tool/ci.sh

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading