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

Should Rails/Output Skip migrations and generators by default? #175

Closed
schwern opened this issue Dec 17, 2019 · 2 comments
Closed

Should Rails/Output Skip migrations and generators by default? #175

schwern opened this issue Dec 17, 2019 · 2 comments

Comments

@schwern
Copy link

schwern commented Dec 17, 2019

The Rails/Output cop is flagging p and puts inside migrations and generators saying I should use the logger instead. Rails.logger does not appear to be a drop in replacement for them in these contexts. Rails.logger.info goes to log/dev.log which is incorrect, it should be displayed to the screen like the rest of the generator or migration output.

Should Rails/Output be disabled by default for generators and migrations? Or does Rails/Output need extra documentation about the right thing to do inside generators and migrations?

@andyw8
Copy link
Contributor

andyw8 commented Dec 18, 2019

For migrations, you can use say and say_with_time:
https://guides.rubyonrails.org/active_record_migrations.html#changing-the-output-of-running-migrations

For generators, the readme method can output the contents of a file:

https://guides.rubyonrails.org/generators.html#readme

Does that cover your use cases?

@koic
Copy link
Member

koic commented Apr 3, 2023

If this issue is the same problem as #934 will be solved by #965.

@koic koic closed this as completed Apr 3, 2023
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

3 participants