Manual Rubocop Fixes#361
Merged
mattkirby merged 17 commits intoMar 10, 2020
Merged
Conversation
I assume `propSpecs` is a reference to the VMWare API so using camelCase is intentional.
added 9 commits
March 5, 2020 16:53
This commit fixes the various calls to `format` to consistently use the keyword token style. Hopefully this is more understandable and explicit?
This commit: * explicitly defines some short variable names that generally make sense in the codebase. * set numeric comparisons to be enforced instead of the predicate style
Prior to this commit there were a couple locations where exceptions were saved to `_e` but weren't used in the handler except to re-raise the exception, which simply calling the `raise` keyword will do without a provided argument. This commit removes the unnecessary assignment of the exception to a variable and simply uses `raise` instead.
As far as I can tell, this variable doesn't exist before this assignment and is immediately overwritten with the result of the method call so I don't think it needs to be here?
This commit updates the dashboard to use `URI.parse` instead of `Kernel#open` because open can potentially open files on the server and has other possible security issues. Also updated the logger to use `File.open` as it is more explicit and doesn't have the extra potential for abuse like `Kernel#open` https://rubocop.readthedocs.io/en/latest/cops_security/#securityopen
This commit ignores the `set_linked_clone` method, which doesn't obey the Rubocop recommended method naming convention.
This commit updates places where previously we were casting both terms in a float division into floats in order to ensure that float division occurs to use the `fdiv` method, which will always do float division and is available on both `Floats` and `Integers` because they are both `Numeric`.
This commit fixes a bug in update_clone_target where I believe `=` was intended, not `==` because `==` just goes to the void context here. Thanks Rubocop Lint/Void!
3bdbf36 to
cfc4326
Compare
added 6 commits
March 5, 2020 17:10
This commit fixes this call to `dc.vmFolder.traverse` to simply pass in the arguements instead of assigning to variables that are discarded.
Prior to this commit the codebase used the `zero?` method for comparing to 0 on some places and not in others. This commit makes all comparison to zero consistently use the `==`.
This commit drops the `has_` prefix from several `?` style methods because that's against the ruby style guide and redundant for a method ending in `?`.
This commit updates a block that was creating a shadow variable to use a different variable.
This commit removes two duplicate return statements in both branches of a conditional with one return statement outside the conditional blocks.
This commit switches the early `return` in `migrate_vm`'s connection pooling block to a `break`, since `return` implies you are returning something from a method and I don't think `migrate_vm` wants to do that. This is a place where a partial type system like Sorbet seems useful because then we'd have some idea about what the intended return is here.
cfc4326 to
57d2010
Compare
This commit updates Travis to require Rubocop to pass. This is possible now due to the fixes in puppetlabs#361.
mattkirby
reviewed
Mar 9, 2020
mattkirby
approved these changes
Mar 9, 2020
mattkirby
left a comment
Contributor
There was a problem hiding this comment.
Looks good to me. I just have the one inline question about the change to time.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This should fix the remaining Rubocop issues that couldn't be autocorrected.
Still working on the last couple of issues, I'll remove the DNM tag when those are finished.