-
Notifications
You must be signed in to change notification settings - Fork 349
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert the result helpers to a mixin
- Loading branch information
1 parent
07bb50e
commit d22bca6
Showing
4 changed files
with
71 additions
and
114 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d22bca6
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 generally prefer a separated class to increase encapsulation, however I know that it is a bit of a stretch. @alloy what is your take?
d22bca6
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.
It is not immediately clear to me why a mixin helps here. Can that be clarified?
d22bca6
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.
Both the analyzer and the linter need to produce results and they need to be of the same form. I was trying to avoid duplicating code and adding in more complexity.
d22bca6
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 see. I wonder, aren’t there more places where we essentially have lists of values that are namespaced? (i.e. like
:error
and:warning
in this case?) If so, then maybe we can abstract that in a class that has amerge
method and use that instead, which also cleans up the merging code, which seems to be the bulk of the duplication.