Draft
Conversation
Cover migrations, models, controllers, routes, jobs, mailers, ActiveSupport::Concern, initializers, and STI patterns. Each example asserts Prism parse cleanliness and absence of leaked AST internals. Co-authored-by: fujitani sora <fujitanisora0414@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Rails アプリでよく使う Ruby 構文(マイグレーション、モデル、コントローラ、ルーティング、ジョブ、メーラー、Concern、初期化フック、STI など)を題材に、
Rfmt.formatの後に Prism で構文エラーが出ないことと、フォーマッタ内部表現が出力に漏れないことを検証する RSpec を追加しました。Motivation
Rails 向けの回帰を網羅的に拾うため、既存の単発スペックに加えて代表的なイデオムをまとめた探索テストを置きます。
Fixes #
Related to #
Changes
spec/rails_idioms_spec.rbを新規追加(9 例).gitignoreにvendor/bundle/を追加(ローカルbundle install --path vendor/bundle用)Type of Change
Testing
bundle exec rspec)cd ext/rfmt && cargo test)Checklist
cargo clippy)Screenshots / Examples
Before
# N/A — テスト追加のみAfter
# spec/rails_idioms_spec.rb で Rails 風スニペットを format → Prism で検証Additional Notes
CI 環境では従来どおりフルスイートが走ります。ローカルで
vendor/bundleを使う場合は.gitignoreで除外されます。