Skip to content

Naming/PredicateMethod crashes #14240

@akimd

Description

@akimd

Expected behavior

class NullLogger
  def initialize(*) = ()

  def add(*) = ()
  def debug(*) = ()
  def info(*) = ()
  def warn(*) = ()
  def error(*) = ()
  def fatal(*) = ()
end

Actual behavior

$ bundle exec rubocop rubocop/predicate_method.rb
Inspecting 1 file
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:2:2.
To see the complete backtrace run rubocop -d.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:4:2.
To see the complete backtrace run rubocop -d.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:5:2.
To see the complete backtrace run rubocop -d.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:6:2.
To see the complete backtrace run rubocop -d.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:7:2.
To see the complete backtrace run rubocop -d.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:8:2.
To see the complete backtrace run rubocop -d.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:9:2.
To see the complete backtrace run rubocop -d.
C

Offenses:

rubocop/predicate_method.rb:1:1: C: [Correctable] Style/FrozenStringLiteralComment: Missing frozen string literal comment.
class NullLogger
^

1 file inspected, 1 offense detected, 1 offense autocorrectable

7 errors occurred:
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:2:2.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:4:2.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:5:2.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:6:2.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:7:2.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:8:2.
An error occurred while Naming/PredicateMethod cop was inspecting rubocop/predicate_method.rb:9:2.
Errors are usually caused by RuboCop bugs.
Please, update to the latest RuboCop version if not already in use, and report a bug if the issue still occurs on this version.
https://github.com/rubocop/rubocop/issues

Mention the following information in the issue report:
1.76.0 (using Parser 3.3.8.0, rubocop-ast 1.45.0, analyzing as Ruby 2.7, running on ruby 3.3.8) [arm64-darwin24]

RuboCop version

$ bundle exec rubocop -V
1.76.0 (using Parser 3.3.8.0, Prism 1.4.0, rubocop-ast 1.45.0, analyzing as Ruby 3.3, running on ruby 3.3.8) [arm64-darwin24]
  - rubocop-minitest 0.38.1
  - rubocop-performance 1.25.0

Cheers!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions