-
-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
audit: Port audit_options rules for new formulae to rubocop and add test #2905
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,16 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) | |
end | ||
end | ||
end | ||
|
||
module NewFormulaAudit | ||
class Options < FormulaCop | ||
MSG = "New Formula should not use `deprecated_option`".freeze | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Newline after There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (feel free to do all of them in this PR) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I checked and found no recurrence in other cops. |
||
|
||
def audit_formula(_node, _class_node, _parent_class_node, body_node) | ||
return if versioned_formula? | ||
problem MSG if method_called_ever?(body_node, :deprecated_option) | ||
end | ||
end | ||
end | ||
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.
@GauthamGoli I've disabled this in 207ffd6 as it was activating for every formula every time.
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.
Looking into it now.