-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
(PUP-11771) Rubocop Naming Cops #9183
(PUP-11771) Rubocop Naming Cops #9183
Conversation
The private method is_module_package? was only ever referenced by code that was removed in 2014 by 3f05274. Because this method is both private and not referenced anywhere else in the code base, this commit removes the is_module_package? method.
Heredoc delimiters do not bring much value and would involve a lot of work to change existing delimiters. This commit disables the Rubocop Naming/HeredocDelimiterNaming cop.
The Naming/MethodParameterName Rubocop cop is fairly arbitrary. This commit disables it.
Disable the Naming/ClassAndModuleCamelCase Rubocop cop on existing violations, as class names are public by default and updating them could be a breaking change. Enable this cop for new code to catch any future violations.
Disable the Naming/ConstantName Rubocop cop on existing violations, as those constants may be public and updating them could be a breaking change. Enable this cop for new code to catch any future violations.
89b793a
to
8ef4974
Compare
Because renaming memoized instance variables can be potentially dangerous, to address the Rubocop Naming/MemoizedInstanceVariableName cop, this commit excludes existing violations while enabling the cop for new code.
Pops implements the visitor pattern and that relies on the convention of methods being namedoperation_Class. This commit excludes puppet/functions, puppet/pops, and puppet/util/windows from the Rubocop Naming/MethodName cop. Additionally, this commit updates the rpm_compareEVR methods in both Puppet::Util::Package::Version::Rpm and Puppet::Util::RpmCompare to instead be called rpm_compare_evr to adhere to snake case.
This commit disables the Rubocop Naming/RescuedExceptionsVariableName cop, as the cost of updating all of the existing violations outweighs the benefits of those changes.
This commit enables the Rubocop Naming/VariableName cop while excluding files that had been previously excluded (some Windows code that intentionally follows Microsoft's Hungarian notation). New code will be subject to this cop.
This commit disables the Rubocop Naming/VariableNumber cop. This check affects too much of our existing codebase and the cost of correcting potential violations outweighs the benefits of enabling this cop.
This commit disables the Rubocop Naming/BinaryOperatorParameterName cop, as its violations are too far-reaching in our codebase to safely and easily fix.
This commit enables the Rubocop Naming/BlockParameterName cop.
This commit moves the Rubocop Naming/AccessorMethodName cop from the todo file to the .rubocop configuration file. This does not change any behavior but indicates that this behavior is known and intentional.
The is_constant_defined? method was added in 3d43d86 to account for behavior differences between Ruby 1.8 and 1.9. It was simplified in 84a9cb8 as part of removal Ruby 1.8 support and the method exists now as a fairly transparent wrapper of Ruby's built-in Module#const_defined? method. is_constant_defined? has been marked as private since 79889af in 2013. This method removes the is_constant_defined? method and substitutes it with Module#const_defined? instead.
550bd2e
to
60e143d
Compare
60e143d
to
5d4ea14
Compare
5d4ea14
to
21bbb92
Compare
@joshcooper Thanks for the review, I've reverted the issues you've flagged |
Ah sorry, the Naming/PredicateName cop is confusing... I was hoping to keep the
|
21bbb92
to
e7e59ba
Compare
@joshcooper Gotcha, I think I understand now. I've updated my commit with your suggestions. Let me know if I can make any other changes. |
e7e59ba
to
ac34d58
Compare
This commit addresses the Rubocop Naming/PredicateName cop by either exempting public methods with predicate names or renaming private methods.
ac34d58
to
40d11ec
Compare
This PR comprises commits to address Rubocop naming cops and associated issues.