-
Notifications
You must be signed in to change notification settings - Fork 4
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
[SDQ-2009] lint missing super #17
Closed
Closed
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,6 @@ | |
|
||
module Rubocop | ||
module Sendoso | ||
VERSION = '0.1.6' | ||
VERSION = '0.1.7' | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 we should use
AllowedParentClasses
(if possible) instead of excluding full directorieshttps://docs.rubocop.org/rubocop/1.54/cops_lint.html#lintmissingsuper
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.
That would include:
ApplicationService
ValidateGiftCsvRow
BaseHandler
AbstractHandler
Sends:TrackerServices:Base
Do we anticipate other Rails microservices to implement these parent classes?
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.
Agreed with Marc. Unless a good reason, super should be used.
Its already linked, sharing for posterity:
rubocop/ruby-style-guide#809 (comment)
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.
Sounds like we should keep this for full enforcement then, with no exceptions?
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 also sounds like I should instead go ahead and start full rubocop enforcement per #14, so that it is no longer possible to bypass this)
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.
Ok with creating exceptions for the classes listed above (I'll double check these and share here)
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 guess, what I'm trying to articulate is that list of classes doesn't feel like the appropriate solution outside of the monolith. If we share this repo/gem among other classes, it should only contain contents that are relevant to all rails repos (like whitelisting a widely shared pattern like app/services). If we're including ApplicationService with something like CookieCutter, than it feels more appropriate to whitelist here. However the others should be whitelisted in the monolith, not in this repo.
Relatedly, if we have this sort of complicated set of rules, that points to a need to go ahead and start enforcing more strictness with our rules (which is an underlying sentiment I'm seeing here based on visible patterns + these comments)
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.
Agree – we could just override this in the application Rubocop config instead of in the gem then