-
Notifications
You must be signed in to change notification settings - Fork 42
Add LinterTrait, which provides the common functions for both SingleRuleLinter and HHClientLinter #387
base: main
Are you sure you want to change the base?
Conversation
34f5476
to
b19848d
Compare
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.
This feels like it should be an abstract class instead: every linter should use this trait and implement the interface.
We can turn this trait into an abstract class for now. But it would become a problem if we also create another abstract class for |
Yeah :( I suspect we'll revisit this once traits are reworked and formalize. We might end up doing base classes and traits - base classes for devx, where the base classes always pull in the traits - but as multiple inheritance isn't supported, SingleRuleLinter would have to use at least one of the traits directly |
By the way, I updated this PR to introduce the I think the best design in Hack, considering the restrictions in the object model, is to minimize the interfaces and to eliminate the demand of sharing implementation between class instances. We can then move helper methods into namespaces as top-level free functions. Each time we want to add a helper, we add it as a free function. Each time we need new methods in the interfaces, we create a new interface containing the new methods instead of changing existing interfaces. |
If there's a semantic separation, i agree with this, but not purely as a BC mechanism; large sets of related hierarchies really hurt developer experience. BC vs devx is a tradeoff. |
Hi @Atry! Thank you for your pull request. We require contributors to sign our Contributor License Agreement, and yours needs attention. You currently have a record in our system, but the CLA is no longer valid, and will need to be resubmitted. ProcessIn order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA. Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with If you have received this in error or have any questions, please contact us at [email protected]. Thanks! |
No description provided.