-
Notifications
You must be signed in to change notification settings - Fork 32
Open
Description
Context
Most RBS annotations are not of the form @key: value, so it is easy1: to forget the colon in annotations like
-# @requires_ancestor ::Whatever
+# @requires_ancestor: ::WhateverThis can be particularly frustrating when attempting to require a complex ancestor (such as a module including metaprogramming), where one might assume things aren't working because they are requiring the wrong ancestor, or because Sorbet is not statically aware of the method, when in fact it turns out they were simply silently not requiring any ancestor at all.
Proposal
It would be nice if there was a cop that looked for such comments that are probably a mistake and attached an info level warning, saving the developer time debugging.
# @requires_ancestor ::Whatever
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ INFO: This looks like a malformed RBS annotation. Did you mean `@requires_ancestor: ::Whatever`?Footnotes
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels