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

Rails/CreateTableWithTimestamps should consider it #1413

Open
shyouhei opened this issue Jan 17, 2025 · 1 comment
Open

Rails/CreateTableWithTimestamps should consider it #1413

shyouhei opened this issue Jan 17, 2025 · 1 comment

Comments

@shyouhei
Copy link

Expected behavior

No offences reported

Actual behavior

Rails/CreateTableWithTimestamps: Add timestamps when creating a new table. reported

Steps to reproduce the problem

class CreateAccounts < ActiveRecord::Migration[8.0]
  def change = create_table(:test) { it.timestamps }
end

Note: the same happens for _1

RuboCop version

$ bundle exec rubocop -V
1.70.0 (using Parser 3.3.6.0, rubocop-ast 1.37.0, analyzing as Ruby 3.4, running on ruby 3.4.1) [aarch64-linux-gnu]

rubocop-rails 2.28.0 is affected

Earlopain added a commit to Earlopain/rubocop-rails that referenced this issue Feb 27, 2025
…ocks

This should also take care of rubocop#1413, once `itblock` is introduces
@koic
Copy link
Member

koic commented Feb 27, 2025

To share the current situation, unfortunately, RuboCop does not yet support the it block parameter syntax.
#1456 resolves numbered block parameter syntax, but the it block parameter syntax is still unsupported.

It is likely that ruby/prism#3481 will enable Prism (Prism::Translation::Parser) to support the it block parameter syntax ahead of Parser gem. As for the traditional Parser gem, as discussed in whitequark/parser#1046, there is no clear timeline yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants