0

Is it possible to write a custom cop that would call out class definitions like this:

MyError = Class.new(StandardError) 

And advise the author to format it like this?

class MyError < StandardError; end 
3
  • 1
    RuboCop's development docs should get you started. Or are there any specific problems with matching the dynamic class definition? Commented Apr 16, 2024 at 14:49
  • Yes, it's certainly possible to write such a cop. What are the issues you are facing with your attempt? Commented Apr 16, 2024 at 16:02
  • There is an open issue for this: github.com/rubocop/rubocop/issues/12343 Commented Apr 16, 2024 at 22:36

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.