-
Notifications
You must be signed in to change notification settings - Fork 3
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
Pure autocorrect #152
Pure autocorrect #152
Conversation
Where auto-correct is available, of course. Some manual touches of file_signature to resolve cherry-pick conflicts
If this gets merged, I'll probably close #137 since there I drifted off into trying to rework test that were previously insufficiently differentiated. |
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.
one thing that looks like it contradicts an intention stated in the prior commit, but otherwise looks good to me.
other_checksums = other.checksums | ||
matching_keys = self_checksums.keys & other_checksums.keys | ||
return false if matching_keys.size == 0 |
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.
the intent according to this comment:
27db283#diff-11a0d7906801d9dea0eccb85667ad811R75
seemed to be to keep #size == 0
instead of switching to #empty
, for compatibility's sake?
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 only matters when called on Pathname
objects, which don't have empty?
on old rubies. Here, it is called on an Array, and that's fine.
group_addtions.add_file_instance(file.signature, file.instances[0]) | ||
end | ||
end | ||
version_additions.groups << group_addtions if group_addtions.files.size > 0 | ||
version_additions.groups << group_addtions unless group_addtions.files.empty? |
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.
ditto the compatibility question from the prior comment
@@ -124,7 +128,7 @@ def generate_content_metadata(file_group, object_id, version_id) | |||
# @return [Boolean] True if contentMetadata has essential file attributes, else raise exception | |||
def validate_content_metadata(content_metadata) | |||
result = validate_content_metadata_details(content_metadata) | |||
raise Moab::InvalidMetadataException, result[0] + " ..." if result.size > 0 | |||
raise Moab::InvalidMetadataException, result[0] + " ..." unless result.empty? |
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.
ditto empty?
(and a few more below, won't mark the rest from here out)
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 was misunderstanding, #empty
can be called on things other than Pathname
objects.
Cherry-picked from #137. This should be easy to digest as (almost) entirely a bunch of repetitive changes. With the exception of one file (resolving conflicts), all the code changes were done mechanically via rubocop based on
.rubocop_todo.yml
.If a particular style enforced by the tool is objectionable, then IMO, the proper reaction is to add exceptions or configuration to
.rubocop.yml
. It is counterproductive to leave "offenses" listed in aTODO
file documented as:The point is for the user to remove these configuration records one by one as the offenses are removed from the code base.