-
-
Notifications
You must be signed in to change notification settings - Fork 266
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/Output should not allow "puts" (without argument) #934
Labels
bug
Something isn't working
Comments
Makes sense to me. rubocop-rails/spec/rubocop/cop/rails/output_spec.rb Lines 122 to 130 in 38a2ad0
@koic Do you have an idea why is that? |
The test has added in the initial cop creation 9f70ec7 |
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Mar 29, 2023
Fixes rubocop#934. This PR fixes a false negative for `Rails/Output` when print methods without arguments. rubocop/rubocop#1184 reported the following problem, but it seems that it was mistakenly updated to allow no argument cases. ```console expect(p.arity).to be 1 ^ spec/models/cco/blog_cco2_spec.rb:46:16: C: Do not write to stdout. Use Rails' logger if you want to log. ``` It seems that rubocop/rubocop#6829 has since used that mistake. So this PR steers `Rails/Output` back to its original intent.
9 tasks
koic
added a commit
to koic/rubocop-rails
that referenced
this issue
Mar 29, 2023
Fixes rubocop#934. This PR fixes a false negative for `Rails/Output` when print methods without arguments. rubocop/rubocop#1184 reported the following problem, but it seems that it was mistakenly updated to allow no argument cases. ```console expect(p.arity).to be 1 ^ spec/models/cco/blog_cco2_spec.rb:46:16: C: Do not write to stdout. Use Rails' logger if you want to log. ``` It seems that rubocop/rubocop#6829 has since used that mistake. So this PR steers `Rails/Output` back to its original intent.
koic
added a commit
that referenced
this issue
Mar 30, 2023
[Fix #934] Fix a false negative for `Rails/Output`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Expected behavior
I recently updated ruby and rails, not sure what cased me to find this but I think it is a bug anyway. Rails/Output don't like this code below in my migration, which is correct. I think I agree with #175 that this cop should ignore migrations by default but thats a different issue
The issue is that the suggestions is this. And this code is accepted.
I think this is what should happend
Actual behavior
This code is accepted but should be
Steps to reproduce the problem
I coded the repo from master at sha fd69f79 and wrote a failing spec. It might not be the correct place for this
RuboCop version
cloned at fd69f79 and had a failing spec
The text was updated successfully, but these errors were encountered: