repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/to_json.rb | lib/rubocop/cop/lint/to_json.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks to make sure `#to_json` includes an optional argument.
# When overriding `#to_json`, callers may invoke JSON
# generation via `JSON.generate(your_obj)`. Since `JSON#generate` allows
# for an optional argument, y... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/hash_compare_by_identity.rb | lib/rubocop/cop/lint/hash_compare_by_identity.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Prefer using `Hash#compare_by_identity` rather than using `object_id`
# for hash keys.
#
# This cop looks for hashes being keyed by objects' `object_id`, using
# one of these methods: `key?`, `has_key?`, `fetch`, ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/missing_cop_enable_directive.rb | lib/rubocop/cop/lint/missing_cop_enable_directive.rb | # frozen_string_literal: true
# rubocop:disable Lint/RedundantCopDisableDirective
module RuboCop
module Cop
module Lint
# Checks that there is an `# rubocop:enable ...` statement
# after a `# rubocop:disable ...` statement. This will prevent leaving
# cop disables on wide ranges of code, that l... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/send_with_mixin_argument.rb | lib/rubocop/cop/lint/send_with_mixin_argument.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `send`, `public_send`, and `__send__` methods
# when using mix-in.
#
# `include` and `prepend` methods were private methods until Ruby 2.0,
# they were mixed-in via `send` method. This cop uses Ruby 2.1... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/syntax.rb | lib/rubocop/cop/lint/syntax.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Repacks Parser's diagnostics/errors
# into RuboCop's offenses.
class Syntax < Base
LEVELS = %i[error fatal].freeze
def on_other_file
add_offense_from_error(processed_source.parser_error) if processe... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/big_decimal_new.rb | lib/rubocop/cop/lint/big_decimal_new.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# `BigDecimal.new()` is deprecated since BigDecimal 1.3.3.
# This cop identifies places where `BigDecimal.new()`
# can be replaced by `BigDecimal()`.
#
# @example
# # bad
# BigDecimal.new(123.456, 3)... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_numeric_operation.rb | lib/rubocop/cop/lint/useless_numeric_operation.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Certain numeric operations have no impact, being:
# Adding or subtracting 0, multiplying or dividing by 1 or raising to the power of 1.
# These are probably leftover from debugging, or are mistakes.
#
# @example
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/circular_argument_reference.rb | lib/rubocop/cop/lint/circular_argument_reference.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for circular argument references in optional keyword
# arguments and optional ordinal arguments.
#
# NOTE: This syntax was made invalid on Ruby 2.7 - Ruby 3.3 but is allowed
# again since Ruby 3.4.
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/numbered_parameter_assignment.rb | lib/rubocop/cop/lint/numbered_parameter_assignment.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for uses of numbered parameter assignment.
# It emulates the following warning in Ruby 2.7:
#
# $ ruby -ve '_1 = :value'
# ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-darwin19]
# -e:... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/literal_as_condition.rb | lib/rubocop/cop/lint/literal_as_condition.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for literals used as the conditions or as
# operands in and/or expressions serving as the conditions of
# if/while/until/case-when/case-in.
#
# NOTE: Literals in `case-in` condition where the match variable... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_times.rb | lib/rubocop/cop/lint/useless_times.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for uses of `Integer#times` that will never yield
# (when the integer ``<= 0``) or that will only ever yield once
# (`1.times`).
#
# @safety
# This cop is unsafe as `times` returns its receiver, whi... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/float_out_of_range.rb | lib/rubocop/cop/lint/float_out_of_range.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Identifies `Float` literals which are, like, really really really
# really really really really really big. Too big. No-one needs Floats
# that big. If you need a float that big, something is wrong with you.
#
# @... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/to_enum_arguments.rb | lib/rubocop/cop/lint/to_enum_arguments.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Ensures that `to_enum`/`enum_for`, called for the current method,
# has correct arguments.
#
# @example
# # bad
# def foo(x, y = 1)
# return to_enum(__callee__, x) # `y` is missing
# en... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/self_assignment.rb | lib/rubocop/cop/lint/self_assignment.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for self-assignments.
#
# @example
# # bad
# foo = foo
# foo, bar = foo, bar
# Foo = Foo
# hash['foo'] = hash['foo']
# obj.attr = obj.attr
#
# # good
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/deprecated_class_methods.rb | lib/rubocop/cop/lint/deprecated_class_methods.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for uses of the deprecated class method usages.
#
# @example
#
# # bad
# File.exists?(some_path)
# Dir.exists?(some_path)
# iterator?
# attr :name, true
# attr :nam... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_elsif_condition.rb | lib/rubocop/cop/lint/duplicate_elsif_condition.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks that there are no repeated conditions used in if 'elsif'.
#
# @example
# # bad
# if x == 1
# do_something
# elsif x == 1
# do_something_else
# end
#
# #... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/missing_super.rb | lib/rubocop/cop/lint/missing_super.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of constructors and lifecycle callbacks
# without calls to `super`.
#
# This cop does not consider `method_missing` (and `respond_to_missing?`)
# because in some cases it makes sense to ove... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/number_conversion.rb | lib/rubocop/cop/lint/number_conversion.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Warns the usage of unsafe number conversions. Unsafe
# number conversion can cause unexpected error if auto type conversion
# fails. Cop prefer parsing with number class instead.
#
# Conversion with `Integer`, `Fl... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb | lib/rubocop/cop/lint/duplicate_regexp_character_class_element.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for duplicate elements in `Regexp` character classes.
#
# @example
#
# # bad
# r = /[xyx]/
#
# # bad
# r = /[0-9x0-9]/
#
# # good
# r = /[xy]/
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/deprecated_constants.rb | lib/rubocop/cop/lint/deprecated_constants.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for deprecated constants.
#
# It has `DeprecatedConstants` config. If there is an alternative method, you can set
# alternative value as `Alternative`. And you can set the deprecated version as
# `Deprecate... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_rescue_exception.rb | lib/rubocop/cop/lint/duplicate_rescue_exception.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks that there are no repeated exceptions
# used in 'rescue' expressions.
#
# @example
# # bad
# begin
# something
# rescue FirstException
# handle_exception
# resc... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/constant_resolution.rb | lib/rubocop/cop/lint/constant_resolution.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Check that certain constants are fully qualified.
#
# This is not enabled by default because it would mark a lot of offenses
# unnecessarily.
#
# Generally, gems should fully qualify all constants to avoid c... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/lambda_without_literal_block.rb | lib/rubocop/cop/lint/lambda_without_literal_block.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks uses of lambda without a literal block.
# It emulates the following warning in Ruby 3.0:
#
# $ ruby -vwe 'lambda(&proc {})'
# ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [x86_64-darwin19]
# -e... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/ambiguous_block_association.rb | lib/rubocop/cop/lint/ambiguous_block_association.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for ambiguous block association with method
# when param passed without parentheses.
#
# This cop can customize allowed methods with `AllowedMethods`.
# By default, there are no methods to allowed.
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/format_parameter_mismatch.rb | lib/rubocop/cop/lint/format_parameter_mismatch.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# This lint sees if there is a mismatch between the number of
# expected fields for format/sprintf/#% and what is actually
# passed as arguments.
#
# In addition, it checks whether different formats are used in the ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_conditional_body.rb | lib/rubocop/cop/lint/empty_conditional_body.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of `if`, `elsif` and `unless` branches without a body.
#
# NOTE: empty `else` branches are handled by `Style/EmptyElse`.
#
# @example
# # bad
# if condition
# end
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/erb_new_arguments.rb | lib/rubocop/cop/lint/erb_new_arguments.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Emulates the following Ruby warnings in Ruby 2.6.
#
# [source,console]
# ----
# $ cat example.rb
# ERB.new('hi', nil, '-', '@output_buffer')
# $ ruby -rerb example.rb
# example.rb:1: warning: Pas... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/multiple_comparison.rb | lib/rubocop/cop/lint/multiple_comparison.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# In math and Python, we can use `x < y < z` style comparison to compare
# multiple value. However, we can't use the comparison in Ruby. However,
# the comparison is not syntax error. This cop checks the bad usage of
# co... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/interpolation_check.rb | lib/rubocop/cop/lint/interpolation_check.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for interpolation in a single quoted string.
#
# @safety
# This cop's autocorrection is unsafe because although it always replaces single quotes as
# if it were miswritten double quotes, it is not alway... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/unused_method_argument.rb | lib/rubocop/cop/lint/unused_method_argument.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for unused method arguments.
#
# @example
# # bad
# def some_method(used, unused, _unused_but_allowed)
# puts used
# end
#
# # good
# def some_method(used, _unuse... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/shadowed_argument.rb | lib/rubocop/cop/lint/shadowed_argument.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for shadowed arguments.
#
# This cop has `IgnoreImplicitReferences` configuration option.
# It means argument shadowing is used in order to pass parameters
# to zero arity `super` when `IgnoreImplicitRefere... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/ensure_return.rb | lib/rubocop/cop/lint/ensure_return.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `return` from an `ensure` block.
# `return` from an ensure block is a dangerous code smell as it
# will take precedence over any exception being raised,
# and the exception will be silently thrown away as if ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/mixed_case_range.rb | lib/rubocop/cop/lint/mixed_case_range.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for mixed-case character ranges since they include likely unintended characters.
#
# Offenses are registered for regexp character classes like `/[A-z]/`
# as well as range objects like `('A'..'z')`.
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_dir_glob_sort.rb | lib/rubocop/cop/lint/redundant_dir_glob_sort.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Sort globbed results by default in Ruby 3.0.
# This cop checks for redundant `sort` method to `Dir.glob` and `Dir[]`.
#
# @safety
# This cop is unsafe, in case of having a file and a directory with
# ide... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/debugger.rb | lib/rubocop/cop/lint/debugger.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for debug calls (such as `debugger` or `binding.pry`) that should
# not be kept for production code.
#
# The cop can be configured using `DebuggerMethods`. By default, a number of gems
# debug entrypoints a... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_class.rb | lib/rubocop/cop/lint/empty_class.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for classes and metaclasses without a body.
# Such empty classes and metaclasses are typically an oversight or we should provide a comment
# to be clearer what we're aiming for.
#
# @example
# # bad... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/require_relative_self_path.rb | lib/rubocop/cop/lint/require_relative_self_path.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for uses a file requiring itself with `require_relative`.
#
# @example
#
# # bad
#
# # foo.rb
# require_relative 'foo'
# require_relative 'bar'
#
# # good
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_method_definition.rb | lib/rubocop/cop/lint/useless_method_definition.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for useless method definitions, specifically: empty constructors
# and methods just delegating to `super`.
#
# @safety
# This cop is unsafe as it can register false positives for cases when an empty
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/script_permission.rb | lib/rubocop/cop/lint/script_permission.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks if a file which has a shebang line as
# its first line is granted execute permission.
#
# @example
# # bad
#
# # A file which has a shebang line as its first line is not
# # granted ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_methods.rb | lib/rubocop/cop/lint/duplicate_methods.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for duplicated instance (or singleton) method
# definitions.
#
# NOTE: Aliasing a method to itself is allowed, as it indicates that
# the developer intends to suppress Ruby's method redefinition warnings.
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_block.rb | lib/rubocop/cop/lint/empty_block.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for blocks without a body.
# Such empty blocks are typically an oversight or we should provide a comment
# to clarify what we're aiming for.
#
# Empty lambdas and procs are ignored by default.
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/ambiguous_operator_precedence.rb | lib/rubocop/cop/lint/ambiguous_operator_precedence.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Looks for expressions containing multiple binary operators
# where precedence is ambiguous due to lack of parentheses. For example,
# in `1 + 2 * 3`, the multiplication will happen before the addition, but
# lexically i... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_ruby2_keywords.rb | lib/rubocop/cop/lint/useless_ruby2_keywords.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Looks for `ruby2_keywords` calls for methods that do not need it.
#
# `ruby2_keywords` should only be called on methods that accept an argument splat
# (`\*args`) but do not explicit keyword arguments (`k:` or `k: true`... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_with_index.rb | lib/rubocop/cop/lint/redundant_with_index.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for redundant `with_index`.
#
# @example
# # bad
# ary.each_with_index do |v|
# v
# end
#
# # good
# ary.each do |v|
# v
# end
#
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/top_level_return_with_argument.rb | lib/rubocop/cop/lint/top_level_return_with_argument.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for top level return with arguments. If there is a
# top-level return statement with an argument, then the argument is
# always ignored. This is detected automatically since Ruby 2.7.
#
# @example
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/ineffective_access_modifier.rb | lib/rubocop/cop/lint/ineffective_access_modifier.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `private` or `protected` access modifiers which are
# applied to a singleton method. These access modifiers do not make
# singleton methods private/protected. `private_class_method` can be
# used for that.
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/rescue_exception.rb | lib/rubocop/cop/lint/rescue_exception.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `rescue` blocks targeting the `Exception` class.
#
# @example
#
# # bad
# begin
# do_something
# rescue Exception
# handle_exception
# end
#
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_set_element.rb | lib/rubocop/cop/lint/duplicate_set_element.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for duplicate literal, constant, or variable elements in `Set` and `SortedSet`.
#
# @example
#
# # bad
# Set[:foo, :bar, :foo]
#
# # good
# Set[:foo, :bar]
#
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_safe_navigation.rb | lib/rubocop/cop/lint/redundant_safe_navigation.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for redundant safe navigation calls.
# Use cases where a constant, named in camel case for classes and modules is `nil` are rare,
# and an offense is not detected when the receiver is a constant. The detection also app... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_expression.rb | lib/rubocop/cop/lint/empty_expression.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of empty expressions.
#
# @example
#
# # bad
#
# foo = ()
# if ()
# bar
# end
#
# # good
#
# foo = (some_expression)
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/flip_flop.rb | lib/rubocop/cop/lint/flip_flop.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Looks for uses of flip-flop operator
# based on the Ruby Style Guide.
#
# Here is the history of flip-flops in Ruby.
# flip-flop operator is deprecated in Ruby 2.6.0 and
# the deprecation has been reverted b... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_defined.rb | lib/rubocop/cop/lint/useless_defined.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for calls to `defined?` with strings or symbols as the argument.
# Such calls will always return `'expression'`, you probably meant to
# check for the existence of a constant, method, or variable instead.
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_with_object.rb | lib/rubocop/cop/lint/redundant_with_object.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for redundant `with_object`.
#
# @example
# # bad
# ary.each_with_object([]) do |v|
# v
# end
#
# # good
# ary.each do |v|
# v
# end
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_cop_enable_directive.rb | lib/rubocop/cop/lint/redundant_cop_enable_directive.rb | # frozen_string_literal: true
# The Lint/RedundantCopEnableDirective and Lint/RedundantCopDisableDirective
# cops need to be disabled so as to be able to provide a (bad) example of an
# unneeded enable.
# rubocop:disable Lint/RedundantCopEnableDirective
# rubocop:disable Lint/RedundantCopDisableDirective
module RuboC... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb | lib/rubocop/cop/lint/unescaped_bracket_in_regexp.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for Regexpes (both literals and via `Regexp.new` / `Regexp.compile`)
# that contain unescaped `]` characters.
#
# It emulates the following Ruby warning:
#
# [source,ruby]
# ----
# $ ruby ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/ambiguous_assignment.rb | lib/rubocop/cop/lint/ambiguous_assignment.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for mistyped shorthand assignments.
#
# @example
# # bad
# x =- y
# x =+ y
# x =* y
# x =! y
#
# # good
# x -= y # or x = -y
# x += y # or x = +y
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_default_value_argument.rb | lib/rubocop/cop/lint/useless_default_value_argument.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for usage of method `fetch` or `Array.new` with default value argument
# and block. In such cases, block will always be used as default value.
#
# This cop emulates Ruby warning "block supersedes default value ar... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb | lib/rubocop/cop/lint/no_return_in_begin_end_blocks.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of a `return` inside a `begin..end` block
# in assignment contexts.
# In this situation, the `return` will result in an exit from the current
# method, possibly leading to unexpected behavior.
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/rescue_type.rb | lib/rubocop/cop/lint/rescue_type.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for arguments to `rescue` that will result in a `TypeError`
# if an exception is raised.
#
# @example
# # bad
# begin
# bar
# rescue nil
# baz
# end
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_constant_scoping.rb | lib/rubocop/cop/lint/useless_constant_scoping.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for useless constant scoping. Private constants must be defined using
# `private_constant`. Even if `private` access modifier is used, it is public scope despite
# its appearance.
#
# It does not support au... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/non_atomic_file_operation.rb | lib/rubocop/cop/lint/non_atomic_file_operation.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for non-atomic file operation.
# And then replace it with a nearly equivalent and atomic method.
#
# These can cause problems that are difficult to reproduce,
# especially in cases of frequent file operatio... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_when.rb | lib/rubocop/cop/lint/empty_when.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of `when` branches without a body.
#
# @example
#
# # bad
# case foo
# when bar
# do_something
# when baz
# end
#
# # good
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/loop.rb | lib/rubocop/cop/lint/loop.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for uses of `begin...end while/until something`.
#
# @safety
# The cop is unsafe because behavior can change in some cases, including
# if a local variable inside the loop body is accessed outside of it... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/float_comparison.rb | lib/rubocop/cop/lint/float_comparison.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of precise comparison of floating point numbers.
#
# Floating point values are inherently inaccurate, and comparing them for exact equality
# is almost never the desired semantics. Comparison via... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_match_pattern.rb | lib/rubocop/cop/lint/duplicate_match_pattern.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks that there are no repeated patterns used in `in` keywords.
#
# @example
#
# # bad
# case x
# in 'first'
# do_something
# in 'first'
# do_something_else
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb | lib/rubocop/cop/lint/constant_overwritten_in_rescue.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for overwriting an exception with an exception result by use ``rescue =>``.
#
# You intended to write as `rescue StandardError`.
# However, you have written `rescue => StandardError`.
# In that case, the re... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/safe_navigation_chain.rb | lib/rubocop/cop/lint/safe_navigation_chain.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# The safe navigation operator returns nil if the receiver is
# nil. If you chain an ordinary method call after a safe
# navigation operator, it raises NoMethodError. We should use a
# safe navigation operator after a saf... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_require_statement.rb | lib/rubocop/cop/lint/redundant_require_statement.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for unnecessary `require` statement.
#
# The following features are unnecessary `require` statement because
# they are already loaded. e.g. Ruby 2.2:
#
# ruby -ve 'p $LOADED_FEATURES.reject { |featu... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/unexpected_block_arity.rb | lib/rubocop/cop/lint/unexpected_block_arity.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for a block that is known to need more positional
# block arguments than are given (by default this is configured for
# `Enumerable` methods needing 2 arguments). Optional arguments are allowed,
# although they d... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/array_literal_in_regexp.rb | lib/rubocop/cop/lint/array_literal_in_regexp.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for an array literal interpolated inside a regexp.
#
# When interpolating an array literal, it is converted to a string. This means
# that when inside a regexp, it acts as a character class but with additional
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/struct_new_override.rb | lib/rubocop/cop/lint/struct_new_override.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks unexpected overrides of the `Struct` built-in methods
# via `Struct.new`.
#
# @example
# # bad
# Bad = Struct.new(:members, :clone, :count)
# b = Bad.new([], true, 1)
# b.members #... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb | lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for places where binary operator has identical operands.
#
# It covers comparison operators: `==`, `===`, `=~`, `>`, `>=`, `<`, ``<=``;
# bitwise operators: `|`, `^`, `&`;
# boolean operators: `&&`, `||`
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_or.rb | lib/rubocop/cop/lint/useless_or.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for useless OR (`||` and `or`) expressions.
#
# Some methods always return a truthy value, even when called
# on `nil` (e.g. `nil.to_i` evaluates to `0`). Therefore, OR expressions
# appended after these me... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/constant_reassignment.rb | lib/rubocop/cop/lint/constant_reassignment.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for constant reassignments.
#
# Emulates Ruby's runtime warning "already initialized constant X"
# when a constant is reassigned in the same file and namespace using the
# `NAME = value` syntax.
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/boolean_symbol.rb | lib/rubocop/cop/lint/boolean_symbol.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `:true` and `:false` symbols.
# In most cases it would be a typo.
#
# @safety
# Autocorrection is unsafe for this cop because code relying
# on `:true` or `:false` symbols will break when thos... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb | lib/rubocop/cop/lint/incompatible_io_select_with_fiber_scheduler.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `IO.select` that is incompatible with Fiber Scheduler since Ruby 3.0.
#
# When an array of IO objects waiting for an exception (the third argument of `IO.select`)
# is used as an argument, there is no alterna... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/suppressed_exception.rb | lib/rubocop/cop/lint/suppressed_exception.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `rescue` blocks with no body.
#
# @example
#
# # bad
# def some_method
# do_something
# rescue
# end
#
# # bad
# begin
# do_something
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/safe_navigation_with_empty.rb | lib/rubocop/cop/lint/safe_navigation_with_empty.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks to make sure safe navigation isn't used with `empty?` in
# a conditional.
#
# While the safe navigation operator is generally a good idea, when
# checking `foo&.empty?` in a conditional, `foo` being `nil` w... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb | lib/rubocop/cop/lint/hash_new_with_keyword_arguments_as_default.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the deprecated use of keyword arguments as a default in `Hash.new`.
#
# This usage raises a warning in Ruby 3.3 and results in an error in Ruby 3.4.
# In Ruby 3.4, keyword arguments will instead be used to ch... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/literal_in_interpolation.rb | lib/rubocop/cop/lint/literal_in_interpolation.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for interpolated literals.
#
# NOTE: Array literals interpolated in regexps are not handled by this cop, but
# by `Lint/ArrayLiteralInRegexp` instead.
#
# @example
#
# # bad
# "r... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_in_pattern.rb | lib/rubocop/cop/lint/empty_in_pattern.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the presence of `in` pattern branches without a body.
#
# @example
#
# # bad
# case condition
# in [a]
# do_something
# in [a, b]
# end
#
# # go... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/ambiguous_operator.rb | lib/rubocop/cop/lint/ambiguous_operator.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for ambiguous operators in the first argument of a
# method invocation without parentheses.
#
# @example
#
# # bad
#
# # The `*` is interpreted as a splat operator but it could possibl... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/cop_directive_syntax.rb | lib/rubocop/cop/lint/cop_directive_syntax.rb | # frozen_string_literal: true
# rubocop:disable Lint/RedundantCopDisableDirective
# rubocop:disable Style/DoubleCopDisableDirective
module RuboCop
module Cop
module Lint
# Checks that `# rubocop:enable ...` and `# rubocop:disable ...` statements
# are strictly formatted.
#
# A comment can... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/percent_string_array.rb | lib/rubocop/cop/lint/percent_string_array.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for quotes and commas in %w, e.g. `%w('foo', "bar")`
#
# It is more likely that the additional characters are unintended (for
# example, mistranslating an array of literals to percent string notation)
# rat... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/raise_exception.rb | lib/rubocop/cop/lint/raise_exception.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `raise` or `fail` statements which raise `Exception` or
# `Exception.new`. Use `StandardError` or a specific exception class instead.
#
# If you have defined your own namespaced `Exception` class, it is possi... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/uri_regexp.rb | lib/rubocop/cop/lint/uri_regexp.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Identifies places where `URI.regexp` is obsolete and should not be used.
#
# For Ruby 3.3 or lower, use `URI::DEFAULT_PARSER.make_regexp`.
# For Ruby 3.4 or higher, use `URI::RFC2396_PARSER.make_regexp`.
#
#... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_require.rb | lib/rubocop/cop/lint/duplicate_require.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for duplicate ``require``s and ``require_relative``s.
#
# @safety
# This cop's autocorrection is unsafe because it may break the dependency order
# of `require`.
#
# @example
# # bad... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb | lib/rubocop/cop/lint/unmodified_reduce_accumulator.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Looks for `reduce` or `inject` blocks where the value returned (implicitly or
# explicitly) does not include the accumulator. A block is considered valid as
# long as at least one return value includes the accumulator.
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/return_in_void_context.rb | lib/rubocop/cop/lint/return_in_void_context.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for the use of a return with a value in a context
# where the value will be ignored. (initialize and setter methods)
#
# @example
#
# # bad
# def initialize
# foo
# retur... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb | lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for underscore-prefixed variables that are actually
# used.
#
# Since block keyword arguments cannot be arbitrarily named at call
# sites, the `AllowKeywordBlockArguments` will allow use of underscore-
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb | lib/rubocop/cop/lint/redundant_regexp_quantifiers.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for redundant quantifiers inside `Regexp` literals.
#
# It is always allowed when interpolation is used in a regexp literal,
# because it's unknown what kind of string will be expanded as a result:
#
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/shared_mutable_default.rb | lib/rubocop/cop/lint/shared_mutable_default.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `Hash` creation with a mutable default value.
# Creating a `Hash` in such a way will share the default value
# across all keys, causing unexpected behavior when modifying it.
#
# For example, when the `... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_rescue.rb | lib/rubocop/cop/lint/useless_rescue.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for useless ``rescue``s, which only reraise rescued exceptions.
#
# @example
# # bad
# def foo
# do_something
# rescue
# raise
# end
#
# # bad
# ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/empty_interpolation.rb | lib/rubocop/cop/lint/empty_interpolation.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for empty interpolation.
#
# @example
#
# # bad
# "result is #{}"
#
# # good
# "result is #{some_result}"
class EmptyInterpolation < Base
include Interpolation
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/rand_one.rb | lib/rubocop/cop/lint/rand_one.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for `rand(1)` calls.
# Such calls always return `0`.
#
# @example
#
# # bad
# rand 1
# Kernel.rand(-1)
# rand 1.0
# rand(-1.0)
#
# # good
# 0 # ... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/out_of_range_regexp_ref.rb | lib/rubocop/cop/lint/out_of_range_regexp_ref.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Looks for references of `Regexp` captures that are out of range
# and thus always returns nil.
#
# @safety
# This cop is unsafe because it is naive in how it determines what
# references are available ba... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/nested_percent_literal.rb | lib/rubocop/cop/lint/nested_percent_literal.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for nested percent literals.
#
# @example
#
# # bad
#
# # The percent literal for nested_attributes is parsed as four tokens,
# # yielding the array [:name, :content, :"%i[incorrectl... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/useless_else_without_rescue.rb | lib/rubocop/cop/lint/useless_else_without_rescue.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for useless `else` in `begin..end` without `rescue`.
#
# NOTE: This syntax is no longer valid on Ruby 2.6 or higher.
#
# @example
#
# # bad
# begin
# do_something
# e... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/duplicate_magic_comment.rb | lib/rubocop/cop/lint/duplicate_magic_comment.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for duplicated magic comments.
#
# @example
#
# # bad
#
# # encoding: ascii
# # encoding: ascii
#
# # good
#
# # encoding: ascii
#
# # bad
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
rubocop/rubocop | https://github.com/rubocop/rubocop/blob/99fa0fdd0481910d7d052f4c2ed01ad36178f404/lib/rubocop/cop/lint/unreachable_code.rb | lib/rubocop/cop/lint/unreachable_code.rb | # frozen_string_literal: true
module RuboCop
module Cop
module Lint
# Checks for unreachable code.
# The check are based on the presence of flow of control
# statement in non-final position in `begin` (implicit) blocks.
#
# @example
#
# # bad
# def some_method
... | ruby | MIT | 99fa0fdd0481910d7d052f4c2ed01ad36178f404 | 2026-01-04T15:37:41.211519Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.