-
-
Notifications
You must be signed in to change notification settings - Fork 760
Conversation
Supports treating the DeprecationFormatter like the others.
It also continues to support separate args for now. That can be removed after the other rspec gems have been updated.
Constants and usage can also be deprecated.
Nice job David! This looks great. |
FYI - I added a last minute addition to change a hash key (internal). This is ready to go AFAIC. |
Background: | ||
Given a file named "lib/foo.rb" with: | ||
"""ruby | ||
class Foo; def bar; RSpec.deprecate "Foo#bar"; end; end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the noise of combining what is usually on multiple lines (via semicolons) inhibits clarity here. What do you think about using a more normal code layout like this?
class Foo
def bar
RSpec.deprecate "Foo#bar"
end
end
Alternately, if you don't want all 5 lines, you could just define it as a top-level method directly on main, and then call it from the example below. That'd cut it down to 3 lines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in e8c1c59
👍 Fantastic work, David. I left a few questions, but I'm completely happy with it as is. I'll hold off merging for now in case there's any followup from my questions. |
Per convo in #912, print deprecations through a new
DeprecationFormatter
, and change the deprecation API to: