-
Notifications
You must be signed in to change notification settings - Fork 75
Prettier実行時のglob展開が環境に依存しないようにする #9470
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
Conversation
📝 WalkthroughWalkthroughpackage.jsonのlint:prettierスクリプトに、Prettierのグロブパターンの周囲にシングルクォートを追加し、シェル展開を防止するための変更を実施。 Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Possibly related issues
Poem
Pre-merge checks✅ Passed checks (3 passed)
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (2)📓 Common learnings📚 Learning: 2025-11-26T08:23:30.927ZApplied to files:
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@tyrrell-IH |
|
@ryufuta |
tyrrell-IH
left a comment
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.
エラーの再現、同エラーが今回のPRで解決できていること確認できました、approveします〜
シェルにglob展開をさせると環境によって結果に差異が出るんですね、勉強になりました🙏
|
@tyrrell-IH @okuramasafumi |
okuramasafumi
left a comment
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.
リンク先の内容は勉強になりますね。シェルは歴史的経緯もあって色々難しい…
LGTM!
|
@okuramasafumi |
|
@komagata |
komagata
left a comment
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.
確認させていただきました。OKです〜🙆♂️
Issue
概要
Prettierの実行コマンド中でglobパターンを引用符で囲んでいなかったため、シェル(
bin/sh)がglob展開を実行しており、実行環境によっては意図した通りに展開されていなかった。引用符で囲むようにしたことでglobの展開主体が実行環境によらずPrettier(内部的に
node-globを使用してglob展開を実行)に統一されるようにした。補足
修正前は
bin/shがBashバージョン4.0より前を指す環境ではapp/javascript/**/*.{js,jsx}がapp/javascript/*/*.{js,jsx}と解釈されていた。そのため、
app/javascript/直下のJavaScriptファイルなどがPrettierの対象外となっていて、検出されるべきエラーが検出されていなかった。参考
変更確認方法
chore/fix-inconsistent-glob-expansion-in-lintをローカルに取り込むapp/javascript/action_completed_button.jsの適当な行末に;を追記するapp/javascript/**/*.{js,jsx}にマッチしてapp/javascript/*/*.{js,jsx}にはマッチしないファイルであれば何でも良いbin/yarn lintを実行すると2でlintエラーを混入させたファイルにエラーが検出されることを確認するSummary by CodeRabbit
リリースノート
注: この変更は内部開発プロセスの改善であり、ユーザー向け機能への直接的な影響はありません。
✏️ Tip: You can customize this high-level summary in your review settings.