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
Many infinite loop issues when using --disable-uncorrectable
flag
#9922
Comments
Even if you can't share code, could you share the output of |
Sorry for the delay, just got approval to post the code. Here's a shorter file that reproduces the issue for me. Note, this happens for many files in fact.
class NewsletterRecommendationsController < ApplicationController
before_action :authenticate_user!
def show
# NOTE: admin logged-in-as not compatible (for now).
raise "Unimplemented" if warden.authenticated?(scope: :admin_user)
current_manager = current_user.manager
raise ActiveRecord::RecordNotFound unless current_manager.present?
newsletter_recommendation =
NewsletterRecommendation.find_by(uuid: params[:uuid])
raise ActiveRecord::RecordNotFound unless newsletter_recommendation
employee =
employee.find_for_company(
newsletter_recommendation.employee_id,
manager: current_manager,
create_intro: true
)
intro = employee.introductions.where(manager_id: current_manager.id).last
newsletter_recommendation.associate_introduction(intro)
# NOTE: newsletter has a 1:1 relation between uuid and record rather than a uuid per result set
rank = 0
employee_id_with_tracking = "#{employee.id}-#{newsletter_recommendation.uuid}-#{rank}"
respond_to do |format|
format.html { redirect_to company_employee_path(employee_id_with_tracking) }
end
end
end And here's the trace:
Our
|
Thanks for the report @thisismydesign. I'll try to fix it. |
…tive [Fix #9922] Replace extra disable directives with comma
@jonas054 Thanks a lot for the quick fix! Could you ping this thread when the fix is released? |
@thisismydesign Ping! RuboCop 1.18.4 has been released. |
Thanks @jonas054! |
Just removing cop names from disable directives is not a good solution. It's bound to cause infinite loop errors when those cops try to add the disable directives back. The natural solution is to put in commas instead.
Expected behavior
No errors or skip errors and continue running.
Actual behavior
Using
rubocop -a --disable-uncorrectable
a big project with no rubocop in the past results in many files running into infinite loops. Most often aroundMetrics/AbcSize
andMetrics/MethodLength
.Using
rubocop -a
works.Steps to reproduce the problem
I'll see if I can share code, but for now, I'm just curious to know if this is a known issue.
The text was updated successfully, but these errors were encountered: