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

Any possibility of helping out #4

Open
timdiggins opened this issue Oct 11, 2023 · 2 comments
Open

Any possibility of helping out #4

timdiggins opened this issue Oct 11, 2023 · 2 comments

Comments

@timdiggins
Copy link

Hi - I love the idea for this cop. I know it's a looong time ago since you last looked at it, but have you got any ideas for following?

I got it working with recent rubocop and rubies (specs passing) but it's generating not generating any cop messages on my codebase. Also there's an issue with ApplicationRecord, which I haven't been able to replicate as a spec.

Very happy to contribute PRs, but I'm a bit at sea about knowing where to begin (haven't worked on rubocop cops before).

Any ideas welcome, but I appreciate you may have moved on from this code base now.

@carolineartz
Copy link
Owner

@timdiggins hello! my goodness i should really check my repos 😆 i don't get a ton of traffic so often completely miss things. well, I know its been almost a year since you opened this issue but... is this still something you are after? happy to get back into this and/or assist you doing so! let me know -- i'll keep an eye out here :)

@timdiggins
Copy link
Author

@carolineartz er - I guess me too. I have now cleared up my notifications in github, so maybe I will see your next response sooner.

If I comment out all the code in app/models/application_record.rb then
Basically I've tried running this on my repo and I get no rubocop fails in my models (despite not being in order AFAICT) but I get an error on application_record.rb

An error occurred while Rails/OrderModelMacros cop was inspecting /Volumes/data/workspaces/repo/app/models/application_record.rb:3:0.

I can remove that error if I get rid of all the code in application_record, ie.

# frozen_string_literal: true

class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true
end

but as soon as I have anything in the body other than the abstract class, e.g.

# frozen_string_literal: true

class ApplicationRecord < ActiveRecord::Base
  self.abstract_class = true

  def whatevs
    "blah"
  end
end

And in any case I never get any cop failures about my models...

(I have started doing tiny changes to make specs run, and could continue with that: dataceton/rubocop-rails-order_model_macros@master...fieldnotescommunities:rubocop-rails-order_model_macros:modernize)

No clue how to debug the lack of failures really. Have done almost no coding within rubocop cops. Any advice welcome.

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