-
Notifications
You must be signed in to change notification settings - Fork 6
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
dart fix --dry-run での確認フローを追加 #113
Conversation
|
||
PIDS=() | ||
for file in "${files[@]}"; do | ||
# limit jobs to 5 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
||
( | ||
# Note: The script relies on the 'Nothing to fix!' output from 'dart fix --dry-run'. | ||
# This dependency might be an issue if the output format changes in future Dart versions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dart fix --dry-run
の出力の最後が 「Nothing to fix!」で終了しているかで判定
背景
dart fix --apply
を実行し、git diff
による差分で比較しない理由
実行速度において、dart fix --dry-run
は dart fix --apply
より遥かに速いため
「Nothing to fix!」という文言で判定している理由
dart fix --dry-run
は修正必要なファイルを検出してもステータスコード 0 を返すため
FYI: dart fix --dry-run
の実行結果
修正必要なファイルなし
fvm dart fix --dry-run
Computing fixes in flutter-mobile-project-template (dry run)...
Nothing to fix!
修正必要なファイルを検出
fvm dart fix --dry-run
Computing fixes in flutter-mobile-project-template (dry run)...
1 proposed fix in 1 file.
apps/app/lib/main.dart
directives_ordering - 1 fix
To fix an individual diagnostic, run one of:
dart fix --apply --code=directives_ordering
To fix all diagnostics, run:
dart fix --apply
# Note: The script relies on the 'Nothing to fix!' output from 'dart fix --dry-run'. | ||
# This dependency might be an issue if the output format changes in future Dart versions. | ||
if ! dart fix --dry-run "$file" | grep -q "Nothing to fix!"; then | ||
echo "Fixes might be needed for $file" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ready for review 🚀 |
@Kotaro666-dev @warahiko |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
全体的にはよさそうに感じました 👍
少し細かい部分コメントしています
(sh の経験あんまりないので変なこと言ってたら指摘してください 🙏 )
scripts/check-format-ci.sh
Outdated
find_files() { | ||
find . -name "*.dart" -not \( -name "*.freezed.dart" -o -name "*.g.dart" -o -name "*.gen.dart" -o -path "*/gen/*.dart" -o -path "./.dart_tool/*" \) -print0 | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4c024f6にて共通化しました。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
common.sh というのが一般的すぎる気もしますが、今のところ問題ないかなと思いました 👍
( $0 より適当な書き方があるんですね......!勉強なります)
@warahiko @Kotaro666-dev |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
細かいところまでご対応ありがとうございました! 👍
…w_of_dart_fix_on_ci
レビューしていただきありがとうございました! |
概要
close #72
レビュー観点
レビューレベル
レビュー優先度
画像 / 動画
動作変更なし
動作確認手順
動作変更なし
備考
参考
https://gist.github.com/hell0again/f5f3064ad1ea6c5c7308