Skip to content
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

Merged
merged 16 commits into from
Dec 19, 2023

Commits on Dec 7, 2023

  1. Remove unused private method

    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.
    mhashizume committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    38cd675 View commit details
    Browse the repository at this point in the history
  2. Naming/HeredocDelimiterNaming

    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.
    mhashizume committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    3ca2a70 View commit details
    Browse the repository at this point in the history
  3. Naming/MethodParameterName

    The Naming/MethodParameterName Rubocop cop is fairly arbitrary. This
    commit disables it.
    mhashizume committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    85e4069 View commit details
    Browse the repository at this point in the history
  4. Naming/ClassAndModuleCamelCase

    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.
    mhashizume committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    95dff1a View commit details
    Browse the repository at this point in the history
  5. Naming/ConstantName

    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.
    mhashizume committed Dec 7, 2023
    Configuration menu
    Copy the full SHA
    81372fb View commit details
    Browse the repository at this point in the history

Commits on Dec 12, 2023

  1. Naming/MemoizedInstanceVariableName

    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.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    aca2f4b View commit details
    Browse the repository at this point in the history
  2. Naming/MethodName

    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.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    340038f View commit details
    Browse the repository at this point in the history
  3. Naming/RescuedExceptionsVariableName

    This commit disables the Rubocop Naming/RescuedExceptionsVariableName
    cop, as the cost of updating all of the existing violations outweighs
    the benefits of those changes.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    00933fe View commit details
    Browse the repository at this point in the history
  4. Naming/VariableName

    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.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    0d33e9f View commit details
    Browse the repository at this point in the history
  5. Naming/VariableNumber

    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.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    fbbcc32 View commit details
    Browse the repository at this point in the history
  6. Naming/BinaryOperatorParameterName

    This commit disables the Rubocop Naming/BinaryOperatorParameterName
    cop, as its violations are too far-reaching in our codebase to safely
    and easily fix.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    2459781 View commit details
    Browse the repository at this point in the history
  7. Naming/BlockParameterName

    This commit enables the Rubocop Naming/BlockParameterName cop.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    24f6448 View commit details
    Browse the repository at this point in the history
  8. Naming/AccessorMethodName

    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.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    15cb786 View commit details
    Browse the repository at this point in the history
  9. Remove redundant wrapper method

    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.
    mhashizume committed Dec 12, 2023
    Configuration menu
    Copy the full SHA
    3df0457 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    1f8cf4b View commit details
    Browse the repository at this point in the history

Commits on Dec 16, 2023

  1. Naming/PredicateName

    This commit addresses the Rubocop Naming/PredicateName cop by either
    exempting public methods with predicate names or renaming private
    methods.
    mhashizume committed Dec 16, 2023
    Configuration menu
    Copy the full SHA
    40d11ec View commit details
    Browse the repository at this point in the history