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

Add missing newline after frozen string literal for migrations #1392

Merged

Conversation

Earlopain
Copy link
Collaborator

Very small nit. All the other current migrations follow the RuboCop rule. It's erb so RuboCop doesn't know about it.

@bensheldon bensheldon merged commit 493f790 into bensheldon:main Jul 6, 2024
15 checks passed
@bensheldon
Copy link
Owner

Thank you!!

Probably years late to this party, but I just started adding this to my projects:

# config/environments/development.rb
  # Run Rubocop after generating files
  Rails.application.configure do
    config.generators.after_generate do |files|
      parsable_files = files.filter { |file| file.end_with?('.rb') }
      system("bundle exec rubocop -A --fail-level=E #{parsable_files.shelljoin}", exception: true) unless parsable_files.empty?
    end
  end

@Earlopain Earlopain deleted the migrations-uniform-magic-literal branch July 6, 2024 15:05
@Earlopain
Copy link
Collaborator Author

rails/rails#50506 will expose it nicely with a rails config option, you'll probably like that then. Though I wonder if doing unsafe autocorrect is a sane default 🤔

@bensheldon
Copy link
Owner

Oh nice! Thanks for sharing that Rails change!

Though I wonder if doing unsafe autocorrect is a sane default 🤔

Unfortunately, the ones I'm most likely to forget, like Frozen String Literals, are unsafe 😭

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

Successfully merging this pull request may close these issues.

2 participants