# typed: true # DO NOT EDIT MANUALLY # This is an autogenerated file for types exported from the `rubocop` gem. # Please instead update this file by running `bin/tapioca gem rubocop`. # source://rubocop//lib/rubocop/version.rb#3 module RuboCop; end class RuboCop::AST::ProcessedSource include ::RuboCop::Ext::ProcessedSource end class RuboCop::AST::RegexpNode < ::RuboCop::AST::Node include ::RuboCop::Ext::RegexpNode end # The CLI is a class responsible of handling all the command line interface # logic. # # source://rubocop//lib/rubocop/cli.rb#6 class RuboCop::CLI # @return [CLI] a new instance of CLI # # source://rubocop//lib/rubocop/cli.rb#16 def initialize; end # Returns the value of attribute config_store. # # source://rubocop//lib/rubocop/cli.rb#14 def config_store; end # Returns the value of attribute options. # # source://rubocop//lib/rubocop/cli.rb#14 def options; end # Entry point for the application logic. Here we # do the command line arguments processing and inspect # the target files. # # # @api public # @param args [Array] command line arguments # @return [Integer] UNIX exit code # # source://rubocop//lib/rubocop/cli.rb#31 def run(args = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cli.rb#85 def act_on_options; end # source://rubocop//lib/rubocop/cli.rb#117 def apply_default_formatter; end # source://rubocop//lib/rubocop/cli.rb#68 def execute_runners; end # @raise [Finished] # # source://rubocop//lib/rubocop/cli.rb#109 def handle_exiting_options; end # source://rubocop//lib/rubocop/cli.rb#64 def run_command(name); end # source://rubocop//lib/rubocop/cli.rb#102 def set_options_to_config_loader; end # source://rubocop//lib/rubocop/cli.rb#76 def validate_options_vs_config; end end # Home of subcommands in the CLI. # # @api private # # source://rubocop//lib/rubocop/cli/command.rb#7 module RuboCop::CLI::Command class << self # Find the command with a given name and run it in an environment. # # @api private # # source://rubocop//lib/rubocop/cli/command.rb#10 def run(env, name); end private # @api private # # source://rubocop//lib/rubocop/cli/command.rb#16 def class_for(name); end end end # Generate a configuration file acting as a TODO list. # # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#8 class RuboCop::CLI::Command::AutoGenerateConfig < ::RuboCop::CLI::Command::Base # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#21 def run; end private # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#97 def add_formatter; end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#106 def add_inheritance_from_auto_generated_file(config_file); end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#102 def execute_runner; end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#126 def existing_configuration(config_file); end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#59 def line_length_cop(config); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#47 def line_length_enabled?(config); end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#55 def max_line_length(config); end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#30 def maybe_run_line_length_cop; end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#90 def reset_config_and_auto_gen_file; end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#79 def run_all_cops(line_length_contents); end # Do an initial run with only Layout/LineLength so that cops that # depend on Layout/LineLength:Max get the correct value for that # parameter. # # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#66 def run_line_length_cop; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#51 def same_max_line_length?(config1, config2); end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#42 def skip_line_length_cop(reason); end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#132 def write_config_file(file_name, file_string, rubocop_yml_contents); end end # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#11 RuboCop::CLI::Command::AutoGenerateConfig::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#13 RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1 = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#18 RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_DISABLED = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#16 RuboCop::CLI::Command::AutoGenerateConfig::PHASE_1_OVERRIDDEN = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/cli/command/auto_genenerate_config.rb#14 RuboCop::CLI::Command::AutoGenerateConfig::PHASE_2 = T.let(T.unsafe(nil), String) # A subcommand in the CLI. # # @api private # # source://rubocop//lib/rubocop/cli/command/base.rb#8 class RuboCop::CLI::Command::Base # @api private # @return [Base] a new instance of Base # # source://rubocop//lib/rubocop/cli/command/base.rb#26 def initialize(env); end # @api private # # source://rubocop//lib/rubocop/cli/command/base.rb#9 def env; end class << self # @api private # # source://rubocop//lib/rubocop/cli/command/base.rb#21 def by_command_name(name); end # @api private # # source://rubocop//lib/rubocop/cli/command/base.rb#14 def command_name; end # @api private # # source://rubocop//lib/rubocop/cli/command/base.rb#14 def command_name=(_arg0); end # @api private # @private # # source://rubocop//lib/rubocop/cli/command/base.rb#16 def inherited(subclass); end end end # Run all the selected cops and report the result. # # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#8 class RuboCop::CLI::Command::ExecuteRunner < ::RuboCop::CLI::Command::Base include ::RuboCop::Formatter::TextUtil # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#16 def run; end private # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#49 def display_error_summary(errors); end # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#41 def display_warning_summary(warnings); end # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#22 def execute_runner(paths); end # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#66 def maybe_print_corrected_source; end end # Combination of short and long formatter names. # # @api private # # source://rubocop//lib/rubocop/cli/command/execute_runner.rb#12 RuboCop::CLI::Command::ExecuteRunner::INTEGRATION_FORMATTERS = T.let(T.unsafe(nil), Array) # Generate a .rubocop.yml file in the current directory. # # @api private # # source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#8 class RuboCop::CLI::Command::InitDotfile < ::RuboCop::CLI::Command::Base # @api private # # source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#13 def run; end end # @api private # # source://rubocop//lib/rubocop/cli/command/init_dotfile.rb#9 RuboCop::CLI::Command::InitDotfile::DOTFILE = T.let(T.unsafe(nil), String) # Shows the given cops, or all cops by default, and their configurations # for the current directory. # # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#9 class RuboCop::CLI::Command::ShowCops < ::RuboCop::CLI::Command::Base # @api private # @return [ShowCops] a new instance of ShowCops # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#12 def initialize(env); end # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#19 def run; end private # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#70 def config_lines(cop); end # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#66 def cops_of_department(cops, department); end # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#25 def print_available_cops; end # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#51 def print_cop_details(cops); end # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#39 def print_cops_of_department(registry, department, show_all); end # @api private # # source://rubocop//lib/rubocop/cli/command/show_cops.rb#60 def selected_cops_of_department(cops, department); end end # Display version. # # @api private # # source://rubocop//lib/rubocop/cli/command/version.rb#8 class RuboCop::CLI::Command::Version < ::RuboCop::CLI::Command::Base # @api private # # source://rubocop//lib/rubocop/cli/command/version.rb#11 def run; end end # Execution environment for a CLI command. # # @api private # # source://rubocop//lib/rubocop/cli/environment.rb#7 class RuboCop::CLI::Environment # @api private # @return [Environment] a new instance of Environment # # source://rubocop//lib/rubocop/cli/environment.rb#10 def initialize(options, config_store, paths); end # @api private # # source://rubocop//lib/rubocop/cli/environment.rb#8 def config_store; end # @api private # # source://rubocop//lib/rubocop/cli/environment.rb#8 def options; end # @api private # # source://rubocop//lib/rubocop/cli/environment.rb#8 def paths; end # Run a command in this environment. # # @api private # # source://rubocop//lib/rubocop/cli/environment.rb#17 def run(name); end end # source://rubocop//lib/rubocop/cli.rb#12 class RuboCop::CLI::Finished < ::RuntimeError; end # source://rubocop//lib/rubocop/cli.rb#9 RuboCop::CLI::STATUS_ERROR = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cli.rb#10 RuboCop::CLI::STATUS_INTERRUPTED = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cli.rb#8 RuboCop::CLI::STATUS_OFFENSES = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cli.rb#7 RuboCop::CLI::STATUS_SUCCESS = T.let(T.unsafe(nil), Integer) # Converts RuboCop objects to and from the serialization format JSON. # # @api private # # source://rubocop//lib/rubocop/cached_data.rb#8 class RuboCop::CachedData # @api private # @return [CachedData] a new instance of CachedData # # source://rubocop//lib/rubocop/cached_data.rb#9 def initialize(filename); end # @api private # # source://rubocop//lib/rubocop/cached_data.rb#13 def from_json(text); end # @api private # # source://rubocop//lib/rubocop/cached_data.rb#17 def to_json(offenses); end private # Restore an offense object loaded from a JSON file. # # @api private # # source://rubocop//lib/rubocop/cached_data.rb#47 def deserialize_offenses(offenses); end # @api private # # source://rubocop//lib/rubocop/cached_data.rb#40 def message(offense); end # @api private # # source://rubocop//lib/rubocop/cached_data.rb#23 def serialize_offense(offense); end end # and provides a way to check if each cop is enabled at arbitrary line. # # source://rubocop//lib/rubocop/comment_config.rb#6 class RuboCop::CommentConfig # @return [CommentConfig] a new instance of CommentConfig # # source://rubocop//lib/rubocop/comment_config.rb#27 def initialize(processed_source); end # source://rubocop//lib/rubocop/comment_config.rb#39 def cop_disabled_line_ranges; end # @return [Boolean] # # source://rubocop//lib/rubocop/comment_config.rb#31 def cop_enabled_at_line?(cop, line_number); end # source://rubocop//lib/rubocop/comment_config.rb#43 def extra_enabled_comments; end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/comment_config.rb#25 def processed_source; end private # source://rubocop//lib/rubocop/comment_config.rb#165 def all_cop_names; end # source://rubocop//lib/rubocop/comment_config.rb#66 def analyze; end # source://rubocop//lib/rubocop/comment_config.rb#80 def analyze_cop(analysis, disabled, line, single_line); end # source://rubocop//lib/rubocop/comment_config.rb#97 def analyze_disabled(analysis, line); end # source://rubocop//lib/rubocop/comment_config.rb#107 def analyze_rest(analysis, line); end # source://rubocop//lib/rubocop/comment_config.rb#90 def analyze_single_line(analysis, line, disabled); end # @return [Boolean] # # source://rubocop//lib/rubocop/comment_config.rb#169 def comment_only_line?(line_number); end # source://rubocop//lib/rubocop/comment_config.rb#115 def cop_line_ranges(analysis); end # @return [Boolean] # # source://rubocop//lib/rubocop/comment_config.rb#134 def directive_on_comment_line?(comment); end # source://rubocop//lib/rubocop/comment_config.rb#147 def directive_parts(comment); end # source://rubocop//lib/rubocop/comment_config.rb#138 def each_directive; end # source://rubocop//lib/rubocop/comment_config.rb#121 def each_mentioned_cop; end # @return [Boolean] # # source://rubocop//lib/rubocop/comment_config.rb#182 def enable_all?(comment); end # source://rubocop//lib/rubocop/comment_config.rb#52 def extra_enabled_comments_with_names(extras:, names:); end # source://rubocop//lib/rubocop/comment_config.rb#187 def handle_enable_all(names, extras, comment); end # Collect cops that have been disabled or enabled by name in a directive comment # so that `Lint/RedundantCopEnableDirective` can register offenses correctly. # # source://rubocop//lib/rubocop/comment_config.rb#201 def handle_switch(cop_names, names, disabled, extras, comment); end # source://rubocop//lib/rubocop/comment_config.rb#175 def non_comment_token_line_numbers; end # source://rubocop//lib/rubocop/comment_config.rb#161 def qualified_cop_name(cop_name); end end # @api private # # source://rubocop//lib/rubocop/comment_config.rb#18 RuboCop::CommentConfig::COMMENT_DIRECTIVE_REGEXP = T.let(T.unsafe(nil), Regexp) # @api private # # source://rubocop//lib/rubocop/comment_config.rb#15 RuboCop::CommentConfig::COPS_PATTERN = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/comment_config.rb#13 RuboCop::CommentConfig::COP_NAMES_PATTERN = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/comment_config.rb#11 RuboCop::CommentConfig::COP_NAME_PATTERN = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/comment_config.rb#23 class RuboCop::CommentConfig::CopAnalysis < ::Struct # Returns the value of attribute line_ranges # # @return [Object] the current value of line_ranges def line_ranges; end # Sets the attribute line_ranges # # @param value [Object] the value to set the attribute line_ranges to. # @return [Object] the newly set value def line_ranges=(_); end # Returns the value of attribute start_line_number # # @return [Object] the current value of start_line_number def start_line_number; end # Sets the attribute start_line_number # # @param value [Object] the value to set the attribute start_line_number to. # @return [Object] the newly set value def start_line_number=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # @api private # # source://rubocop//lib/rubocop/comment_config.rb#8 RuboCop::CommentConfig::REDUNDANT_DISABLE = T.let(T.unsafe(nil), String) # This class represents the configuration of the RuboCop application # and all its cops. A Config is associated with a YAML configuration # file from which it was read. Several different Configs can be used # during a run of the rubocop program, if files in several # directories are inspected. # # source://rubocop//lib/rubocop/config.rb#14 class RuboCop::Config include ::RuboCop::PathUtil include ::RuboCop::FileFinder extend ::Forwardable # @return [Config] a new instance of Config # # source://rubocop//lib/rubocop/config.rb#24 def initialize(hash = T.unsafe(nil), loaded_path = T.unsafe(nil)); end def [](*args, **_arg1, &block); end def []=(*args, **_arg1, &block); end # source://rubocop//lib/rubocop/config.rb#84 def add_excludes_from_higher_level(highest_config); end # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#165 def allowed_camel_case_file?(file); end # Paths specified in configuration files starting with .rubocop are # relative to the directory where that file is. Paths in other config files # are relative to the current directory. This is so that paths in # config/default.yml, for example, are not relative to RuboCop's config # directory since that wouldn't work. # # source://rubocop//lib/rubocop/config.rb#212 def base_dir_for_path_parameters; end # source://rubocop//lib/rubocop/config.rb#237 def bundler_lock_file_path; end # source://rubocop//lib/rubocop/config.rb#40 def check; end def delete(*args, **_arg1, &block); end # source://rubocop//lib/rubocop/config.rb#96 def deprecation_check; end # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#136 def disabled_new_cops?; end def each(*args, **_arg1, &block); end def each_key(*args, **_arg1, &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#140 def enabled_new_cops?; end def fetch(*args, **_arg1, &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#188 def file_to_exclude?(file); end # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#144 def file_to_include?(file); end # source://rubocop//lib/rubocop/config.rb#132 def for_all_cops; end # Note: the 'Enabled' attribute is same as that returned by `for_cop` # # @return [Config] for the given cop merged with that of its department (if any) # # source://rubocop//lib/rubocop/config.rb#116 def for_badge(badge); end # Note: the 'Enabled' attribute is calculated according to the department's # and 'AllCops' configuration; other attributes are not inherited. # # @return [Config] for the given cop / cop name. # # source://rubocop//lib/rubocop/config.rb#110 def for_cop(cop); end # Note: the 'Enabled' attribute will be present only if specified # at the department's level # # @return [Config] for the given department name. # # source://rubocop//lib/rubocop/config.rb#125 def for_department(department_name); end # True if this is a config file that is shipped with RuboCop # # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#62 def internal?; end def key?(*args, **_arg1, &block); end def keys(*args, **_arg1, &block); end # Returns the value of attribute loaded_path. # # source://rubocop//lib/rubocop/config.rb#22 def loaded_path; end # source://rubocop//lib/rubocop/config.rb#68 def make_excludes_absolute; end def map(*args, **_arg1, &block); end def merge(*args, **_arg1, &block); end # source://rubocop//lib/rubocop/config.rb#203 def path_relative_to_config(path); end # source://rubocop//lib/rubocop/config.rb#199 def patterns_to_exclude; end # source://rubocop//lib/rubocop/config.rb#195 def patterns_to_include; end # source://rubocop//lib/rubocop/config.rb#248 def pending_cops; end # Returns true if there's a chance that an Include pattern matches hidden # files, false if that's definitely not possible. # # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#180 def possibly_include_hidden?; end # source://rubocop//lib/rubocop/config.rb#57 def signature; end # source://rubocop//lib/rubocop/config.rb#233 def smart_loaded_path; end # source://rubocop//lib/rubocop/config.rb#222 def target_rails_version; end def target_ruby_version(*args, **_arg1, &block); end def to_h(*args, **_arg1, &block); end def to_hash(*args, **_arg1, &block); end # source://rubocop//lib/rubocop/config.rb#53 def to_s; end def transform_values(*args, **_arg1, &block); end def validate(*args, **_arg1, &block); end private # source://rubocop//lib/rubocop/config.rb#290 def department_of(qualified_cop_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/config.rb#279 def enable_cop?(qualified_cop_name, cop_options); end # source://rubocop//lib/rubocop/config.rb#267 def read_rails_version_from_bundler_lock_file; end # source://rubocop//lib/rubocop/config.rb#262 def target_rails_version_from_bundler_lock_file; end class << self # source://rubocop//lib/rubocop/config.rb#36 def create(hash, path); end end end # source://rubocop//lib/rubocop/config.rb#19 class RuboCop::Config::CopConfig < ::Struct # Returns the value of attribute metadata # # @return [Object] the current value of metadata def metadata; end # Sets the attribute metadata # # @param value [Object] the value to set the attribute metadata to. # @return [Object] the newly set value def metadata=(_); end # Returns the value of attribute name # # @return [Object] the current value of name def name; end # Sets the attribute name # # @param value [Object] the value to set the attribute name to. # @return [Object] the newly set value def name=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # source://rubocop//lib/rubocop/config.rb#21 RuboCop::Config::DEFAULT_RAILS_VERSION = T.let(T.unsafe(nil), Float) # This class represents the configuration of the RuboCop application # and all its cops. A Config is associated with a YAML configuration # file from which it was read. Several different Configs can be used # during a run of the rubocop program, if files in several # directories are inspected. # # source://rubocop//lib/rubocop/config_loader.rb#16 class RuboCop::ConfigLoader extend ::RuboCop::FileFinder class << self # source://rubocop//lib/rubocop/config_loader.rb#120 def add_excludes_from_files(config, config_file); end # source://rubocop//lib/rubocop/config_loader.rb#71 def add_missing_namespaces(path, hash); end # source://rubocop//lib/rubocop/config_loader.rb#32 def clear_options; end # Returns the path of .rubocop.yml searching upwards in the # directory structure starting at the given directory where the # inspected file is. If no .rubocop.yml is found there, the # user's home directory is checked. If there's no .rubocop.yml # there either, the path to the default file is returned. # # source://rubocop//lib/rubocop/config_loader.rb#95 def configuration_file_for(target_dir); end # source://rubocop//lib/rubocop/config_loader.rb#100 def configuration_from_file(config_file); end # Returns the value of attribute debug. # # source://rubocop//lib/rubocop/config_loader.rb#25 def debug; end # Sets the attribute debug # # @param value the value to set the attribute debug to. # # source://rubocop//lib/rubocop/config_loader.rb#25 def debug=(_arg0); end # Returns the value of attribute debug. # # source://rubocop//lib/rubocop/config_loader.rb#25 def debug?; end # source://rubocop//lib/rubocop/config_loader.rb#130 def default_configuration; end # Sets the attribute default_configuration # # @param value the value to set the attribute default_configuration to. # # source://rubocop//lib/rubocop/config_loader.rb#27 def default_configuration=(_arg0); end # Returns the value of attribute disable_pending_cops. # # source://rubocop//lib/rubocop/config_loader.rb#25 def disable_pending_cops; end # Sets the attribute disable_pending_cops # # @param value the value to set the attribute disable_pending_cops to. # # source://rubocop//lib/rubocop/config_loader.rb#25 def disable_pending_cops=(_arg0); end # Returns the value of attribute enable_pending_cops. # # source://rubocop//lib/rubocop/config_loader.rb#25 def enable_pending_cops; end # Sets the attribute enable_pending_cops # # @param value the value to set the attribute enable_pending_cops to. # # source://rubocop//lib/rubocop/config_loader.rb#25 def enable_pending_cops=(_arg0); end # Returns the value of attribute ignore_parent_exclusion. # # source://rubocop//lib/rubocop/config_loader.rb#25 def ignore_parent_exclusion; end # Sets the attribute ignore_parent_exclusion # # @param value the value to set the attribute ignore_parent_exclusion to. # # source://rubocop//lib/rubocop/config_loader.rb#25 def ignore_parent_exclusion=(_arg0); end # Returns the value of attribute ignore_parent_exclusion. # # source://rubocop//lib/rubocop/config_loader.rb#25 def ignore_parent_exclusion?; end # source://rubocop//lib/rubocop/config_loader.rb#37 def load_file(file); end # @raise [TypeError] # # source://rubocop//lib/rubocop/config_loader.rb#56 def load_yaml_configuration(absolute_path); end # Return a recursive merge of two hashes. That is, a normal hash merge, # with the addition that any value that is a hash, and occurs in both # arguments, will also be merged. And so on. # # source://rubocop//lib/rubocop/config_loader.rb#86 def merge(base_hash, derived_hash); end # Merges the given configuration with the default one. # # source://rubocop//lib/rubocop/config_loader.rb#171 def merge_with_default(config, config_file, unset_nil: T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/config_loader.rb#115 def possible_new_cops?(config); end # Returns the path rubocop inferred as the root of the project. No file # searches will go past this directory. # # source://rubocop//lib/rubocop/config_loader.rb#139 def project_root; end # Sets the attribute project_root # # @param value the value to set the attribute project_root to. # # source://rubocop//lib/rubocop/config_loader.rb#27 def project_root=(_arg0); end # source://rubocop//lib/rubocop/config_loader.rb#151 def warn_on_pending_cops(pending_cops); end # source://rubocop//lib/rubocop/config_loader.rb#163 def warn_pending_cop(cop); end private # source://rubocop//lib/rubocop/config_loader.rb#214 def check_duplication(yaml_code, absolute_path); end # source://rubocop//lib/rubocop/config_loader.rb#202 def expand_path(path); end # source://rubocop//lib/rubocop/config_loader.rb#177 def find_project_dotfile(target_dir); end # source://rubocop//lib/rubocop/config_loader.rb#181 def find_project_root; end # source://rubocop//lib/rubocop/config_loader.rb#189 def find_user_dotfile; end # source://rubocop//lib/rubocop/config_loader.rb#196 def find_user_xdg_config; end # Read the specified file, or exit with a friendly, concise message on # stderr. Care is taken to use the standard OS exit code for a "file not # found" error. # # source://rubocop//lib/rubocop/config_loader.rb#234 def read_file(absolute_path); end # source://rubocop//lib/rubocop/config_loader.rb#210 def resolver; end # source://rubocop//lib/rubocop/config_loader.rb#241 def yaml_safe_load(yaml_code, filename); end end end # source://rubocop//lib/rubocop/config_loader.rb#20 RuboCop::ConfigLoader::DEFAULT_FILE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/config_loader.rb#17 RuboCop::ConfigLoader::DOTFILE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/config_loader.rb#19 RuboCop::ConfigLoader::RUBOCOP_HOME = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/config_loader.rb#18 RuboCop::ConfigLoader::XDG_CONFIG = T.let(T.unsafe(nil), String) # A help class for ConfigLoader that handles configuration resolution. # # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#9 class RuboCop::ConfigLoaderResolver # Return a recursive merge of two hashes. That is, a normal hash merge, # with the addition that any value that is a hash, and occurs in both # arguments, will also be merged. And so on. # # # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#87 def merge(base_hash, derived_hash, **opts); end # Merges the given configuration with the default one. If # AllCops:DisabledByDefault is true, it changes the Enabled params so that # only cops from user configuration are enabled. If # AllCops::EnabledByDefault is true, it changes the Enabled params so that # only cops explicitly disabled in user configuration are disabled. # # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#63 def merge_with_default(config, config_file, unset_nil:); end # An `Enabled: true` setting in user configuration for a cop overrides an # `Enabled: false` setting for its department. # # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#107 def override_department_setting_for_cops(base_hash, derived_hash); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#22 def resolve_inheritance(path, hash, file, debug); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#42 def resolve_inheritance_from_gems(hash); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#10 def resolve_requires(path, hash); end private # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#165 def base_configs(path, inherit_from, file); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#152 def determine_inherit_mode(hash, key); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/config_loader_resolver.rb#125 def disabled?(hash, department); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/config_loader_resolver.rb#129 def duplicate_setting?(base_hash, derived_hash, key, inherited_file); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#221 def gem_config_path(gem_name, relative_config_path); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#199 def handle_disabled_by_default(config, new_default_configuration); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#173 def inherited_file(path, inherit_from, file); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/config_loader_resolver.rb#194 def remote_file?(uri); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/config_loader_resolver.rb#158 def should_union?(base_hash, key, inherit_mode); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#217 def transform(config, &block); end # @api private # # source://rubocop//lib/rubocop/config_loader_resolver.rb#138 def warn_on_duplicate_setting(base_hash, derived_hash, key, **opts); end end # Raised when a RuboCop configuration file is not found. # # source://rubocop//lib/rubocop/config_loader.rb#8 class RuboCop::ConfigNotFoundError < ::RuboCop::Error; end # This class handles obsolete configuration. # # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#6 class RuboCop::ConfigObsoletion # @api private # @return [ConfigObsoletion] a new instance of ConfigObsoletion # # source://rubocop//lib/rubocop/config_obsoletion.rb#217 def initialize(config); end # @api private # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_obsoletion.rb#221 def reject_obsolete_cops_and_parameters; end private # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#231 def obsolete_cops; end # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#241 def obsolete_enforced_style; end # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#249 def obsolete_enforced_style_message(cop, param, enforced_style, alternative); end # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#265 def obsolete_parameter_message(cops, parameters, alternative); end # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#258 def obsolete_parameters; end # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#279 def smart_loaded_path; end end # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#47 RuboCop::ConfigObsoletion::MOVED_COPS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#104 RuboCop::ConfigObsoletion::OBSOLETE_COPS = T.let(T.unsafe(nil), Hash) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#207 RuboCop::ConfigObsoletion::OBSOLETE_ENFORCED_STYLES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#107 RuboCop::ConfigObsoletion::OBSOLETE_PARAMETERS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#63 RuboCop::ConfigObsoletion::REMOVED_COPS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#84 RuboCop::ConfigObsoletion::REMOVED_COPS_WITH_REASON = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#7 RuboCop::ConfigObsoletion::RENAMED_COPS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_obsoletion.rb#98 RuboCop::ConfigObsoletion::SPLIT_COPS = T.let(T.unsafe(nil), Array) # This class handles collecting the options for regenerating a TODO file. # # @api private # # source://rubocop//lib/rubocop/config_regeneration.rb#6 class RuboCop::ConfigRegeneration # Get options from the comment in the TODO file, and parse them as options # # @api private # # source://rubocop//lib/rubocop/config_regeneration.rb#12 def options; end private # @api private # # source://rubocop//lib/rubocop/config_regeneration.rb#29 def generation_command; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/config_regeneration.rb#25 def todo_exists?; end end # @api private # # source://rubocop//lib/rubocop/config_regeneration.rb#7 RuboCop::ConfigRegeneration::AUTO_GENERATED_FILE = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/config_regeneration.rb#8 RuboCop::ConfigRegeneration::COMMAND_REGEX = T.let(T.unsafe(nil), Regexp) # @api private # # source://rubocop//lib/rubocop/config_regeneration.rb#9 RuboCop::ConfigRegeneration::DEFAULT_OPTIONS = T.let(T.unsafe(nil), Hash) # Handles caching of configurations and association of inspected # ruby files to configurations. # # source://rubocop//lib/rubocop/config_store.rb#6 class RuboCop::ConfigStore # @return [ConfigStore] a new instance of ConfigStore # # source://rubocop//lib/rubocop/config_store.rb#7 def initialize; end # If type (file/dir) is known beforehand, # prefer using #for_file or #for_dir for improved performance # # source://rubocop//lib/rubocop/config_store.rb#42 def for(file_or_dir); end # source://rubocop//lib/rubocop/config_store.rb#51 def for_dir(dir); end # source://rubocop//lib/rubocop/config_store.rb#32 def for_file(file); end # source://rubocop//lib/rubocop/config_store.rb#36 def for_pwd; end # source://rubocop//lib/rubocop/config_store.rb#28 def force_default_config!; end # source://rubocop//lib/rubocop/config_store.rb#22 def options_config=(options_config); end end # Handles validation of configuration, for example cop names, parameter # names, and Ruby versions. # # source://rubocop//lib/rubocop/config_validator.rb#8 class RuboCop::ConfigValidator extend ::Forwardable # @return [ConfigValidator] a new instance of ConfigValidator # # source://rubocop//lib/rubocop/config_validator.rb#23 def initialize(config); end def for_all_cops(*args, **_arg1, &block); end def smart_loaded_path(*args, **_arg1, &block); end # source://rubocop//lib/rubocop/config_validator.rb#51 def target_ruby_version; end # source://rubocop//lib/rubocop/config_validator.rb#29 def validate; end # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_validator.rb#55 def validate_section_presence(name); end private # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_validator.rb#86 def alert_about_unrecognized_cops(invalid_cop_names); end # source://rubocop//lib/rubocop/config_validator.rb#201 def check_cop_config_value(hash, parent = T.unsafe(nil)); end # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_validator.rb#66 def check_target_ruby; end # source://rubocop//lib/rubocop/config_validator.rb#142 def each_invalid_parameter(cop_name); end # FIXME: Handling colors in exception messages like this is ugly. # # source://rubocop//lib/rubocop/config_validator.rb#218 def msg_not_boolean(parent, key, value); end # source://rubocop//lib/rubocop/config_validator.rb#189 def reject_conflicting_safe_settings; end # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_validator.rb#180 def reject_mutually_exclusive_defaults; end # Returns the value of attribute target_ruby. # # source://rubocop//lib/rubocop/config_validator.rb#64 def target_ruby; end # source://rubocop//lib/rubocop/config_validator.rb#154 def validate_enforced_styles(valid_cop_names); end # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_validator.rb#115 def validate_new_cops_parameter; end # source://rubocop//lib/rubocop/config_validator.rb#127 def validate_parameter_names(valid_cop_names); end # source://rubocop//lib/rubocop/config_validator.rb#174 def validate_support_and_has_list(name, formats, valid); end # @raise [ValidationError] # # source://rubocop//lib/rubocop/config_validator.rb#103 def validate_syntax_cop; end end # @api private # # source://rubocop//lib/rubocop/config_validator.rb#12 RuboCop::ConfigValidator::COMMON_PARAMS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_validator.rb#15 RuboCop::ConfigValidator::INTERNAL_PARAMS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/config_validator.rb#19 RuboCop::ConfigValidator::NEW_COPS_VALUES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/util.rb#4 module RuboCop::Cop; end # This module checks for nodes that should be aligned to the left or right. # This amount is determined by the instance variable @column_delta. # # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#7 module RuboCop::Cop::Alignment private # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#27 def check_alignment(items, base_column = T.unsafe(nil)); end # Returns the value of attribute column_delta. # # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#12 def column_delta; end # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#14 def configured_indentation_width; end # @api public # # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#60 def display_column(range); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#46 def each_bad_alignment(items, base_column); end # @deprecated Use processed_source.comment_at_line(line) # # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#71 def end_of_line_comment(line); end # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#19 def indentation(node); end # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#23 def offset(node); end # @api public # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#66 def within?(inner, outer); end end # source://rubocop//lib/rubocop/cop/mixin/alignment.rb#10 RuboCop::Cop::Alignment::SPACE = T.let(T.unsafe(nil), String) # This class does auto-correction of nodes that should just be moved to # the left or to the right, amount being determined by the instance # variable column_delta. # # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#8 class RuboCop::Cop::AlignmentCorrector extend ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::Alignment class << self # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#32 def align_end(corrector, processed_source, node, align_to); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#15 def correct(processed_source, node, column_delta); end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#13 def processed_source; end private # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#130 def alignment_column(align_to); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#43 def autocorrect_line(corrector, line_begin_pos, expr, column_delta, taboo_ranges); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#86 def block_comment_within?(expr); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#92 def calculate_range(expr, line_begin_pos, column_delta); end # Some special kinds of string literals are not composed of literal # characters between two delimiters: # - The source map of `?a` responds to :begin and :end but its end is # nil. # - The source map of `__FILE__` responds to neither :begin nor :end. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#79 def delimited_string_literal?(node); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#116 def each_line(expr); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#64 def inside_string_range(node); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#57 def inside_string_ranges(node); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#105 def remove(range, corrector); end # source://rubocop//lib/rubocop/cop/correctors/alignment_corrector.rb#124 def whitespace_range(node); end end end # This module encapsulates the ability to allow certain methods when # parsing. # # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#7 module RuboCop::Cop::AllowedMethods private # @api public # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#11 def allowed_method?(name); end # @api public # # source://rubocop//lib/rubocop/cop/mixin/allowed_methods.rb#16 def allowed_methods; end end # Error raised when an unqualified cop name is used that could # refer to two or more cops under different departments # # source://rubocop//lib/rubocop/cop/registry.rb#7 class RuboCop::Cop::AmbiguousCopName < ::RuboCop::Error # @return [AmbiguousCopName] a new instance of AmbiguousCopName # # source://rubocop//lib/rubocop/cop/registry.rb#11 def initialize(name, origin, badges); end end # source://rubocop//lib/rubocop/cop/registry.rb#8 RuboCop::Cop::AmbiguousCopName::MSG = T.let(T.unsafe(nil), String) # Handles the `MinSize` configuration option for array-based cops # `Style/SymbolArray` and `Style/WordArray`, which check for use of the # relevant percent literal syntax such as `%i[...]` and `%w[...]` # # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#8 module RuboCop::Cop::ArrayMinSize private # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#19 def array_style_detected(style, ary_size); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#11 def below_array_length?(node); end # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#38 def largest_brackets_size(style, ary_size); end # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#15 def min_size_config; end # source://rubocop//lib/rubocop/cop/mixin/array_min_size.rb#48 def smallest_percent_size(style, ary_size); end end # Common code for ordinary arrays with [] that can be written with % # syntax. # # source://rubocop//lib/rubocop/cop/mixin/array_syntax.rb#7 module RuboCop::Cop::ArraySyntax private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/array_syntax.rb#10 def bracketed_array_of?(element_type, node); end end # extend this module to signal autocorrection support # # source://rubocop//lib/rubocop/cop/mixin/auto_corrector.rb#6 module RuboCop::Cop::AutoCorrector # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/auto_corrector.rb#7 def support_autocorrect?; end end # This module encapsulates the logic for autocorrect behavior for a cop. # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#6 module RuboCop::Cop::AutocorrectLogic # @return [Boolean] # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#7 def autocorrect?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#28 def autocorrect_enabled?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#11 def autocorrect_requested?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#15 def correctable?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#19 def disable_uncorrectable?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#23 def safe_autocorrect?; end private # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#41 def disable_offense(range); end # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#79 def disable_offense_at_end_of_line(range, eol_comment); end # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#83 def disable_offense_before_and_after(range_by_lines); end # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#75 def max_line_length; end # Expand the given range to include all of any lines it covers. Does not # include newline at end of the last line. # # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#63 def range_by_lines(range); end # source://rubocop//lib/rubocop/cop/autocorrect_logic.rb#52 def range_of_first_line(range); end end # Identifier of all cops containing a department and cop name. # # All cops are identified by their badge. For example, the badge for # `RuboCop::Cop::Layout::IndentationStyle` is `Layout/IndentationStyle`. # Badges can be parsed as either `Department/CopName` or just `CopName` to # allow for badge references in source files that omit the department for # RuboCop to infer. # # source://rubocop//lib/rubocop/cop/badge.rb#12 class RuboCop::Cop::Badge # @return [Badge] a new instance of Badge # # source://rubocop//lib/rubocop/cop/badge.rb#41 def initialize(department, cop_name); end # source://rubocop//lib/rubocop/cop/badge.rb#46 def ==(other); end # Returns the value of attribute cop_name. # # source://rubocop//lib/rubocop/cop/badge.rb#23 def cop_name; end # Returns the value of attribute department. # # source://rubocop//lib/rubocop/cop/badge.rb#23 def department; end # source://rubocop//lib/rubocop/cop/badge.rb#46 def eql?(other); end # source://rubocop//lib/rubocop/cop/badge.rb#51 def hash; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/badge.rb#55 def match?(other); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/badge.rb#64 def qualified?; end # source://rubocop//lib/rubocop/cop/badge.rb#60 def to_s; end # source://rubocop//lib/rubocop/cop/badge.rb#68 def with_department(department); end class << self # source://rubocop//lib/rubocop/cop/badge.rb#25 def for(class_name); end # @raise [InvalidBadge] # # source://rubocop//lib/rubocop/cop/badge.rb#29 def parse(identifier); end end end # Error raised when a badge parse fails. # # source://rubocop//lib/rubocop/cop/badge.rb#14 class RuboCop::Cop::Badge::InvalidBadge < ::RuboCop::Error # @return [InvalidBadge] a new instance of InvalidBadge # # source://rubocop//lib/rubocop/cop/badge.rb#18 def initialize(token); end end # source://rubocop//lib/rubocop/cop/badge.rb#15 RuboCop::Cop::Badge::InvalidBadge::MSG = T.let(T.unsafe(nil), String) # A scaffold for concrete cops. # # The Cop::Base class is meant to be extended. # # Cops track offenses and can autocorrect them on the fly. # # A commissioner object is responsible for traversing the AST and invoking # the specific callbacks on each cop. # # First the callback `on_new_investigation` is called; # if a cop needs to do its own processing of the AST or depends on # something else. # # Then callbacks like `on_def`, `on_send` (see AST::Traversal) are called # with their respective nodes. # # Finally the callback `on_investigation_end` is called. # # Within these callbacks, cops are meant to call `add_offense` or # `add_global_offense`. Use the `processed_source` method to # get the currently processed source being investigated. # # In case of invalid syntax / unparseable content, # the callback `on_other_file` is called instead of all the other # `on_...` callbacks. # # Private methods are not meant for custom cops consumption, # nor are any instance variables. # # source://rubocop//lib/rubocop/cop/base.rb#34 class RuboCop::Cop::Base include ::RuboCop::AST::Sexp include ::RuboCop::PathUtil include ::RuboCop::Cop::Util include ::RuboCop::Cop::IgnoredNode include ::RuboCop::Cop::AutocorrectLogic extend ::RuboCop::AST::Sexp extend ::RuboCop::AST::NodePattern::Macros # @return [Base] a new instance of Base # # source://rubocop//lib/rubocop/cop/base.rb#70 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # Adds an offense that has no particular location. # No correction can be applied to global offenses # # source://rubocop//lib/rubocop/cop/base.rb#106 def add_global_offense(message = T.unsafe(nil), severity: T.unsafe(nil)); end # Adds an offense on the specified range (or node with an expression) # Unless that offense is disabled for this range, a corrector will be yielded # to provide the cop the opportunity to autocorrect the offense. # If message is not specified, the method `message` will be called. # # source://rubocop//lib/rubocop/cop/base.rb#117 def add_offense(node_or_range, message: T.unsafe(nil), severity: T.unsafe(nil), &block); end # Returns the value of attribute config. # # source://rubocop//lib/rubocop/cop/base.rb#42 def config; end # source://rubocop//lib/rubocop/cop/base.rb#207 def config_to_allow_offenses; end # source://rubocop//lib/rubocop/cop/base.rb#212 def config_to_allow_offenses=(hash); end # Configuration Helpers # # source://rubocop//lib/rubocop/cop/base.rb#201 def cop_config; end # source://rubocop//lib/rubocop/cop/base.rb#193 def cop_name; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#231 def excluded_file?(file); end # This method should be overridden when a cop's behavior depends # on state that lives outside of these locations: # # (1) the file under inspection # (2) the cop's source code # (3) the config (eg a .rubocop.yml file) # # For example, some cops may want to look at other parts of # the codebase being inspected to find violations. A cop may # use the presence or absence of file `foo.rb` to determine # whether a certain violation exists in `bar.rb`. # # Overriding this method allows the cop to indicate to RuboCop's # ResultCache system when those external dependencies change, # ie when the ResultCache should be invalidated. # # source://rubocop//lib/rubocop/cop/base.rb#146 def external_dependency_checksum; end # Gets called if no message is specified when calling `add_offense` or # `add_global_offense` # Cops are discouraged to override this; instead pass your message directly # # source://rubocop//lib/rubocop/cop/base.rb#100 def message(_range = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/base.rb#193 def name; end # @deprecated Make potential errors with previous API more obvious # # source://rubocop//lib/rubocop/cop/base.rb#259 def offenses; end # Called after all on_... have been called # When refining this method, always call `super` # # source://rubocop//lib/rubocop/cop/base.rb#84 def on_investigation_end; end # Called before all on_... have been called # When refining this method, always call `super` # # source://rubocop//lib/rubocop/cop/base.rb#78 def on_new_investigation; end # Called instead of all on_... callbacks for unrecognized files / syntax errors # When refining this method, always call `super` # # source://rubocop//lib/rubocop/cop/base.rb#90 def on_other_file; end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/base.rb#42 def processed_source; end # Called between investigations # # @api private # # source://rubocop//lib/rubocop/cop/base.rb#250 def ready; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#225 def relevant_file?(file); end # source://rubocop//lib/rubocop/cop/base.rb#221 def target_rails_version; end # source://rubocop//lib/rubocop/cop/base.rb#217 def target_ruby_version; end private # source://rubocop//lib/rubocop/cop/base.rb#381 def annotate(message); end # source://rubocop//lib/rubocop/cop/base.rb#272 def apply_correction(corrector); end # @return [Symbol] offense status # # source://rubocop//lib/rubocop/cop/base.rb#345 def attempt_correction(range, corrector); end # Called before any investigation # # source://rubocop//lib/rubocop/cop/base.rb#298 def begin_investigation(processed_source); end # Reserved for Cop::Cop # # source://rubocop//lib/rubocop/cop/base.rb#268 def callback_argument(range); end # Called to complete an investigation # # source://rubocop//lib/rubocop/cop/base.rb#307 def complete_investigation; end # @return [Symbol, Corrector] offense status # # source://rubocop//lib/rubocop/cop/base.rb#328 def correct(range); end # source://rubocop//lib/rubocop/cop/base.rb#276 def correction_strategy; end # Reserved for Commissioner: # # source://rubocop//lib/rubocop/cop/base.rb#285 def current_offense_locations; end # source://rubocop//lib/rubocop/cop/base.rb#289 def currently_disabled_lines; end # source://rubocop//lib/rubocop/cop/base.rb#416 def custom_severity; end # source://rubocop//lib/rubocop/cop/base.rb#412 def default_severity; end # source://rubocop//lib/rubocop/cop/base.rb#359 def disable_uncorrectable(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#402 def enabled_line?(line_number); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#387 def file_name_matches_any?(file, parameter, default_result); end # source://rubocop//lib/rubocop/cop/base.rb#377 def find_message(range, message); end # source://rubocop//lib/rubocop/cop/base.rb#408 def find_severity(_range, severity); end # source://rubocop//lib/rubocop/cop/base.rb#366 def range_from_node_or_range(node_or_range); end # source://rubocop//lib/rubocop/cop/base.rb#323 def reset_investigation; end class << self # List of cops that should not try to autocorrect at the same # time as this cop # # @api public # @return [Array] # # source://rubocop//lib/rubocop/cop/base.rb#58 def autocorrect_incompatible_with; end # Naming # # source://rubocop//lib/rubocop/cop/base.rb#168 def badge; end # source://rubocop//lib/rubocop/cop/base.rb#172 def cop_name; end # source://rubocop//lib/rubocop/cop/base.rb#176 def department; end # Cops (other than builtin) are encouraged to implement this # # @api public # @return [String, nil] # # source://rubocop//lib/rubocop/cop/base.rb#66 def documentation_url; end # Call for abstract Cop classes # # source://rubocop//lib/rubocop/cop/base.rb#156 def exclude_from_registry; end # @private # # source://rubocop//lib/rubocop/cop/base.rb#150 def inherited(subclass); end # Override and return the Force class(es) you need to join # # source://rubocop//lib/rubocop/cop/base.rb#95 def joining_forces; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#180 def lint?; end # Returns true if the cop name or the cop namespace matches any of the # given names. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#186 def match?(given_names); end # Returns if class supports auto_correct. # It is recommended to extend AutoCorrector instead of overriding # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#162 def support_autocorrect?; end # Override if your cop should be called repeatedly for multiple investigations # Between calls to `on_new_investigation` and `on_investigation_end`, # the result of `processed_source` will remain constant. # You should invalidate any caches that depend on the current `processed_source` # in the `on_new_investigation` callback. # If your cop does autocorrections, be aware that your instance may be called # multiple times with the same `processed_source.path` but different content. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#244 def support_multiple_source?; end private # Actually private methods # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/base.rb#315 def builtin?; end # source://rubocop//lib/rubocop/cop/base.rb#293 def restrict_on_send; end end end # Reports of an investigation. # Immutable # Consider creation API private # # source://rubocop//lib/rubocop/cop/base.rb#47 class RuboCop::Cop::Base::InvestigationReport < ::Struct # Returns the value of attribute cop # # @return [Object] the current value of cop def cop; end # Sets the attribute cop # # @param value [Object] the value to set the attribute cop to. # @return [Object] the newly set value def cop=(_); end # Returns the value of attribute corrector # # @return [Object] the current value of corrector def corrector; end # Sets the attribute corrector # # @param value [Object] the value to set the attribute corrector to. # @return [Object] the newly set value def corrector=(_); end # Returns the value of attribute offenses # # @return [Object] the current value of offenses def offenses; end # Sets the attribute offenses # # @param value [Object] the value to set the attribute offenses to. # @return [Object] the newly set value def offenses=(_); end # Returns the value of attribute processed_source # # @return [Object] the current value of processed_source def processed_source; end # Sets the attribute processed_source # # @param value [Object] the value to set the attribute processed_source to. # @return [Object] the newly set value def processed_source=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # List of methods names to restrict calls for `on_send` / `on_csend` # # source://rubocop//lib/rubocop/cop/base.rb#50 RuboCop::Cop::Base::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#5 module RuboCop::Cop::Bundler; end # A Gem's requirements should be listed only once in a Gemfile. # # @example # # bad # gem 'rubocop' # gem 'rubocop' # # # bad # group :development do # gem 'rubocop' # end # # group :test do # gem 'rubocop' # end # # # good # group :development, :test do # gem 'rubocop' # end # # # good # gem 'rubocop', groups: [:development, :test] # # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#28 class RuboCop::Cop::Bundler::DuplicatedGem < ::RuboCop::Cop::Cop include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#50 def gem_declarations(param0); end # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#34 def investigate(processed_source); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#59 def condition?(nodes); end # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#52 def duplicated_gem_nodes; end # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#63 def register_offense(node, gem_name, line_of_first_occurrence); end end # source://rubocop//lib/rubocop/cop/bundler/duplicated_gem.rb#31 RuboCop::Cop::Bundler::DuplicatedGem::MSG = T.let(T.unsafe(nil), String) # Add a comment describing each gem in your Gemfile. # # Optionally, the "OnlyFor" configuration # can be used to only register offenses when the gems # use certain options or have version specifiers. # Add "version_specifiers" and/or the gem option names # you want to check. # # A useful use-case is to enforce a comment when using # options that change the source of a gem: # # - `bitbucket` # - `gist` # - `git` # - `github` # - `source` # # For a full list of options supported by bundler, # you can check the https://bundler.io/man/gemfile.5.html[official documentation]. # # @example OnlyFor: [] (default) # # bad # # gem 'foo' # # # good # # # Helpers for the foo things. # gem 'foo' # @example OnlyFor: ['version_specifiers'] # # bad # # gem 'foo', '< 2.1' # # # good # # # Version 2.1 introduces breaking change baz # gem 'foo', '< 2.1' # @example OnlyFor: ['version_specifiers', 'github'] # # bad # # gem 'foo', github: 'some_account/some_fork_of_foo' # # gem 'bar', '< 2.1' # # # good # # # Using this fork because baz # gem 'foo', github: 'some_account/some_fork_of_foo' # # # Version 2.1 introduces breaking change baz # gem 'bar', '< 2.1' # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#61 class RuboCop::Cop::Bundler::GemComment < ::RuboCop::Cop::Cop include ::RuboCop::Cop::DefNode # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#69 def gem_declaration?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#71 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#113 def checked_options_present?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#86 def commented?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#82 def commented_any_descendant?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#126 def contains_checked_options?(node); end # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#130 def gem_options(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#108 def ignored_gem?(node); end # The args node1 & node2 may represent a RuboCop::AST::Node # or a Parser::Source::Comment. Both respond to #loc. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#93 def precede?(node1, node2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#103 def preceding_comment?(node1, node2); end # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#97 def preceding_lines(node); end # Besides the gem name, all other *positional* arguments to `gem` are version specifiers, # as long as it has one we know there's at least one version specifier. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#121 def version_specified_gem?(node); end end # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#65 RuboCop::Cop::Bundler::GemComment::CHECKED_OPTIONS_CONFIG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#64 RuboCop::Cop::Bundler::GemComment::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#67 RuboCop::Cop::Bundler::GemComment::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/bundler/gem_comment.rb#66 RuboCop::Cop::Bundler::GemComment::VERSION_SPECIFIERS_OPTION = T.let(T.unsafe(nil), String) # The symbol argument `:gemcutter`, `:rubygems`, and `:rubyforge` # are deprecated. So please change your source to URL string that # 'https://rubygems.org' if possible, or 'http://rubygems.org' if not. # # This autocorrect will replace these symbols with 'https://rubygems.org'. # Because it is secure, HTTPS request is strongly recommended. And in # most use cases HTTPS will be fine. # # However, it don't replace all `sources` of `http://` with `https://`. # For example, when specifying an internal gem server using HTTP on the # intranet, a use case where HTTPS cannot be specified was considered. # Consider using HTTP only if you cannot use HTTPS. # # @example # # bad # source :gemcutter # source :rubygems # source :rubyforge # # # good # source 'https://rubygems.org' # strongly recommended # source 'http://rubygems.org' # # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#28 class RuboCop::Cop::Bundler::InsecureProtocolSource < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#39 def insecure_protocol_source?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#44 def on_send(node); end end # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#32 RuboCop::Cop::Bundler::InsecureProtocolSource::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/bundler/insecure_protocol_source.rb#37 RuboCop::Cop::Bundler::InsecureProtocolSource::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Gems should be alphabetically sorted within groups. # # @example # # bad # gem 'rubocop' # gem 'rspec' # # # good # gem 'rspec' # gem 'rubocop' # # # good # gem 'rubocop' # # gem 'rspec' # # # good only if TreatCommentsAsGroupSeparators is true # # For code quality # gem 'rubocop' # # For tests # gem 'rspec' # # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#27 class RuboCop::Cop::Bundler::OrderedGems < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::OrderedGemNode # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#50 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#67 def gem_declarations(param0); end # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#35 def investigate(processed_source); end private # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#61 def previous_declaration(node); end end # source://rubocop//lib/rubocop/cop/bundler/ordered_gems.rb#31 RuboCop::Cop::Bundler::OrderedGems::MSG = T.let(T.unsafe(nil), String) # Common functionality for checking assignment nodes. # # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#6 module RuboCop::Cop::CheckAssignment # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_and_asgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_masgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_op_asgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#7 def on_or_asgn(node); end # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#19 def on_send(node); end private # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#29 def extract_rhs(node); end class << self # source://rubocop//lib/rubocop/cop/mixin/check_assignment.rb#29 def extract_rhs(node); end end end # This mixin detects collections that are safe to "break" # by inserting new lines. This is useful for breaking # up long lines. # # Let's look at hashes as an example: # # We know hash keys are safe to break across lines. We can add # linebreaks into hashes on lines longer than the specified maximum. # Then in further passes cops can clean up the multi-line hash. # For example, say the maximum line length is as indicated below: # # | # v # {foo: "0000000000", bar: "0000000000", baz: "0000000000"} # # In a LineLength autocorrection pass, a line is added before # the first key that exceeds the column limit: # # {foo: "0000000000", bar: "0000000000", # baz: "0000000000"} # # In a MultilineHashKeyLineBreaks pass, lines are inserted # before all keys: # # {foo: "0000000000", # bar: "0000000000", # baz: "0000000000"} # # Then in future passes FirstHashElementLineBreak, # MultilineHashBraceLayout, and TrailingCommaInHashLiteral will # manipulate as well until we get: # # { # foo: "0000000000", # bar: "0000000000", # baz: "0000000000", # } # # (Note: Passes may not happen exactly in this sequence.) # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#44 module RuboCop::Cop::CheckLineBreakable # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#45 def extract_breakable_node(node, max); end private # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#168 def all_on_same_line?(nodes); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#188 def already_on_multiple_lines?(node); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#101 def breakable_collection?(node, elements); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#155 def children_could_be_broken_up?(children); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#118 def contained_by_breakable_collection_on_same_line?(node); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#138 def contained_by_multiline_collection_that_could_be_broken_up?(node); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#58 def extract_breakable_node_from_elements(node, elements, max); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#70 def extract_first_element_over_column_limit(node, elements, max); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#175 def process_args(args); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#85 def safe_to_ignore?(node); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/check_line_breakable.rb#80 def within_column_limit?(element, max, line); end end # Common functionality for checking length of code segments. # # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#6 module RuboCop::Cop::CodeLength include ::RuboCop::Cop::ConfigurableMax private # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#49 def build_code_length_calculator(node); end # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#29 def check_code_length(node); end # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#25 def count_as_one; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#21 def count_comments?; end # Returns true for lines that shall not be included in the count. # # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#45 def irrelevant_line(source_line); end # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#17 def max_length; end # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#13 def message(length, max_length); end end # source://rubocop//lib/rubocop/cop/mixin/code_length.rb#9 RuboCop::Cop::CodeLength::MSG = T.let(T.unsafe(nil), String) # Help methods for working with nodes containing comments. # # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#6 module RuboCop::Cop::CommentsHelp include ::RuboCop::Cop::VisibilityHelp # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#9 def source_range_with_comment(node); end private # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#24 def begin_pos_with_comment(node); end # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#43 def buffer; end # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#19 def end_position_for(node); end # source://rubocop//lib/rubocop/cop/mixin/comments_help.rb#39 def start_line_position(node); end end # Commissioner class is responsible for processing the AST and delegating # work to the specified cops. # # source://rubocop//lib/rubocop/cop/commissioner.rb#7 class RuboCop::Cop::Commissioner include ::RuboCop::AST::Traversal # @return [Commissioner] a new instance of Commissioner # # source://rubocop//lib/rubocop/cop/commissioner.rb#44 def initialize(cops, forces = T.unsafe(nil), options = T.unsafe(nil)); end # Returns the value of attribute errors. # # source://rubocop//lib/rubocop/cop/commissioner.rb#42 def errors; end # @return [InvestigationReport] # # source://rubocop//lib/rubocop/cop/commissioner.rb#78 def investigate(processed_source); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on___ENCODING__(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on___FILE__(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on___LINE__(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_alias(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_and(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_and_asgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_arg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_arg_expr(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_args(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_array(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_array_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_array_pattern_with_tail(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_back_ref(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_begin(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_block(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_block_pass(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_blockarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_break(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_case(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_case_match(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_cbase(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_class(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_complex(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_const(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_const_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_csend(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_cvar(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_def(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_defined?(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_defs(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_dstr(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_dsym(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_eflipflop(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_empty_else(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_ensure(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_erange(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_false(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_find_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_float(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_for(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_forward_arg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_forward_args(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_forwarded_args(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_forwarded_kwrestarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_forwarded_restarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_gvar(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_hash(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_hash_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_if(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_if_guard(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_iflipflop(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_in_match(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_in_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_index(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_indexasgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_int(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_irange(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_ivar(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwargs(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwbegin(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwnilarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwoptarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwrestarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_kwsplat(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_lambda(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_lvar(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_masgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_alt(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_as(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_current_line(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_nil_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_pattern(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_pattern_p(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_rest(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_var(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_with_lvasgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_match_with_trailing_comma(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_mlhs(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_module(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_next(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_nil(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_not(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_nth_ref(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_numblock(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_op_asgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_optarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_or(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_or_asgn(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_pair(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_pin(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_postexe(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_preexe(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_procarg0(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_rational(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_redo(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_regexp(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_regopt(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_resbody(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_rescue(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_restarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_retry(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_return(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_sclass(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_self(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_send(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_shadowarg(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_splat(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_str(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_super(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_sym(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_true(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_undef(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_unless_guard(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_until(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_when(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_while(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_while_post(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_xstr(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_yield(node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#69 def on_zsuper(node); end private # source://rubocop//lib/rubocop/cop/commissioner.rb#108 def cops_callbacks_for(callback); end # source://rubocop//lib/rubocop/cop/commissioner.rb#140 def invoke(callback, cops, *args); end # source://rubocop//lib/rubocop/cop/commissioner.rb#104 def reset; end # Note: mutates `callbacks` in place # # source://rubocop//lib/rubocop/cop/commissioner.rb#128 def restricted_map(callbacks); end # source://rubocop//lib/rubocop/cop/commissioner.rb#96 def trigger_responding_cops(callback, node); end # source://rubocop//lib/rubocop/cop/commissioner.rb#118 def trigger_restricted_cops(event, node); end # Allow blind rescues here, since we're absorbing and packaging or # re-raising exceptions that can be raised from within the individual # cops' `#investigate` methods. # # source://rubocop//lib/rubocop/cop/commissioner.rb#151 def with_cop_error_handling(cop, node = T.unsafe(nil)); end end # How a Commissioner returns the results of the investigation # as a list of Cop::InvestigationReport and any errors caught # during the investigation. # Immutable # Consider creation API private # # source://rubocop//lib/rubocop/cop/commissioner.rb#18 class RuboCop::Cop::Commissioner::InvestigationReport < ::Struct # Returns the value of attribute cop_reports # # @return [Object] the current value of cop_reports def cop_reports; end # Sets the attribute cop_reports # # @param value [Object] the value to set the attribute cop_reports to. # @return [Object] the newly set value def cop_reports=(_); end # source://rubocop//lib/rubocop/cop/commissioner.rb#19 def cops; end # source://rubocop//lib/rubocop/cop/commissioner.rb#27 def correctors; end # Returns the value of attribute errors # # @return [Object] the current value of errors def errors; end # Sets the attribute errors # # @param value [Object] the value to set the attribute errors to. # @return [Object] the newly set value def errors=(_); end # source://rubocop//lib/rubocop/cop/commissioner.rb#35 def merge(investigation); end # source://rubocop//lib/rubocop/cop/commissioner.rb#31 def offenses; end # source://rubocop//lib/rubocop/cop/commissioner.rb#23 def offenses_per_cop; end # Returns the value of attribute processed_source # # @return [Object] the current value of processed_source def processed_source; end # Sets the attribute processed_source # # @param value [Object] the value to set the attribute processed_source to. # @return [Object] the newly set value def processed_source=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # source://rubocop//lib/rubocop/cop/commissioner.rb#10 RuboCop::Cop::Commissioner::RESTRICTED_CALLBACKS = T.let(T.unsafe(nil), Array) # This class does condition auto-correction # # source://rubocop//lib/rubocop/cop/correctors/condition_corrector.rb#6 class RuboCop::Cop::ConditionCorrector class << self # source://rubocop//lib/rubocop/cop/correctors/condition_corrector.rb#8 def correct_negative_condition(corrector, node); end private # source://rubocop//lib/rubocop/cop/correctors/condition_corrector.rb#17 def negated_condition(node); end end end # Handles `EnforcedStyle` configuration parameters. # # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#6 module RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#76 def alternative_style; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#84 def alternative_styles; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#19 def ambiguous_style_detected(*possibilities); end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#48 def conflicting_styles_detected; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#11 def correct_style_detected; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#52 def detected_style; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#56 def detected_style=(style); end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#48 def no_acceptable_style!; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#44 def no_acceptable_style?; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#7 def opposite_style_detected; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#67 def style; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#63 def style_configured?; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#23 def style_detected(detected); end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#95 def style_parameter_name; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#88 def supported_styles; end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#15 def unexpected_style_detected(unexpected); end # source://rubocop//lib/rubocop/cop/mixin/configurable_enforced_style.rb#48 def unrecognized_style_detected; end end # Shared functionality between mixins that enforce naming conventions # # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#6 module RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#9 def check_name(node, name, name_range); end # A class emitter method is a singleton method in a class/module, where # the method has the same name as a class defined in the class/module. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#32 def class_emitter_method?(node, name); end # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#19 def report_opposing_styles(node, name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/configurable_formatting.rb#25 def valid_name?(node, name, given_style = T.unsafe(nil)); end end # Handles `Max` configuration parameters, especially setting them to an # appropriate value with --auto-gen-config. # # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#7 module RuboCop::Cop::ConfigurableMax private # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#10 def max=(value); end # source://rubocop//lib/rubocop/cop/mixin/configurable_max.rb#18 def max_parameter_name; end end # This module provides functionality for checking if names match the # configured EnforcedStyle. # # source://rubocop//lib/rubocop/cop/mixin/configurable_naming.rb#7 module RuboCop::Cop::ConfigurableNaming include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting end # source://rubocop//lib/rubocop/cop/mixin/configurable_naming.rb#10 RuboCop::Cop::ConfigurableNaming::FORMATS = T.let(T.unsafe(nil), Hash) # This module provides functionality for checking if numbering match the # configured EnforcedStyle. # # source://rubocop//lib/rubocop/cop/mixin/configurable_numbering.rb#7 module RuboCop::Cop::ConfigurableNumbering include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting end # source://rubocop//lib/rubocop/cop/mixin/configurable_numbering.rb#10 RuboCop::Cop::ConfigurableNumbering::FORMATS = T.let(T.unsafe(nil), Hash) # Monkey-patch Cop for tests to provide easy access to messages and # highlights. # # source://rubocop//lib/rubocop/cop/cop.rb#11 class RuboCop::Cop::Cop < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/cop.rb#27 def add_offense(node_or_range, location: T.unsafe(nil), message: T.unsafe(nil), severity: T.unsafe(nil), &block); end # @deprecated # # source://rubocop//lib/rubocop/cop/cop.rb#64 def corrections; end # source://rubocop//lib/rubocop/cop/cop.rb#39 def find_location(node, loc); end # Returns the value of attribute offenses. # # source://rubocop//lib/rubocop/cop/cop.rb#12 def offenses; end # Called after all on_... have been called # # source://rubocop//lib/rubocop/cop/cop.rb#78 def on_investigation_end; end # Called before all on_... have been called # # source://rubocop//lib/rubocop/cop/cop.rb#72 def on_new_investigation; end # Open issue if there's a valid use case to include this in Base # # @deprecated # # source://rubocop//lib/rubocop/cop/cop.rb#102 def parse(source, path = T.unsafe(nil)); end # @deprecated Use class method # @return [Boolean] # # source://rubocop//lib/rubocop/cop/cop.rb#45 def support_autocorrect?; end private # source://rubocop//lib/rubocop/cop/cop.rb#119 def apply_correction(corrector); end # source://rubocop//lib/rubocop/cop/cop.rb#108 def begin_investigation(processed_source); end # Override Base # # source://rubocop//lib/rubocop/cop/cop.rb#115 def callback_argument(_range); end # source://rubocop//lib/rubocop/cop/cop.rb#138 def correction_lambda; end # source://rubocop//lib/rubocop/cop/cop.rb#146 def dedup_on_node(node); end # Just for legacy # # @yield [corrector] # # source://rubocop//lib/rubocop/cop/cop.rb#124 def emulate_v0_callsequence(corrector); end # source://rubocop//lib/rubocop/cop/cop.rb#153 def suppress_clobbering; end class << self # @deprecated Use Registry.all # # source://rubocop//lib/rubocop/cop/cop.rb#91 def all; end # source://rubocop//lib/rubocop/cop/cop.rb#54 def joining_forces; end # @deprecated Use Registry.qualified_cop_name # # source://rubocop//lib/rubocop/cop/cop.rb#96 def qualified_cop_name(name, origin); end # @deprecated Use Registry.global # # source://rubocop//lib/rubocop/cop/cop.rb#86 def registry; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/cop.rb#50 def support_autocorrect?; end end end # @deprecated # # source://rubocop//lib/rubocop/cop/cop.rb#17 class RuboCop::Cop::Cop::Correction < ::Struct # source://rubocop//lib/rubocop/cop/cop.rb#18 def call(corrector); end # Returns the value of attribute cop # # @return [Object] the current value of cop def cop; end # Sets the attribute cop # # @param value [Object] the value to set the attribute cop to. # @return [Object] the newly set value def cop=(_); end # Returns the value of attribute lambda # # @return [Object] the current value of lambda def lambda; end # Sets the attribute lambda # # @param value [Object] the value to set the attribute lambda to. # @return [Object] the newly set value def lambda=(_); end # Returns the value of attribute node # # @return [Object] the current value of node def node; end # Sets the attribute node # # @param value [Object] the value to set the attribute node to. # @return [Object] the newly set value def node=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # This class takes a source buffer and rewrite its source # based on the different correction rules supplied. # # Important! # The nodes modified by the corrections should be part of the # AST of the source_buffer. # # source://rubocop//lib/rubocop/cop/corrector.rb#15 class RuboCop::Cop::Corrector < ::Parser::Source::TreeRewriter # corrector = Corrector.new(cop) # # @param source [Parser::Source::Buffer, or anything # leading to one via `(processed_source.)buffer`] # @return [Corrector] a new instance of Corrector # # source://rubocop//lib/rubocop/cop/corrector.rb#16 def initialize(source); end # Removes `size` characters from the beginning of the given range. # If `size` is greater than the size of `range`, the removed region can # overrun the end of `range`. # # @param range [Parser::Source::Range, Rubocop::AST::Node] or node # @param size [Integer] # # source://rubocop//lib/rubocop/cop/corrector.rb#50 def remove_leading(node_or_range, size); end # Removes `size` characters prior to the source range. # # @param range [Parser::Source::Range, Rubocop::AST::Node] or node # @param size [Integer] # # source://rubocop//lib/rubocop/cop/corrector.rb#35 def remove_preceding(node_or_range, size); end # Removes `size` characters from the end of the given range. # If `size` is greater than the size of `range`, the removed region can # overrun the beginning of `range`. # # @param range [Parser::Source::Range, Rubocop::AST::Node] or node # @param size [Integer] # # source://rubocop//lib/rubocop/cop/corrector.rb#62 def remove_trailing(node_or_range, size); end # Legacy # # source://parser/3.2.0.0/lib/parser/source/tree_rewriter.rb#252 def rewrite; end private # source://rubocop//lib/rubocop/cop/corrector.rb#100 def check_range_validity(node_or_range); end # source://rubocop//lib/rubocop/cop/corrector.rb#85 def to_range(node_or_range); end # source://rubocop//lib/rubocop/cop/corrector.rb#104 def validate_buffer(buffer); end class << self # Duck typing for get to a ::Parser::Source::Buffer # # source://rubocop//lib/rubocop/cop/corrector.rb#69 def source_buffer(source); end end end # Common functionality for checking def nodes. # # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#6 module RuboCop::Cop::DefNode extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#28 def non_public_modifier?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#13 def non_public?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#18 def preceding_non_public_modifier?(node); end # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#24 def stripped_source_upto(index); end end # source://rubocop//lib/rubocop/cop/mixin/def_node.rb#9 RuboCop::Cop::DefNode::NON_PUBLIC_MODIFIERS = T.let(T.unsafe(nil), Array) # Helpers for builtin documentation # # source://rubocop//lib/rubocop/cop/documentation.rb#6 module RuboCop::Cop::Documentation private # @api private # # source://rubocop//lib/rubocop/cop/documentation.rb#10 def department_to_basename(department); end # @api private # # source://rubocop//lib/rubocop/cop/documentation.rb#15 def url_for(cop_class); end class << self # @api private # # source://rubocop//lib/rubocop/cop/documentation.rb#10 def department_to_basename(department); end # @api private # # source://rubocop//lib/rubocop/cop/documentation.rb#15 def url_for(cop_class); end end end # Common functionality for checking documentation. # # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#6 module RuboCop::Cop::DocumentationComment include ::RuboCop::Cop::Style::AnnotationComment extend ::RuboCop::AST::NodePattern::Macros private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#12 def documentation_comment?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#43 def interpreter_directive_comment?(comment); end # The args node1 & node2 may represent a RuboCop::AST::Node # or a Parser::Source::Comment. Both respond to #loc. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#33 def precede?(node1, node2); end # The args node1 & node2 may represent a RuboCop::AST::Node # or a Parser::Source::Comment. Both respond to #loc. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#26 def preceding_comment?(node1, node2); end # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#37 def preceding_lines(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/documentation_comment.rb#47 def rubocop_directive_comment?(comment); end end # Common functionality for dealing with duplication. # # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#6 module RuboCop::Cop::Duplication private # Returns the consecutive duplicates, leaving out the first instance of # the duplicated elements. # # @param collection [Array] an array to return consecutive duplicates for # @return [Array] the consecutive duplicates # # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#31 def consecutive_duplicates(collection); end # Returns all duplicates, including the first instance of the duplicated # elements. # # @param collection [Array] an array to return duplicates for # @return [Array] all the duplicates # # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#22 def duplicates(collection); end # Whether the `collection` contains any duplicates. # # @param collection [Array] an array to check for duplicates # @return [Boolean] whether the array contains any duplicates # # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#13 def duplicates?(collection); end # Returns a hash of grouped duplicates. The key will be the first # instance of the element, and the value an `array` of the initial # element and all duplicate instances. # # @param collection [Array] an array to group duplicates for # @return [Array] the grouped duplicates # # source://rubocop//lib/rubocop/cop/mixin/duplication.rb#41 def grouped_duplicates(collection); end end # This class auto-corrects `#each` enumeration to `for` iteration. # # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#6 class RuboCop::Cop::EachToForCorrector extend ::RuboCop::AST::NodePattern::Macros # @return [EachToForCorrector] a new instance of EachToForCorrector # # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#13 def initialize(block_node); end # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#19 def call(corrector); end private # Returns the value of attribute argument_node. # # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#25 def argument_node; end # Returns the value of attribute block_node. # # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#25 def block_node; end # Returns the value of attribute collection_node. # # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#25 def collection_node; end # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#27 def correction; end # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#38 def offending_range; end # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#46 def replacement_range(end_pos); end end # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#11 RuboCop::Cop::EachToForCorrector::CORRECTION_WITHOUT_ARGUMENTS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/correctors/each_to_for_corrector.rb#9 RuboCop::Cop::EachToForCorrector::CORRECTION_WITH_ARGUMENTS = T.let(T.unsafe(nil), String) # This class does empty line auto-correction # # source://rubocop//lib/rubocop/cop/correctors/empty_line_corrector.rb#6 class RuboCop::Cop::EmptyLineCorrector class << self # source://rubocop//lib/rubocop/cop/correctors/empty_line_corrector.rb#8 def correct(corrector, node); end # source://rubocop//lib/rubocop/cop/correctors/empty_line_corrector.rb#19 def insert_before(corrector, node); end end end # Common code for empty parameter cops. # # source://rubocop//lib/rubocop/cop/mixin/empty_parameter.rb#6 module RuboCop::Cop::EmptyParameter extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/empty_parameter.rb#11 def empty_arguments?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/mixin/empty_parameter.rb#15 def check(node); end end # Functions for checking the alignment of the `end` keyword. # # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#6 module RuboCop::Cop::EndKeywordAlignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#63 def accept_end_kw_alignment?(end_loc); end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#51 def add_offense_for_misalignment(node, align_with); end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#19 def check_end_kw_alignment(node, align_ranges); end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#15 def check_end_kw_in_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#78 def line_break_before_keyword?(whole_expression, rhs); end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#35 def matching_ranges(end_loc, align_ranges); end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#42 def start_line_range(node); end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#68 def style_parameter_name; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#72 def variable_alignment?(whole_expression, rhs, end_alignment_style); end end # source://rubocop//lib/rubocop/cop/mixin/end_keyword_alignment.rb#10 RuboCop::Cop::EndKeywordAlignment::MSG = T.let(T.unsafe(nil), String) # Common functionality for enforcing a specific superclass # # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#6 module RuboCop::Cop::EnforceSuperclass # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#19 def on_class(node); end # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#25 def on_send(node); end class << self # @private # # source://rubocop//lib/rubocop/cop/mixin/enforce_superclass.rb#7 def included(base); end end end # Common functionality for checking for a line break before the first # element in a multi-line collection. # # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#7 module RuboCop::Cop::FirstElementLineBreak private # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#23 def check_children_line_break(node, children, start = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#10 def check_method_line_break(node, children); end # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#39 def first_by_line(nodes); end # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#43 def last_by_line(nodes); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/first_element_line_break.rb#18 def method_uses_parens?(node, limit); end end # This class auto-corrects `for` iteration to `#each` enumeration. # # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#6 class RuboCop::Cop::ForToEachCorrector extend ::RuboCop::AST::NodePattern::Macros # @return [ForToEachCorrector] a new instance of ForToEachCorrector # # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#11 def initialize(for_node); end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#17 def call(corrector); end private # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#54 def collection_end; end # Returns the value of attribute collection_node. # # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#23 def collection_node; end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#30 def collection_source; end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#25 def correction; end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#42 def end_position; end # Returns the value of attribute for_node. # # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#23 def for_node; end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#50 def keyword_begin; end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#62 def offending_range; end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#66 def replacement_range(end_pos); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#38 def requires_parentheses?; end # Returns the value of attribute variable_node. # # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#23 def variable_node; end end # source://rubocop//lib/rubocop/cop/correctors/for_to_each_corrector.rb#9 RuboCop::Cop::ForToEachCorrector::CORRECTION = T.let(T.unsafe(nil), String) # A scaffold for concrete forces. # # source://rubocop//lib/rubocop/cop/force.rb#6 class RuboCop::Cop::Force # @return [Force] a new instance of Force # # source://rubocop//lib/rubocop/cop/force.rb#22 def initialize(cops); end # Returns the value of attribute cops. # # source://rubocop//lib/rubocop/cop/force.rb#7 def cops; end # source://rubocop//lib/rubocop/cop/force.rb#38 def investigate(_processed_source); end # source://rubocop//lib/rubocop/cop/force.rb#26 def name; end # source://rubocop//lib/rubocop/cop/force.rb#30 def run_hook(method_name, *args); end class << self # source://rubocop//lib/rubocop/cop/force.rb#9 def all; end # source://rubocop//lib/rubocop/cop/force.rb#18 def force_name; end # @private # # source://rubocop//lib/rubocop/cop/force.rb#13 def inherited(subclass); end end end # Common functionality for dealing with frozen string literals. # # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#6 module RuboCop::Cop::FrozenStringLiteral private # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#13 def frozen_string_literal_comment_exists?; end # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#42 def frozen_string_literal_specified?; end # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#21 def frozen_string_literals_enabled?; end # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#48 def leading_comment_lines; end class << self # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#13 def frozen_string_literal_comment_exists?; end end end # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#9 RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#10 RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_ENABLED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/frozen_string_literal.rb#11 RuboCop::Cop::FrozenStringLiteral::FROZEN_STRING_LITERAL_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#5 module RuboCop::Cop::Gemspec; end # An attribute assignment method calls should be listed only once # in a gemspec. # # Assigning to an attribute with the same name using `spec.foo =` will be # an unintended usage. On the other hand, duplication of methods such # as `spec.requirements`, `spec.add_runtime_dependency`, and others are # permitted because it is the intended use of appending values. # # @example # # bad # Gem::Specification.new do |spec| # spec.name = 'rubocop' # spec.name = 'rubocop2' # end # # # good # Gem::Specification.new do |spec| # spec.name = 'rubocop' # end # # # good # Gem::Specification.new do |spec| # spec.requirements << 'libmagick, v6.0' # spec.requirements << 'A good graphics card' # end # # # good # Gem::Specification.new do |spec| # spec.add_runtime_dependency('parallel', '~> 1.10') # spec.add_runtime_dependency('parser', '>= 2.3.3.1', '< 3.0') # end # # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#37 class RuboCop::Cop::Gemspec::DuplicatedAssignment < ::RuboCop::Cop::Cop include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#52 def assignment_method_declarations(param0); end # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#43 def gem_specification(param0); end # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#57 def investigate(processed_source); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#79 def assignment_method?(method_name); end # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#83 def duplicated_assignment_method_nodes; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#73 def match_block_variable_name?(receiver_name); end # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#90 def register_offense(node, assignment, line_of_first_occurrence); end end # source://rubocop//lib/rubocop/cop/gemspec/duplicated_assignment.rb#40 RuboCop::Cop::Gemspec::DuplicatedAssignment::MSG = T.let(T.unsafe(nil), String) # Dependencies in the gemspec should be alphabetically sorted. # # @example # # bad # spec.add_dependency 'rubocop' # spec.add_dependency 'rspec' # # # good # spec.add_dependency 'rspec' # spec.add_dependency 'rubocop' # # # good # spec.add_dependency 'rubocop' # # spec.add_dependency 'rspec' # # # bad # spec.add_development_dependency 'rubocop' # spec.add_development_dependency 'rspec' # # # good # spec.add_development_dependency 'rspec' # spec.add_development_dependency 'rubocop' # # # good # spec.add_development_dependency 'rubocop' # # spec.add_development_dependency 'rspec' # # # bad # spec.add_runtime_dependency 'rubocop' # spec.add_runtime_dependency 'rspec' # # # good # spec.add_runtime_dependency 'rspec' # spec.add_runtime_dependency 'rubocop' # # # good # spec.add_runtime_dependency 'rubocop' # # spec.add_runtime_dependency 'rspec' # # # good only if TreatCommentsAsGroupSeparators is true # # For code quality # spec.add_dependency 'rubocop' # # For tests # spec.add_dependency 'rspec' # # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#53 class RuboCop::Cop::Gemspec::OrderedDependencies < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::OrderedGemNode # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#77 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#98 def dependency_declarations(param0); end # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#61 def investigate(processed_source); end private # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#94 def get_dependency_name(node); end # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#88 def previous_declaration(node); end end # source://rubocop//lib/rubocop/cop/gemspec/ordered_dependencies.rb#57 RuboCop::Cop::Gemspec::OrderedDependencies::MSG = T.let(T.unsafe(nil), String) # Checks that `required_ruby_version` of gemspec is specified and # equal to `TargetRubyVersion` of .rubocop.yml. # Thereby, RuboCop to perform static analysis working on the version # required by gemspec. # # @example # # When `TargetRubyVersion` of .rubocop.yml is `2.5`. # # # bad # Gem::Specification.new do |spec| # # no `required_ruby_version` specified # end # # # bad # Gem::Specification.new do |spec| # spec.required_ruby_version = '>= 2.4.0' # end # # # bad # Gem::Specification.new do |spec| # spec.required_ruby_version = '>= 2.6.0' # end # # # good # Gem::Specification.new do |spec| # spec.required_ruby_version = '>= 2.5.0' # end # # # good # Gem::Specification.new do |spec| # spec.required_ruby_version = '>= 2.5' # end # # # good # Gem::Specification.new do |spec| # spec.required_ruby_version = ['>= 2.5.0', '< 2.7.0'] # end # # # good # Gem::Specification.new do |spec| # spec.required_ruby_version = '~> 2.5' # end # # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#48 class RuboCop::Cop::Gemspec::RequiredRubyVersion < ::RuboCop::Cop::Cop include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#61 def defined_ruby_version(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#67 def investigate(processed_source); end # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#57 def required_ruby_version(param0); end private # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#88 def extract_ruby_version(required_ruby_version); end # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#100 def not_equal_message(required_ruby_version, target_ruby_version); end end # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#55 RuboCop::Cop::Gemspec::RequiredRubyVersion::MISSING_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/gemspec/required_ruby_version.rb#51 RuboCop::Cop::Gemspec::RequiredRubyVersion::NOT_EQUAL_MSG = T.let(T.unsafe(nil), String) # Checks that `RUBY_VERSION` constant is not used in gemspec. # Using `RUBY_VERSION` is dangerous because value of the # constant is determined by `rake release`. # It's possible to have dependency based on ruby version used # to execute `rake release` and not user's ruby version. # # @example # # # bad # Gem::Specification.new do |spec| # if RUBY_VERSION >= '2.5' # spec.add_runtime_dependency 'gem_a' # else # spec.add_runtime_dependency 'gem_b' # end # end # # # good # Gem::Specification.new do |spec| # spec.add_runtime_dependency 'gem_a' # end # # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#28 class RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage < ::RuboCop::Cop::Cop # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#33 def gem_specification?(param0); end # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#41 def on_const(node); end # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#31 def ruby_version?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#49 def gem_spec_with_ruby_version?(node); end end # source://rubocop//lib/rubocop/cop/gemspec/ruby_version_globals_usage.rb#29 RuboCop::Cop::Gemspec::RubyVersionGlobalsUsage::MSG = T.let(T.unsafe(nil), String) # Source and spec generator for new cops # # This generator will take a cop name and generate a source file # and spec file when given a valid qualified cop name. # # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#10 class RuboCop::Cop::Generator # @api private # @raise [ArgumentError] # @return [Generator] a new instance of Generator # # source://rubocop//lib/rubocop/cop/generator.rb#112 def initialize(name, github_user, output: T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#136 def inject_config(config_file_path: T.unsafe(nil), version_added: T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#129 def inject_require(root_file_path: T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#149 def todo; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#121 def write_source; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#125 def write_spec; end private # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#161 def badge; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#217 def bump_minor_version; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#184 def generate(template); end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#176 def generated_source; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#180 def generated_spec; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#161 def github_user; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#161 def output; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#208 def snake_case(camel_case_string); end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#198 def source_path; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#188 def spec_path; end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#163 def write_unless_file_exists(path, contents); end end # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#108 RuboCop::Cop::Generator::CONFIGURATION_ADDED_MESSAGE = T.let(T.unsafe(nil), String) # A class that injects a require directive into the root RuboCop file. # It looks for other directives that require files in the same (cop) # namespace and injects the provided one in alpha # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#9 class RuboCop::Cop::Generator::ConfigurationInjector # @return [ConfigurationInjector] a new instance of ConfigurationInjector # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#17 def initialize(configuration_file_path:, badge:, version_added:); end # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#24 def inject; end private # Returns the value of attribute badge. # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#40 def badge; end # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#42 def configuration_entries; end # Returns the value of attribute configuration_file_path. # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#40 def configuration_file_path; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#60 def cop_name_line?(yaml); end # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#50 def find_target_line; end # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#46 def new_configuration_entry; end # Returns the value of attribute output. # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#40 def output; end # Returns the value of attribute version_added. # # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#40 def version_added; end end # source://rubocop//lib/rubocop/cop/generator/configuration_injector.rb#10 RuboCop::Cop::Generator::ConfigurationInjector::TEMPLATE = T.let(T.unsafe(nil), String) # A class that injects a require directive into the root RuboCop file. # It looks for other directives that require files in the same (cop) # namespace and injects the provided one in alpha # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#9 class RuboCop::Cop::Generator::RequireFileInjector # @return [RequireFileInjector] a new instance of RequireFileInjector # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#12 def initialize(source_path:, root_file_path:, output: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#19 def inject; end private # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#67 def injectable_require_directive; end # Returns the value of attribute output. # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 def output; end # Returns the value of attribute require_entries. # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 def require_entries; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#31 def require_exists?; end # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#71 def require_path; end # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#61 def require_path_fragments(require_directove); end # Returns the value of attribute root_file_path. # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 def root_file_path; end # Returns the value of attribute source_path. # # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#29 def source_path; end # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#42 def target_line; end # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#37 def updated_directives; end end # source://rubocop//lib/rubocop/cop/generator/require_file_injector.rb#10 RuboCop::Cop::Generator::RequireFileInjector::REQUIRE_PATH = T.let(T.unsafe(nil), Regexp) # Note: RDoc 5.1.0 or lower has the following issue. # https://github.com/rubocop-hq/rubocop/issues/7043 # # The following `String#gsub` can be replaced with # squiggly heredoc when RuboCop supports Ruby 2.5 or higher # (RDoc 6.0 or higher). # # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#17 RuboCop::Cop::Generator::SOURCE_TEMPLATE = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/cop/generator.rb#82 RuboCop::Cop::Generator::SPEC_TEMPLATE = T.let(T.unsafe(nil), String) # Common functionality for checking hash alignment. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#6 module RuboCop::Cop::HashAlignmentStyles; end # Handles calculation of deltas when the enforced style is 'key'. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#8 class RuboCop::Cop::HashAlignmentStyles::KeyAlignment # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#9 def checkable_layout?(_node); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#20 def deltas(first_pair, current_pair); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#13 def deltas_for_first_pair(first_pair, _node); end private # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#34 def separator_delta(pair); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#45 def value_delta(pair); end end # Handles calculation of deltas when the enforced style is 'separator'. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#124 class RuboCop::Cop::HashAlignmentStyles::SeparatorAlignment include ::RuboCop::Cop::HashAlignmentStyles::ValueAlignment # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#127 def deltas_for_first_pair(*_nodes); end private # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#137 def hash_rocket_delta(first_pair, current_pair); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#133 def key_delta(first_pair, current_pair); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#141 def value_delta(first_pair, current_pair); end end # Handles calculation of deltas when the enforced style is 'table'. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#83 class RuboCop::Cop::HashAlignmentStyles::TableAlignment include ::RuboCop::Cop::HashAlignmentStyles::ValueAlignment # @return [TableAlignment] a new instance of TableAlignment # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#86 def initialize; end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#90 def deltas_for_first_pair(first_pair, node); end private # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#108 def hash_rocket_delta(first_pair, current_pair); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#104 def key_delta(first_pair, current_pair); end # Returns the value of attribute max_key_width. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#102 def max_key_width; end # Sets the attribute max_key_width # # @param value the value to set the attribute max_key_width to. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#102 def max_key_width=(_arg0); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#113 def value_delta(first_pair, current_pair); end end # Common functionality for checking alignment of hash values. # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#56 module RuboCop::Cop::HashAlignmentStyles::ValueAlignment # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#57 def checkable_layout?(node); end # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#61 def deltas(first_pair, current_pair); end private # source://rubocop//lib/rubocop/cop/mixin/hash_alignment_styles.rb#73 def separator_delta(first_pair, current_pair, key_delta); end end # Common functionality for Style/HashTransformKeys and # Style/HashTransformValues # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#7 module RuboCop::Cop::HashTransformMethod extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#12 def array_receiver?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#16 def on_block(node); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#37 def on_csend(node); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#28 def on_send(node); end private # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#111 def execute_correction(corrector, node, correction); end # @abstract # @raise [NotImplementedError] # @return [Captures] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#86 def extract_captures(_match); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#65 def handle_possible_offense(node, match, match_desc); end # @abstract # @raise [NotImplementedError] # @return [String] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#93 def new_method_name; end # @abstract Implemented with `def_node_matcher` # @raise [NotImplementedError] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#46 def on_bad_each_with_object(_node); end # @abstract Implemented with `def_node_matcher` # @raise [NotImplementedError] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#51 def on_bad_hash_brackets_map(_node); end # @abstract Implemented with `def_node_matcher` # @raise [NotImplementedError] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#56 def on_bad_map_to_h(_node); end # @abstract Implemented with `def_node_matcher` # @raise [NotImplementedError] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#61 def on_bad_to_h(_node); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#97 def prepare_correction(node); end end # Internal helper class to hold autocorrect data # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#140 class RuboCop::Cop::HashTransformMethod::Autocorrection < ::Struct # Returns the value of attribute block_node # # @return [Object] the current value of block_node def block_node; end # Sets the attribute block_node # # @param value [Object] the value to set the attribute block_node to. # @return [Object] the newly set value def block_node=(_); end # Returns the value of attribute leading # # @return [Object] the current value of leading def leading; end # Sets the attribute leading # # @param value [Object] the value to set the attribute leading to. # @return [Object] the newly set value def leading=(_); end # Returns the value of attribute match # # @return [Object] the current value of match def match; end # Sets the attribute match # # @param value [Object] the value to set the attribute match to. # @return [Object] the newly set value def match=(_); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#181 def set_new_arg_name(transformed_argname, corrector); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#188 def set_new_body_expression(transforming_body_expr, corrector); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#171 def set_new_method_name(new_method_name, corrector); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#165 def strip_prefix_and_suffix(node, corrector); end # Returns the value of attribute trailing # # @return [Object] the current value of trailing def trailing; end # Sets the attribute trailing # # @param value [Object] the value to set the attribute trailing to. # @return [Object] the newly set value def trailing=(_); end class << self def [](*_arg0); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#141 def from_each_with_object(node, match); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#145 def from_hash_brackets_map(node, match); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#149 def from_map_to_h(node, match); end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#161 def from_to_h(node, match); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # Internal helper class to hold match data # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#124 class RuboCop::Cop::HashTransformMethod::Captures < ::Struct # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#129 def noop_transformation?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#134 def transformation_uses_both_args?; end # Returns the value of attribute transformed_argname # # @return [Object] the current value of transformed_argname def transformed_argname; end # Sets the attribute transformed_argname # # @param value [Object] the value to set the attribute transformed_argname to. # @return [Object] the newly set value def transformed_argname=(_); end # Returns the value of attribute transforming_body_expr # # @return [Object] the current value of transforming_body_expr def transforming_body_expr; end # Sets the attribute transforming_body_expr # # @param value [Object] the value to set the attribute transforming_body_expr to. # @return [Object] the newly set value def transforming_body_expr=(_); end # Returns the value of attribute unchanged_body_expr # # @return [Object] the current value of unchanged_body_expr def unchanged_body_expr; end # Sets the attribute unchanged_body_expr # # @param value [Object] the value to set the attribute unchanged_body_expr to. # @return [Object] the newly set value def unchanged_body_expr=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # source://rubocop//lib/rubocop/cop/mixin/hash_transform_method.rb#10 RuboCop::Cop::HashTransformMethod::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Common functionality for working with heredoc strings. # # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#6 module RuboCop::Cop::Heredoc # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#9 def on_dstr(node); end # @raise [NotImplementedError] # # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#17 def on_heredoc(_node); end # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#9 def on_str(node); end # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#9 def on_xstr(node); end private # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#23 def delimiter_string(node); end # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#27 def heredoc_type(node); end end # source://rubocop//lib/rubocop/cop/mixin/heredoc.rb#7 RuboCop::Cop::Heredoc::OPENING_DELIMITER = T.let(T.unsafe(nil), Regexp) # This module encapsulates the ability to ignore certain methods when # parsing. # # source://rubocop//lib/rubocop/cop/mixin/ignored_methods.rb#7 module RuboCop::Cop::IgnoredMethods private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/ignored_methods.rb#10 def ignored_method?(name); end # source://rubocop//lib/rubocop/cop/mixin/ignored_methods.rb#14 def ignored_methods; end end # Handles adding and checking ignored nodes. # # source://rubocop//lib/rubocop/cop/ignored_node.rb#6 module RuboCop::Cop::IgnoredNode # source://rubocop//lib/rubocop/cop/ignored_node.rb#7 def ignore_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/ignored_node.rb#24 def ignored_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/ignored_node.rb#11 def part_of_ignored_node?(node); end private # source://rubocop//lib/rubocop/cop/ignored_node.rb#31 def ignored_nodes; end end # This module encapsulates the ability to ignore certain lines when # parsing. # # source://rubocop//lib/rubocop/cop/mixin/ignored_pattern.rb#7 module RuboCop::Cop::IgnoredPattern private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/ignored_pattern.rb#10 def ignored_line?(line); end # source://rubocop//lib/rubocop/cop/mixin/ignored_pattern.rb#24 def ignored_patterns; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/ignored_pattern.rb#20 def matches_ignored_pattern?(line); end end # Common functionality for checking integer nodes. # # source://rubocop//lib/rubocop/cop/mixin/integer_node.rb#6 module RuboCop::Cop::IntegerNode private # source://rubocop//lib/rubocop/cop/mixin/integer_node.rb#9 def integer_part(node); end end # Common functionality for working with string interpolations. # # @abstract Subclasses are expected to implement {#on_interpolation}. # # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#8 module RuboCop::Cop::Interpolation # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 def on_dstr(node); end # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 def on_dsym(node); end # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#17 def on_node_with_interpolations(node); end # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 def on_regexp(node); end # source://rubocop//lib/rubocop/cop/mixin/interpolation.rb#9 def on_xstr(node); end end # This class auto-corrects lambda literal to method notation. # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#6 class RuboCop::Cop::LambdaLiteralToMethodCorrector # @return [LambdaLiteralToMethodCorrector] a new instance of LambdaLiteralToMethodCorrector # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#7 def initialize(block_node); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#13 def call(corrector); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#115 def arg_to_unparenthesized_call?; end # Returns the value of attribute arguments. # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#31 def arguments; end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#99 def arguments_begin_pos; end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#95 def arguments_end_pos; end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#107 def block_begin; end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#103 def block_end; end # Returns the value of attribute block_node. # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#31 def block_node; end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#56 def insert_arguments(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#40 def insert_separating_space(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#85 def lambda_arg_string; end # Returns the value of attribute method. # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#31 def method; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#89 def needs_separating_space?; end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#50 def remove_arguments(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#63 def remove_leading_whitespace(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#71 def remove_trailing_whitespace(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#33 def remove_unparenthesized_whitespace(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#76 def replace_delimiters(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#46 def replace_selector(corrector); end # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#111 def selector_end; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/lambda_literal_to_method_corrector.rb#131 def separating_space?; end end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#5 module RuboCop::Cop::Layout; end # Bare access modifiers (those not applying to specific methods) should be # indented as deep as method definitions, or as deep as the class/module # keyword, depending on configuration. # # @example EnforcedStyle: indent (default) # # bad # class Plumbus # private # def smooth; end # end # # # good # class Plumbus # private # def smooth; end # end # @example EnforcedStyle: outdent # # bad # class Plumbus # private # def smooth; end # end # # # good # class Plumbus # private # def smooth; end # end # # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#35 class RuboCop::Cop::Layout::AccessModifierIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#51 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#42 def on_block(node); end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#42 def on_class(node); end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#42 def on_module(node); end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#42 def on_sclass(node); end private # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#57 def check_body(body, node); end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#65 def check_modifier(send_node, end_range); end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#86 def expected_indent_offset; end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#82 def message(node); end # An offset that is not expected, but correct if the configuration is # changed. # # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#92 def unexpected_indent_offset; end end # source://rubocop//lib/rubocop/cop/layout/access_modifier_indentation.rb#40 RuboCop::Cop::Layout::AccessModifierIndentation::MSG = T.let(T.unsafe(nil), String) # Here we check if the arguments on a multi-line method # definition are aligned. # # @example EnforcedStyle: with_first_argument (default) # # good # # foo :bar, # :baz # # foo( # :bar, # :baz # ) # # # bad # # foo :bar, # :baz # # foo( # :bar, # :baz # ) # @example EnforcedStyle: with_fixed_indentation # # good # # foo :bar, # :baz # # # bad # # foo :bar, # :baz # # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#40 class RuboCop::Cop::Layout::ArgumentAlignment < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#57 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#49 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#49 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#71 def base_column(node, args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#67 def fixed_indentation?; end # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#63 def message(_node); end # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#82 def target_method_lineno(node); end end # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#43 RuboCop::Cop::Layout::ArgumentAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/argument_alignment.rb#46 RuboCop::Cop::Layout::ArgumentAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) # Here we check if the elements of a multi-line array literal are # aligned. # # @example EnforcedStyle: with_first_element (default) # # good # # array = [1, 2, 3, # 4, 5, 6] # array = ['run', # 'forrest', # 'run'] # # # bad # # array = [1, 2, 3, # 4, 5, 6] # array = ['run', # 'forrest', # 'run'] # @example EnforcedStyle: with_fixed_indentation # # good # # array = [1, 2, 3, # 4, 5, 6] # # # bad # # array = [1, 2, 3, # 4, 5, 6] # # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#36 class RuboCop::Cop::Layout::ArrayAlignment < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#52 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#45 def on_array(node); end private # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#66 def base_column(node, args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#62 def fixed_indentation?; end # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#58 def message(_node); end # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#77 def target_method_lineno(node); end end # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#39 RuboCop::Cop::Layout::ArrayAlignment::ALIGN_ELEMENTS_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/array_alignment.rb#42 RuboCop::Cop::Layout::ArrayAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) # This cop checks the indentation of the first line of the # right-hand-side of a multi-line assignment. # # The indentation of the remaining lines can be corrected with # other cops such as `IndentationConsistency` and `EndAlignment`. # # @example # # bad # value = # if foo # 'bar' # end # # # good # value = # if foo # 'bar' # end # # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#24 class RuboCop::Cop::Layout::AssignmentIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::CheckAssignment include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#40 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#31 def check_assignment(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#44 def leftmost_multiple_assignment(node); end end # source://rubocop//lib/rubocop/cop/layout/assignment_indentation.rb#28 RuboCop::Cop::Layout::AssignmentIndentation::MSG = T.let(T.unsafe(nil), String) # This cop checks whether the end keyword of `begin` is aligned properly. # # Two modes are supported through the `EnforcedStyleAlignWith` configuration # parameter. If it's set to `start_of_line` (which is the default), the # `end` shall be aligned with the start of the line where the `begin` # keyword is. If it's set to `begin`, the `end` shall be aligned with the # `begin` keyword. # # `Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`) # by default. On the other hand, `||= begin` that this cop targets tends to # align with the start of the line, it defaults to `EnforcedStyleAlignWith: start_of_line`. # These style can be configured by each cop. # # @example EnforcedStyleAlignWith: start_of_line (default) # # bad # foo ||= begin # do_something # end # # # good # foo ||= begin # do_something # end # @example EnforcedStyleAlignWith: begin # # bad # foo ||= begin # do_something # end # # # good # foo ||= begin # do_something # end # # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#41 class RuboCop::Cop::Layout::BeginEndAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::EndKeywordAlignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#48 def on_kwbegin(node); end private # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#66 def alignment_node(node); end # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#62 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#54 def check_begin_alignment(node); end end # source://rubocop//lib/rubocop/cop/layout/begin_end_alignment.rb#46 RuboCop::Cop::Layout::BeginEndAlignment::MSG = T.let(T.unsafe(nil), String) # This cop checks whether the end keywords are aligned properly for do # end blocks. # # Three modes are supported through the `EnforcedStyleAlignWith` # configuration parameter: # # `start_of_block` : the `end` shall be aligned with the # start of the line where the `do` appeared. # # `start_of_line` : the `end` shall be aligned with the # start of the line where the expression started. # # `either` (which is the default) : the `end` is allowed to be in either # location. The autofixer will default to `start_of_line`. # # @example EnforcedStyleAlignWith: either (default) # # bad # # foo.bar # .each do # baz # end # # # good # # variable = lambda do |i| # i # end # @example EnforcedStyleAlignWith: start_of_block # # bad # # foo.bar # .each do # baz # end # # # good # # foo.bar # .each do # baz # end # @example EnforcedStyleAlignWith: start_of_line # # bad # # foo.bar # .each do # baz # end # # # good # # foo.bar # .each do # baz # end # # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#64 class RuboCop::Cop::Layout::BlockAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#71 def block_end_align_target?(param0 = T.unsafe(nil), param1); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#80 def on_block(node); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#84 def style_parameter_name; end private # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#236 def add_space_before(corrector, loc, delta); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#212 def alt_start_msg(start_loc, source_line_column); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#159 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#100 def block_end_align_target(node); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#120 def check_block_alignment(start_node, block_node); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#184 def compute_do_source_line_column(node, end_loc); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#228 def compute_start_col(ancestor_node, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#115 def disqualified_parent?(parent, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#110 def end_align_target?(node, parent); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#172 def format_message(start_loc, end_loc, do_source_line_column, error_source_line_column); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#223 def format_source_line_column(source_line_column); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#204 def loc_to_source_line_column(loc); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#140 def register_offense(block_node, start_loc, end_loc, do_source_line_column); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#240 def remove_space_before(corrector, end_pos, delta); end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#90 def start_for_block_node(block_node); end end # source://rubocop//lib/rubocop/cop/layout/block_alignment.rb#69 RuboCop::Cop::Layout::BlockAlignment::MSG = T.let(T.unsafe(nil), String) # This cop checks whether the end statement of a do..end block # is on its own line. # # @example # # bad # blah do |i| # foo(i) end # # # good # blah do |i| # foo(i) # end # # # bad # blah { |i| # foo(i) } # # # good # blah { |i| # foo(i) # } # # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#27 class RuboCop::Cop::Layout::BlockEndNewline < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#41 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#32 def on_block(node); end private # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#54 def delimiter_range(node); end # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#50 def message(node); end end # source://rubocop//lib/rubocop/cop/layout/block_end_newline.rb#30 RuboCop::Cop::Layout::BlockEndNewline::MSG = T.let(T.unsafe(nil), String) # This cop checks how the ``when``s of a `case` expression # are indented in relation to its `case` or `end` keyword. # # It will register a separate offense for each misaligned `when`. # # @example # # If Layout/EndAlignment is set to keyword style (default) # # *case* and *end* should always be aligned to same depth, # # and therefore *when* should always be aligned to both - # # regardless of configuration. # # # bad for all styles # case n # when 0 # x * 2 # else # y / 3 # end # # # good for all styles # case n # when 0 # x * 2 # else # y / 3 # end # @example EnforcedStyle: case (default) # # if EndAlignment is set to other style such as # # start_of_line (as shown below), then *when* alignment # # configuration does have an effect. # # # bad # a = case n # when 0 # x * 2 # else # y / 3 # end # # # good # a = case n # when 0 # x * 2 # else # y / 3 # end # @example EnforcedStyle: end # # bad # a = case n # when 0 # x * 2 # else # y / 3 # end # # # good # a = case n # when 0 # x * 2 # else # y / 3 # end # # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#70 class RuboCop::Cop::Layout::CaseIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#78 def on_case(case_node); end private # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#131 def base_column(case_node, base); end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#88 def check_when(when_node); end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#120 def detect_incorrect_style(when_node); end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#107 def incorrect_style(when_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#99 def indent_one_step?; end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#103 def indentation_width; end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#145 def replacement(node); end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#138 def whitespace_range(node); end end # source://rubocop//lib/rubocop/cop/layout/case_indentation.rb#76 RuboCop::Cop::Layout::CaseIndentation::MSG = T.let(T.unsafe(nil), String) # Checks if the code style follows the ExpectedOrder configuration: # # `Categories` allows us to map macro names into a category. # # Consider an example of code style that covers the following order: # # * Module inclusion (include, prepend, extend) # * Constants # * Associations (has_one, has_many) # * Public attribute macros (attr_accessor, attr_writer, attr_reader) # * Other macros (validates, validate) # * Public class methods # * Initializer # * Public instance methods # * Protected attribute macros (attr_accessor, attr_writer, attr_reader) # * Protected instance methods # * Private attribute macros (attr_accessor, attr_writer, attr_reader) # * Private instance methods # # You can configure the following order: # # [source,yaml] # ---- # Layout/ClassStructure: # ExpectedOrder: # - module_inclusion # - constants # - association # - public_attribute_macros # - public_delegate # - macros # - public_class_methods # - initializer # - public_methods # - protected_attribute_macros # - protected_methods # - private_attribute_macros # - private_delegate # - private_methods # ---- # # Instead of putting all literals in the expected order, is also # possible to group categories of macros. Visibility levels are handled # automatically. # # [source,yaml] # ---- # Layout/ClassStructure: # Categories: # association: # - has_many # - has_one # attribute_macros: # - attr_accessor # - attr_reader # - attr_writer # macros: # - validates # - validate # module_inclusion: # - include # - prepend # - extend # ---- # # @example # # bad # # Expect extend be before constant # class Person < ApplicationRecord # has_many :orders # ANSWER = 42 # # extend SomeModule # include AnotherModule # end # # # good # class Person # # extend and include go first # extend SomeModule # include AnotherModule # # # inner classes # CustomError = Class.new(StandardError) # # # constants are next # SOME_CONSTANT = 20 # # # afterwards we have public attribute macros # attr_reader :name # # # followed by other macros (if any) # validates :name # # # then we have public delegate macros # delegate :to_s, to: :name # # # public class methods are next in line # def self.some_method # end # # # initialization goes between class methods and instance methods # def initialize # end # # # followed by other public instance methods # def some_method # end # # # protected attribute macros and methods go next # protected # # attr_reader :protected_name # # def some_protected_method # end # # # private attribute macros, delegate macros and methods # # are grouped near the end # private # # attr_reader :private_name # # delegate :some_private_delegate, to: :name # # def some_private_method # end # end # @see https://rubystyle.guide#consistent-classes # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#136 class RuboCop::Cop::Layout::ClassStructure < ::RuboCop::Cop::Base include ::RuboCop::Cop::VisibilityHelp extend ::RuboCop::Cop::AutoCorrector # Validates code style on class declaration. # Add offense when find a node out of expected order. # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#152 def on_class(class_node); end private # Autocorrect by swapping between two nodes autocorrecting them # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#170 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#272 def begin_pos_with_comment(node); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#287 def buffer; end # Setting categories hash allow you to group methods in group to match # in the {expected_order}. # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#299 def categories; end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#226 def class_elements(class_node); end # Classifies a node to match with something in the {expected_order} # # @param node to be analysed # @return String when the node type is a `:block` then # {classify} recursively with the first children # @return String when the node type is a `:send` then {find_category} # by method name # @return String otherwise trying to {humanize_node} of the current node # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#191 def classify(node); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#267 def end_position_for(node); end # Load expected order from `ExpectedOrder` config. # Define new terms in the expected order by adding new {categories}. # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#293 def expected_order; end # Categorize a node according to the {expected_order} # Try to match {categories} values against the node's method_name given # also its visibility. # # @param node to be analysed. # @return [String] with the key category or the `method_name` as string # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#209 def find_category(node); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#244 def humanize_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#238 def ignore?(classification); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#253 def source_range_with_comment(node); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#283 def start_line_position(node); end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#217 def walk_over_nested_class_definition(class_node); end end # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#140 RuboCop::Cop::Layout::ClassStructure::HUMANIZED_NODE_TYPE = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/layout/class_structure.rb#147 RuboCop::Cop::Layout::ClassStructure::MSG = T.let(T.unsafe(nil), String) # Checks the indentation of here document closings. # # @example # # # bad # class Foo # def bar # <<~SQL # 'Hi' # SQL # end # end # # # good # class Foo # def bar # <<~SQL # 'Hi' # SQL # end # end # # # bad # # # heredoc contents is before closing heredoc. # foo arg, # <<~EOS # Hi # EOS # # # good # foo arg, # <<~EOS # Hi # EOS # # # good # foo arg, # <<~EOS # Hi # EOS # # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#49 class RuboCop::Cop::Layout::ClosingHeredocIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Heredoc extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#58 def on_heredoc(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#75 def argument_indentation_correct?(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#83 def closing_indentation(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#102 def find_node_used_heredoc_argument(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#91 def heredoc_closing(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#87 def heredoc_opening(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#118 def indent_level(source_line); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#95 def indented_end(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#110 def message(node); end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#71 def opening_indentation(node); end end # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#54 RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#55 RuboCop::Cop::Layout::ClosingHeredocIndentation::MSG_ARG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/closing_heredoc_indentation.rb#53 RuboCop::Cop::Layout::ClosingHeredocIndentation::SIMPLE_HEREDOC = T.let(T.unsafe(nil), String) # This cop checks the indentation of hanging closing parentheses in # method calls, method definitions, and grouped expressions. A hanging # closing parenthesis means `)` preceded by a line break. # # @example # # # bad # some_method( # a, # b # ) # # some_method( # a, b # ) # # some_method(a, b, c # ) # # some_method(a, # b, # c # ) # # some_method(a, # x: 1, # y: 2 # ) # # # Scenario 1: When First Parameter Is On Its Own Line # # # good: when first param is on a new line, right paren is *always* # # outdented by IndentationWidth # some_method( # a, # b # ) # # # good # some_method( # a, b # ) # # # Scenario 2: When First Parameter Is On The Same Line # # # good: when all other params are also on the same line, outdent # # right paren by IndentationWidth # some_method(a, b, c # ) # # # good: when all other params are on multiple lines, but are lined # # up, align right paren with left paren # some_method(a, # b, # c # ) # # # good: when other params are not lined up on multiple lines, outdent # # right paren by IndentationWidth # some_method(a, # x: 1, # y: 2 # ) # # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#71 class RuboCop::Cop::Layout::ClosingParenthesisIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#92 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#83 def on_begin(node); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#78 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#87 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#87 def on_defs(node); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#78 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#159 def all_elements_aligned?(elements); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#98 def check(node, elements); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#106 def check_for_elements(node, elements); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#125 def check_for_no_elements(node); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#173 def correct_column_candidates(node, left_paren); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#145 def expected_column(left_paren, elements); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#166 def first_argument_line(elements); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#193 def indentation_width; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#197 def line_break_after_left_paren?(left_paren, elements); end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#181 def message(correct_column, left_paren, right_paren); end end # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#76 RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_ALIGN = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/closing_parenthesis_indentation.rb#74 RuboCop::Cop::Layout::ClosingParenthesisIndentation::MSG_INDENT = T.let(T.unsafe(nil), String) # This cop checks the indentation of comments. # # @example # # bad # # comment here # def method_name # end # # # comment here # a = 'hello' # # # yet another comment # if true # true # end # # # good # # comment here # def method_name # end # # # comment here # a = 'hello' # # # yet another comment # if true # true # end # # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#35 class RuboCop::Cop::Layout::CommentIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#45 def autocorrect(comment); end # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#41 def investigate(processed_source); end private # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#74 def autocorrect_one(comment); end # Corrects all comment lines that occur immediately before the given # comment and have the same indentation. This is to avoid a long chain # of correcting, saving the file, parsing and inspecting again, and # then correcting one more line, and so on. # # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#57 def autocorrect_preceding_comments(comment); end # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#78 def check(comment); end # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#120 def correct_indentation(next_line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#131 def less_indented?(line); end # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#115 def line_after_comment(comment); end # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#102 def message(column, correct_comment_indentation); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#110 def own_line_comment?(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#68 def should_correct?(preceding_comment, reference_comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#135 def two_alternatives?(line); end end # source://rubocop//lib/rubocop/cop/layout/comment_indentation.rb#38 RuboCop::Cop::Layout::CommentIndentation::MSG = T.let(T.unsafe(nil), String) # This cop checks for conditions that are not on the same line as # if/while/until. # # @example # # # bad # # if # some_condition # do_something # end # @example # # # good # # if some_condition # do_something # end # # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#25 class RuboCop::Cop::Layout::ConditionPosition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#31 def on_if(node); end # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#37 def on_until(node); end # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#37 def on_while(node); end private # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#44 def check(node); end # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#58 def message(condition); end end # source://rubocop//lib/rubocop/cop/layout/condition_position.rb#29 RuboCop::Cop::Layout::ConditionPosition::MSG = T.let(T.unsafe(nil), String) # This cop checks whether the end keywords of method definitions are # aligned properly. # # Two modes are supported through the EnforcedStyleAlignWith configuration # parameter. If it's set to `start_of_line` (which is the default), the # `end` shall be aligned with the start of the line where the `def` # keyword is. If it's set to `def`, the `end` shall be aligned with the # `def` keyword. # # @example EnforcedStyleAlignWith: start_of_line (default) # # bad # # private def foo # end # # # good # # private def foo # end # @example EnforcedStyleAlignWith: def # # bad # # private def foo # end # # # good # # private def foo # end # # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#36 class RuboCop::Cop::Layout::DefEndAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::EndKeywordAlignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#43 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#43 def on_defs(node); end # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#48 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#67 def autocorrect(corrector, node); end end # source://rubocop//lib/rubocop/cop/layout/def_end_alignment.rb#41 RuboCop::Cop::Layout::DefEndAlignment::MSG = T.let(T.unsafe(nil), String) # This cop checks the . position in multi-line method calls. # # @example EnforcedStyle: leading (default) # # bad # something. # method # # # good # something # .method # @example EnforcedStyle: trailing # # bad # something # .method # # # good # something. # method # # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#25 class RuboCop::Cop::Layout::DotPosition < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#29 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#29 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#100 def ampersand_dot?(node); end # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#46 def autocorrect(corrector, dot, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#88 def correct_dot_position_style?(dot_line, selector_line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#84 def line_between?(first_line, second_line); end # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#56 def message(dot); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#66 def proper_dot_position?(node); end # source://rubocop//lib/rubocop/cop/layout/dot_position.rb#95 def selector_range(node); end end # This cop checks the alignment of else keywords. Normally they should # be aligned with an if/unless/while/until/begin/def keyword, but there # are special cases when they should follow the same rules as the # alignment of end. # # @example # # bad # if something # code # else # code # end # # # bad # if something # code # elsif something # code # end # # # good # if something # code # else # code # end # # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#32 class RuboCop::Cop::Layout::ElseAlignment < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::EndKeywordAlignment include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::CheckAssignment # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#70 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#56 def on_case(node); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#62 def on_case_match(node); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#39 def on_if(node, base = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#50 def on_rescue(node); end private # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#101 def base_for_method_definition(node); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#81 def base_range_of_if(node, base); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#90 def base_range_of_rescue(node); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#126 def check_alignment(base_range, else_range); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#110 def check_assignment(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#76 def check_nested(node, base); end end # source://rubocop//lib/rubocop/cop/layout/else_alignment.rb#37 RuboCop::Cop::Layout::ElseAlignment::MSG = T.let(T.unsafe(nil), String) # This cop checks empty comment. # # @example # # bad # # # # class Foo # end # # # good # # # # # Description of `Foo` class. # # # class Foo # end # @example AllowBorderComment: true (default) # # good # # def foo # end # # ################# # # def bar # end # @example AllowBorderComment: false # # bad # # def foo # end # # ################# # # def bar # end # @example AllowMarginComment: true (default) # # good # # # # # Description of `Foo` class. # # # class Foo # end # @example AllowMarginComment: false # # bad # # # # # Description of `Foo` class. # # # class Foo # end # # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#63 class RuboCop::Cop::Layout::EmptyComment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#69 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#136 def allow_border_comment?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#140 def allow_margin_comment?; end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#99 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#132 def comment_text(comment); end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#112 def concat_consecutive_comments(comments); end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#144 def current_token(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#122 def empty_comment_only?(comment_text); end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#87 def investigate(comments); end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#150 def previous_token(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_comment.rb#67 RuboCop::Cop::Layout::EmptyComment::MSG = T.let(T.unsafe(nil), String) # This cop enforces empty line after guard clause # # @example # # # bad # def foo # return if need_return? # bar # end # # # good # def foo # return if need_return? # # bar # end # # # good # def foo # return if something? # return if something_different? # # bar # end # # # also good # def foo # if something? # do_something # return if need_return? # end # end # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#38 class RuboCop::Cop::Layout::EmptyLineAfterGuardClause < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#45 def on_if(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#67 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#84 def contains_guard_clause?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#77 def correct_style?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#146 def heredoc?(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#138 def heredoc_line(node, heredoc_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#113 def last_argument_is_heredoc?(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#120 def last_heredoc_argument(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#88 def next_line_empty?(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#92 def next_line_rescue_or_ensure?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#106 def next_sibling_empty_or_guard_clause?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#97 def next_sibling_parent_empty_or_else?(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#150 def offense_location(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#43 RuboCop::Cop::Layout::EmptyLineAfterGuardClause::END_OF_HEREDOC_LINE = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cop/layout/empty_line_after_guard_clause.rb#42 RuboCop::Cop::Layout::EmptyLineAfterGuardClause::MSG = T.let(T.unsafe(nil), String) # Checks for a newline after the final magic comment. # # @example # # good # # frozen_string_literal: true # # # Some documentation for Person # class Person # # Some code # end # # # bad # # frozen_string_literal: true # # Some documentation for Person # class Person # # Some code # end # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#23 class RuboCop::Cop::Layout::EmptyLineAfterMagicComment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#29 def on_new_investigation; end private # Find the last magic comment in the source file. # # Take all comments that precede the first line of code, select the # magic comments, and return the last magic comment in the file. # # @return [Parser::Source::Comment] if magic comments exist before code # @return [nil] otherwise # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#54 def last_magic_comment(source); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#43 def offending_range(last_magic_comment); end end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_magic_comment.rb#27 RuboCop::Cop::Layout::EmptyLineAfterMagicComment::MSG = T.let(T.unsafe(nil), String) # This cop enforces empty line after multiline condition. # # @example # # bad # if multiline && # condition # do_something # end # # # good # if multiline && # condition # # do_something # end # # # bad # case x # when foo, # bar # do_something # end # # # good # case x # when foo, # bar # # do_something # end # # # bad # begin # do_something # rescue FooError, # BarError # handle_error # end # # # good # begin # do_something # rescue FooError, # BarError # # handle_error # end # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#54 class RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#82 def on_case(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#60 def on_if(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#93 def on_rescue(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#70 def on_until(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#75 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#70 def on_while(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#75 def on_while_post(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#127 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#105 def check_condition(condition); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#120 def multiline_rescue_exceptions?(exception_nodes); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#116 def multiline_when_condition?(when_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#112 def next_line_empty?(line); end end # source://rubocop//lib/rubocop/cop/layout/empty_line_after_multiline_condition.rb#58 RuboCop::Cop::Layout::EmptyLineAfterMultilineCondition::MSG = T.let(T.unsafe(nil), String) # This cop checks whether method definitions are # separated by one empty line. # # `NumberOfEmptyLines` can be an integer (default is 1) or # an array (e.g. [1, 2]) to specify a minimum and maximum # number of empty lines permitted. # # `AllowAdjacentOneLineDefs` configures whether adjacent # one-line method definitions are considered an offense. # # @example # # # bad # def a # end # def b # end # @example # # # good # def a # end # # def b # end # # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#32 class RuboCop::Cop::Layout::EmptyLineBetweenDefs < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#66 def autocorrect(corrector, prev_def, node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#54 def check_defs(nodes); end # We operate on `begin` nodes, instead of using `OnMethodDef`, # so that we can walk over pairs of consecutive nodes and # efficiently access a node's predecessor; #prev_node ends up # doing a linear scan over siblings, so we don't want to call # it on each def. # # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#47 def on_begin(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#141 def autocorrect_insert_lines(corrector, newline_pos, count); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#134 def autocorrect_remove_lines(corrector, newline_pos, count); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#101 def blank_lines_between?(first_def_node, second_def_node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#106 def blank_lines_count_between(first_def_node, second_def_node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#130 def def_end(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#86 def def_node?(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#126 def def_start(node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#118 def lines_between_defs(first_def_node, second_def_node); end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#114 def maximum_empty_lines; end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#110 def minimum_empty_lines; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#92 def multiple_blank_lines_groups?(first_def_node, second_def_node); end class << self # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#38 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/layout/empty_line_between_defs.rb#36 RuboCop::Cop::Layout::EmptyLineBetweenDefs::MSG = T.let(T.unsafe(nil), String) # This cop checks for two or more consecutive blank lines. # # @example # # # bad - It has two empty lines. # some_method # # one empty line # # two empty lines # some_method # # # good # some_method # # one empty line # some_method # # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#21 class RuboCop::Cop::Layout::EmptyLines < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#28 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#45 def each_extra_empty_line(lines); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#63 def exceeds_line_offset?(line_diff); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#67 def previous_and_current_lines_empty?(line); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#26 RuboCop::Cop::Layout::EmptyLines::LINE_OFFSET = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cop/layout/empty_lines.rb#25 RuboCop::Cop::Layout::EmptyLines::MSG = T.let(T.unsafe(nil), String) # Access modifiers should be surrounded by blank lines. # # @example EnforcedStyle: around (default) # # # bad # class Foo # def bar; end # private # def baz; end # end # # # good # class Foo # def bar; end # # private # # def baz; end # end # @example EnforcedStyle: only_before # # # bad # class Foo # def bar; end # private # def baz; end # end # # # good # class Foo # def bar; end # # private # def baz; end # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#43 class RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # @return [EmptyLinesAroundAccessModifier] a new instance of EmptyLinesAroundAccessModifier # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#55 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#82 def on_block(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#61 def on_class(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#70 def on_module(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#75 def on_sclass(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#86 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#113 def allowed_only_before_style?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#167 def block_start?(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#173 def body_end?(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#161 def class_def?(line); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#122 def correct_next_line_if_denied_style(corrector, node, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#156 def empty_lines_around?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#102 def expected_empty_lines?(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#183 def message(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#192 def message_for_around_style(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#203 def message_for_only_before_style(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#179 def next_empty_line_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#150 def next_line_empty?(last_send_line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#141 def previous_line_empty?(send_line); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#135 def previous_line_ignoring_comments(processed_source, send_line); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#48 RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#53 RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_AFTER_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#49 RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_AND_AFTER = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_access_modifier.rb#52 RuboCop::Cop::Layout::EmptyLinesAroundAccessModifier::MSG_BEFORE_FOR_ONLY_BEFORE = T.let(T.unsafe(nil), String) # This cop checks if empty lines exist around the arguments # of a method invocation. # # @example # # bad # do_something( # foo # # ) # # process(bar, # # baz: qux, # thud: fred) # # some_method( # # [1,2,3], # x: y # ) # # # good # do_something( # foo # ) # # process(bar, # baz: qux, # thud: fred) # # some_method( # [1,2,3], # x: y # ) # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#41 class RuboCop::Cop::Layout::EmptyLinesAroundArguments < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#47 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#47 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#60 def empty_lines(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#66 def extra_lines(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#88 def inner_lines(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#79 def line_numbers(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#92 def outer_lines(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#73 def processed_lines(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_arguments.rb#45 RuboCop::Cop::Layout::EmptyLinesAroundArguments::MSG = T.let(T.unsafe(nil), String) # Checks for a newline after an attribute accessor or a group of them. # `alias` syntax and `alias_method`, `public`, `protected`, and `private` methods are allowed # by default. These are customizable with `AllowAliasSyntax` and `AllowedMethods` options. # # @example # # bad # attr_accessor :foo # def do_something # end # # # good # attr_accessor :foo # # def do_something # end # # # good # attr_accessor :foo # attr_reader :bar # attr_writer :baz # attr :qux # # def do_something # end # @example AllowAliasSyntax: true (default) # # good # attr_accessor :foo # alias :foo? :foo # # def do_something # end # @example AllowAliasSyntax: false # # bad # attr_accessor :foo # alias :foo? :foo # # def do_something # end # # # good # attr_accessor :foo # # alias :foo? :foo # # def do_something # end # @example AllowedMethods: ['private'] # # good # attr_accessor :foo # private :foo # # def do_something # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#63 class RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::AllowedMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#70 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#102 def allow_alias?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#112 def allow_alias_syntax?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#106 def attribute_or_allowed_method?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#86 def next_line_empty?(line); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#96 def next_line_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#90 def require_empty_line?(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_attribute_accessor.rb#68 RuboCop::Cop::Layout::EmptyLinesAroundAttributeAccessor::MSG = T.let(T.unsafe(nil), String) # This cop checks if empty lines exist around the bodies of begin-end # blocks. # # @example # # # good # # begin # # ... # end # # # bad # # begin # # # ... # # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#24 class RuboCop::Cop::Layout::EmptyLinesAroundBeginBody < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Layout::EmptyLinesAroundBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#30 def on_kwbegin(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#36 def style; end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_begin_body.rb#28 RuboCop::Cop::Layout::EmptyLinesAroundBeginBody::KIND = T.let(T.unsafe(nil), String) # This cop checks if empty lines around the bodies of blocks match # the configuration. # # @example EnforcedStyle: empty_lines # # good # # foo do |bar| # # # ... # # end # @example EnforcedStyle: no_empty_lines (default) # # good # # foo do |bar| # # ... # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#24 class RuboCop::Cop::Layout::EmptyLinesAroundBlockBody < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Layout::EmptyLinesAroundBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#30 def on_block(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_block_body.rb#28 RuboCop::Cop::Layout::EmptyLinesAroundBlockBody::KIND = T.let(T.unsafe(nil), String) # Common functionality for checking if presence/absence of empty lines # around some kind of body matches the configuration. # # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#8 module RuboCop::Cop::Layout::EmptyLinesAroundBody include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#21 def constant_definition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#22 def empty_line_required?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#25 def check(node, body, adjusted_first_line: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#80 def check_beginning(style, first_line); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#66 def check_both(style, first_line, last_line); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#109 def check_deferred_empty_line(body); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#42 def check_empty_lines_except_namespace(body, first_line, last_line); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#50 def check_empty_lines_special(body, first_line, last_line); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#84 def check_ending(style, last_line); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#99 def check_line(style, line, msg); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#88 def check_source(style, line_no, desc); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#160 def deferred_message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#133 def first_child_requires_empty_line?(body); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#141 def first_empty_line_required_child(body); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#156 def message(type, desc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#123 def namespace?(body, with_one_child: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#149 def previous_line_ignoring_comments(send_line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#164 def valid_body_style?(body); end end # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#16 RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_DEFERRED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#13 RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_EXTRA = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/empty_lines_around_body.rb#15 RuboCop::Cop::Layout::EmptyLinesAroundBody::MSG_MISSING = T.let(T.unsafe(nil), String) # This cop checks if empty lines around the bodies of classes match # the configuration. # # @example EnforcedStyle: empty_lines # # good # # class Foo # # def bar # # ... # end # # end # @example EnforcedStyle: empty_lines_except_namespace # # good # # class Foo # class Bar # # # ... # # end # end # @example EnforcedStyle: empty_lines_special # # good # class Foo # # def bar; end # # end # @example EnforcedStyle: beginning_only # # good # # class Foo # # def bar # # ... # end # end # @example EnforcedStyle: ending_only # # good # # class Foo # def bar # # ... # end # # end # @example EnforcedStyle: no_empty_lines (default) # # good # # class Foo # def bar # # ... # end # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#67 class RuboCop::Cop::Layout::EmptyLinesAroundClassBody < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Layout::EmptyLinesAroundBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#73 def on_class(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#79 def on_sclass(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_class_body.rb#71 RuboCop::Cop::Layout::EmptyLinesAroundClassBody::KIND = T.let(T.unsafe(nil), String) # This cop checks if empty lines exist around the bodies of `begin` # sections. This cop doesn't check empty lines at `begin` body # beginning/end and around method definition body. # `Style/EmptyLinesAroundBeginBody` or `Style/EmptyLinesAroundMethodBody` # can be used for this purpose. # # @example # # # good # # begin # do_something # rescue # do_something2 # else # do_something3 # ensure # do_something4 # end # # # good # # def foo # do_something # rescue # do_something2 # end # # # bad # # begin # do_something # # rescue # # do_something2 # # else # # do_something3 # # ensure # # do_something4 # end # # # bad # # def foo # do_something # # rescue # # do_something2 # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#61 class RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Layout::EmptyLinesAroundBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#67 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#67 def on_defs(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#72 def on_kwbegin(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#79 def check_body(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#102 def keyword_locations(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#122 def keyword_locations_in_ensure(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#115 def keyword_locations_in_rescue(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#94 def message(location, keyword); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#98 def style; end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_exception_handling_keywords.rb#65 RuboCop::Cop::Layout::EmptyLinesAroundExceptionHandlingKeywords::MSG = T.let(T.unsafe(nil), String) # This cop checks if empty lines exist around the bodies of methods. # # @example # # # good # # def foo # # ... # end # # # bad # # def bar # # # ... # # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#23 class RuboCop::Cop::Layout::EmptyLinesAroundMethodBody < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Layout::EmptyLinesAroundBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#29 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#29 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#36 def style; end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_method_body.rb#27 RuboCop::Cop::Layout::EmptyLinesAroundMethodBody::KIND = T.let(T.unsafe(nil), String) # This cop checks if empty lines around the bodies of modules match # the configuration. # # @example EnforcedStyle: empty_lines # # good # # module Foo # # def bar # # ... # end # # end # @example EnforcedStyle: empty_lines_except_namespace # # good # # module Foo # module Bar # # # ... # # end # end # @example EnforcedStyle: empty_lines_special # # good # module Foo # # def bar; end # # end # @example EnforcedStyle: no_empty_lines (default) # # good # # module Foo # def bar # # ... # end # end # # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_module_body.rb#47 class RuboCop::Cop::Layout::EmptyLinesAroundModuleBody < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::Layout::EmptyLinesAroundBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_module_body.rb#53 def on_module(node); end end # source://rubocop//lib/rubocop/cop/layout/empty_lines_around_module_body.rb#51 RuboCop::Cop::Layout::EmptyLinesAroundModuleBody::KIND = T.let(T.unsafe(nil), String) # This cop checks whether the end keywords are aligned properly. # # Three modes are supported through the `EnforcedStyleAlignWith` # configuration parameter: # # If it's set to `keyword` (which is the default), the `end` # shall be aligned with the start of the keyword (if, class, etc.). # # If it's set to `variable` the `end` shall be aligned with the # left-hand-side of the variable assignment, if there is one. # # If it's set to `start_of_line`, the `end` shall be aligned with the # start of the line where the matching keyword appears. # # This `Layout/EndAlignment` cop aligns with keywords (e.g. `if`, `while`, `case`) # by default. On the other hand, `Layout/BeginEndAlignment` cop aligns with # `EnforcedStyleAlignWith: start_of_line` by default due to `||= begin` tends # to align with the start of the line. These style can be configured by each cop. # # @example EnforcedStyleAlignWith: keyword (default) # # bad # # variable = if true # end # # # good # # variable = if true # end # # variable = # if true # end # @example EnforcedStyleAlignWith: variable # # bad # # variable = if true # end # # # good # # variable = if true # end # # variable = # if true # end # @example EnforcedStyleAlignWith: start_of_line # # bad # # variable = if true # end # # puts(if true # end) # # # good # # variable = if true # end # # puts(if true # end) # # variable = # if true # end # # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#75 class RuboCop::Cop::Layout::EndAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::CheckAssignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::EndKeywordAlignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#101 def on_case(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#81 def on_class(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#89 def on_if(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#85 def on_module(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#97 def on_until(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#93 def on_while(node); end private # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#156 def alignment_node(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#167 def alignment_node_for_variable_style(node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#137 def asgn_variable_align_with(outer_node, inner_node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#111 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#126 def check_asgn_alignment(outer_node, inner_node); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#115 def check_assignment(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/end_alignment.rb#147 def check_other_alignment(node); end end # This cop checks for Windows-style line endings in the source code. # # @example EnforcedStyle: native (default) # # The `native` style means that CR+LF (Carriage Return + Line Feed) is # # enforced on Windows, and LF is enforced on other platforms. # # # bad # puts 'Hello' # Return character is LF on Windows. # puts 'Hello' # Return character is CR+LF on other than Windows. # # # good # puts 'Hello' # Return character is CR+LF on Windows. # puts 'Hello' # Return character is LF on other than Windows. # @example EnforcedStyle: lf # # The `lf` style means that LF (Line Feed) is enforced on # # all platforms. # # # bad # puts 'Hello' # Return character is CR+LF on all platfoms. # # # good # puts 'Hello' # Return character is LF on all platfoms. # @example EnforcedStyle: crlf # # The `crlf` style means that CR+LF (Carriage Return + Line Feed) is # # enforced on all platforms. # # # bad # puts 'Hello' # Return character is LF on all platfoms. # # # good # puts 'Hello' # Return character is CR+LF on all platfoms. # # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#40 class RuboCop::Cop::Layout::EndOfLine < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#47 def investigate(processed_source); end # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#71 def offense_message(line); end # If there is no LF on the last line, we don't care if there's no CR. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#67 def unimportant_missing_cr?(index, last_line, line); end private # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#85 def last_line(processed_source); end end # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#44 RuboCop::Cop::Layout::EndOfLine::MSG_DETECTED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/end_of_line.rb#45 RuboCop::Cop::Layout::EndOfLine::MSG_MISSING = T.let(T.unsafe(nil), String) # This cop checks for extra/unnecessary whitespace. # # @example # # # good if AllowForAlignment is true # name = "RuboCop" # # Some comment and an empty line # # website += "/rubocop-hq/rubocop" unless cond # puts "rubocop" if debug # # # bad for any configuration # set_app("RuboCop") # website = "https://github.com/rubocop-hq/rubocop" # # # good only if AllowBeforeTrailingComments is true # object.method(arg) # this is a comment # # # good even if AllowBeforeTrailingComments is false or not set # object.method(arg) # this is a comment # # # good with either AllowBeforeTrailingComments or AllowForAlignment # object.method(arg) # this is a comment # another_object.method(arg) # this is another comment # some_object.method(arg) # this is some comment # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#31 class RuboCop::Cop::Layout::ExtraSpacing < ::RuboCop::Cop::Base include ::RuboCop::Cop::PrecedingFollowingAlignment include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#40 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#172 def align_column(asgn_token); end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#149 def align_equal_sign(corrector, token, align_to); end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#139 def align_equal_signs(range, corrector); end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#53 def aligned_locations(locs); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#109 def aligned_tok?(token); end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#161 def all_relevant_assignment_lines(line_number); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#181 def allow_for_trailing_comments?; end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#75 def check_assignment(token); end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#84 def check_other(token1, token2, ast); end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#65 def check_tokens(ast, token1, token2); end # @yield [range_between(start_pos, end_pos)] # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#97 def extra_space_range(token1, token2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#135 def force_equal_sign_alignment?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#117 def ignored_range?(ast, start_pos); end # Returns an array of ranges that should not be reported. It's the # extra spaces between the keys and values in a multiline hash, # since those are handled by the Layout/HashAlignment cop. # # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#124 def ignored_ranges(ast); end end # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#37 RuboCop::Cop::Layout::ExtraSpacing::MSG_UNALIGNED_ASGN = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/extra_spacing.rb#36 RuboCop::Cop::Layout::ExtraSpacing::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) # This cop checks the indentation of the first argument in a method call. # Arguments after the first one are checked by Layout/ArgumentAlignment, # not by this cop. # # For indenting the first parameter of method _definitions_, check out # Layout/FirstParameterIndentation. # # @example # # # bad # some_method( # first_param, # second_param) # # foo = some_method( # first_param, # second_param) # # foo = some_method(nested_call( # nested_first_param), # second_param) # # foo = some_method( # nested_call( # nested_first_param), # second_param) # # some_method nested_call( # nested_first_param), # second_param # @example EnforcedStyle: consistent # # The first argument should always be indented one step more than the # # preceding line. # # # good # some_method( # first_param, # second_param) # # foo = some_method( # first_param, # second_param) # # foo = some_method(nested_call( # nested_first_param), # second_param) # # foo = some_method( # nested_call( # nested_first_param), # second_param) # # some_method nested_call( # nested_first_param), # second_param # @example EnforcedStyle: consistent_relative_to_receiver # # The first argument should always be indented one level relative to # # the parent that is receiving the argument # # # good # some_method( # first_param, # second_param) # # foo = some_method( # first_param, # second_param) # # foo = some_method(nested_call( # nested_first_param), # second_param) # # foo = some_method( # nested_call( # nested_first_param), # second_param) # # some_method nested_call( # nested_first_param), # second_params # @example EnforcedStyle: special_for_inner_method_call # # The first argument should normally be indented one step more than # # the preceding line, but if it's a argument for a method call that # # is itself a argument in a method call, then the inner argument # # should be indented relative to the inner method. # # # good # some_method( # first_param, # second_param) # # foo = some_method( # first_param, # second_param) # # foo = some_method(nested_call( # nested_first_param), # second_param) # # foo = some_method( # nested_call( # nested_first_param), # second_param) # # some_method nested_call( # nested_first_param), # second_param # @example EnforcedStyle: special_for_inner_method_call_in_parentheses (default) # # Same as `special_for_inner_method_call` except that the special rule # # only applies if the outer method call encloses its arguments in # # parentheses. # # # good # some_method( # first_param, # second_param) # # foo = some_method( # first_param, # second_param) # # foo = some_method(nested_call( # nested_first_param), # second_param) # # foo = some_method( # nested_call( # nested_first_param), # second_param) # # some_method nested_call( # nested_first_param), # second_param # # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#144 class RuboCop::Cop::Layout::FirstArgumentIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#160 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#205 def eligible_method_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#151 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#151 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#182 def base_indentation(node); end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#209 def base_range(send_node, arg_node); end # Returns the column of the given range. For single line ranges, this # is simple. For ranges with line breaks, we look a the last code line. # # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#216 def column_of(range); end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#237 def comment_lines; end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#166 def message(arg_node); end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#245 def on_new_investigation; end # Takes the line number of a given code line and returns a string # containing the previous line that's not a comment line or a blank # line. # # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#228 def previous_code_line(line_number); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#190 def special_inner_call_indentation?(node); end end # source://rubocop//lib/rubocop/cop/layout/first_argument_indentation.rb#149 RuboCop::Cop::Layout::FirstArgumentIndentation::MSG = T.let(T.unsafe(nil), String) # This cop checks the indentation of the first element in an array literal # where the opening bracket and the first element are on separate lines. # The other elements' indentations are handled by the ArrayAlignment cop. # # By default, array literals that are arguments in a method call with # parentheses, and where the opening square bracket of the array is on the # same line as the opening parenthesis of the method call, shall have # their first element indented one step (two spaces) more than the # position inside the opening parenthesis. # # Other array literals shall have their first element indented one step # more than the start of the line where the opening square bracket is. # # This default style is called 'special_inside_parentheses'. Alternative # styles are 'consistent' and 'align_brackets'. Here are examples: # # @example EnforcedStyle: special_inside_parentheses (default) # # The `special_inside_parentheses` style enforces that the first # # element in an array literal where the opening bracket and first # # element are on separate lines is indented one step (two spaces) more # # than the position inside the opening parenthesis. # # #bad # array = [ # :value # ] # and_in_a_method_call([ # :no_difference # ]) # # #good # array = [ # :value # ] # but_in_a_method_call([ # :its_like_this # ]) # @example EnforcedStyle: consistent # # The `consistent` style enforces that the first element in an array # # literal where the opening bracket and the first element are on # # separate lines is indented the same as an array literal which is not # # defined inside a method call. # # #bad # # consistent # array = [ # :value # ] # but_in_a_method_call([ # :its_like_this # ]) # # #good # array = [ # :value # ] # and_in_a_method_call([ # :no_difference # ]) # @example EnforcedStyle: align_brackets # # The `align_brackets` style enforces that the opening and closing # # brackets are indented to the same position. # # #bad # # align_brackets # and_now_for_something = [ # :completely_different # ] # # #good # # align_brackets # and_now_for_something = [ # :completely_different # ] # # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#82 class RuboCop::Cop::Layout::FirstArrayElementIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineElementIndentation # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#101 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#90 def on_array(node); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#94 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#94 def on_send(node); end private # Returns the description of what the correct indentation is based on. # # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#139 def base_description(left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#107 def brace_alignment_style; end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#111 def check(array_node, left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#126 def check_right_bracket(right_bracket, left_bracket, left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#149 def message(base_description); end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#157 def msg(left_parenthesis); end end # source://rubocop//lib/rubocop/cop/layout/first_array_element_indentation.rb#87 RuboCop::Cop::Layout::FirstArrayElementIndentation::MSG = T.let(T.unsafe(nil), String) # This cop checks for a line break before the first element in a # multi-line array. # # @example # # # bad # [ :a, # :b] # # # good # [ # :a, # :b] # # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#20 class RuboCop::Cop::Layout::FirstArrayElementLineBreak < ::RuboCop::Cop::Base include ::RuboCop::Cop::FirstElementLineBreak extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#27 def on_array(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#35 def assignment_on_same_line?(node); end end # source://rubocop//lib/rubocop/cop/layout/first_array_element_line_break.rb#24 RuboCop::Cop::Layout::FirstArrayElementLineBreak::MSG = T.let(T.unsafe(nil), String) # This cop checks the indentation of the first key in a hash literal # where the opening brace and the first key are on separate lines. The # other keys' indentations are handled by the HashAlignment cop. # # By default, Hash literals that are arguments in a method call with # parentheses, and where the opening curly brace of the hash is on the # same line as the opening parenthesis of the method call, shall have # their first key indented one step (two spaces) more than the position # inside the opening parenthesis. # # Other hash literals shall have their first key indented one step more # than the start of the line where the opening curly brace is. # # This default style is called 'special_inside_parentheses'. Alternative # styles are 'consistent' and 'align_braces'. Here are examples: # # @example EnforcedStyle: special_inside_parentheses (default) # # The `special_inside_parentheses` style enforces that the first key # # in a hash literal where the opening brace and the first key are on # # separate lines is indented one step (two spaces) more than the # # position inside the opening parentheses. # # # bad # hash = { # key: :value # } # and_in_a_method_call({ # no: :difference # }) # # # good # special_inside_parentheses # hash = { # key: :value # } # but_in_a_method_call({ # its_like: :this # }) # @example EnforcedStyle: consistent # # The `consistent` style enforces that the first key in a hash # # literal where the opening brace and the first key are on # # separate lines is indented the same as a hash literal which is not # # defined inside a method call. # # # bad # hash = { # key: :value # } # but_in_a_method_call({ # its_like: :this # }) # # # good # hash = { # key: :value # } # and_in_a_method_call({ # no: :difference # }) # @example EnforcedStyle: align_braces # # The `align_brackets` style enforces that the opening and closing # # braces are indented to the same position. # # # bad # and_now_for_something = { # completely: :different # } # # # good # and_now_for_something = { # completely: :different # } # # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#80 class RuboCop::Cop::Layout::FirstHashElementIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineElementIndentation # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#99 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#92 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#88 def on_hash(node); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#92 def on_send(node); end private # Returns the description of what the correct indentation is based on. # # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#164 def base_description(left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#105 def brace_alignment_style; end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#109 def check(hash_node, left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#155 def check_based_on_longest_key(hash_node, left_brace, left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#129 def check_right_brace(right_brace, left_brace, left_parenthesis); end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#174 def message(base_description); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#149 def separator_style?(first_pair); end end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_indentation.rb#85 RuboCop::Cop::Layout::FirstHashElementIndentation::MSG = T.let(T.unsafe(nil), String) # This cop checks for a line break before the first element in a # multi-line hash. # # @example # # # bad # { a: 1, # b: 2} # # # good # { # a: 1, # b: 2 } # # source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#19 class RuboCop::Cop::Layout::FirstHashElementLineBreak < ::RuboCop::Cop::Base include ::RuboCop::Cop::FirstElementLineBreak extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#26 def on_hash(node); end end # source://rubocop//lib/rubocop/cop/layout/first_hash_element_line_break.rb#23 RuboCop::Cop::Layout::FirstHashElementLineBreak::MSG = T.let(T.unsafe(nil), String) # This cop checks for a line break before the first argument in a # multi-line method call. # # @example # # # bad # method(foo, bar, # baz) # # # good # method( # foo, bar, # baz) # # # ignored # method foo, bar, # baz # # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#23 class RuboCop::Cop::Layout::FirstMethodArgumentLineBreak < ::RuboCop::Cop::Base include ::RuboCop::Cop::FirstElementLineBreak extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#30 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#30 def on_send(node); end # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#30 def on_super(node); end end # source://rubocop//lib/rubocop/cop/layout/first_method_argument_line_break.rb#27 RuboCop::Cop::Layout::FirstMethodArgumentLineBreak::MSG = T.let(T.unsafe(nil), String) # This cop checks for a line break before the first parameter in a # multi-line method parameter definition. # # @example # # # bad # def method(foo, bar, # baz) # do_something # end # # # good # def method( # foo, bar, # baz) # do_something # end # # # ignored # def method foo, # bar # do_something # end # # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#29 class RuboCop::Cop::Layout::FirstMethodParameterLineBreak < ::RuboCop::Cop::Base include ::RuboCop::Cop::FirstElementLineBreak extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#36 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#36 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/layout/first_method_parameter_line_break.rb#33 RuboCop::Cop::Layout::FirstMethodParameterLineBreak::MSG = T.let(T.unsafe(nil), String) # This cop checks the indentation of the first parameter in a method # definition. Parameters after the first one are checked by # Layout/ParameterAlignment, not by this cop. # # For indenting the first argument of method _calls_, check out # Layout/FirstArgumentIndentation, which supports options related to # nesting that are irrelevant for method _definitions_. # # @example # # # bad # def some_method( # first_param, # second_param) # 123 # end # @example EnforcedStyle: consistent (default) # # The first parameter should always be indented one step more than the # # preceding line. # # # good # def some_method( # first_param, # second_param) # 123 # end # @example EnforcedStyle: align_parentheses # # The first parameter should always be indented one step more than the # # opening parenthesis. # # # good # def some_method( # first_param, # second_param) # 123 # end # # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#44 class RuboCop::Cop::Layout::FirstParameterIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineElementIndentation # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#60 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#52 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#52 def on_defs(node); end private # Returns the description of what the correct indentation is based on. # # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#82 def base_description(_); end # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#66 def brace_alignment_style; end # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#70 def check(def_node); end # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#90 def message(base_description); end end # source://rubocop//lib/rubocop/cop/layout/first_parameter_indentation.rb#49 RuboCop::Cop::Layout::FirstParameterIndentation::MSG = T.let(T.unsafe(nil), String) # Check that the keys, separators, and values of a multi-line hash # literal are aligned according to configuration. The configuration # options are: # # * key (left align keys, one space before hash rockets and values) # * separator (align hash rockets and colons, right align keys) # * table (left align keys, hash rockets, and values) # # The treatment of hashes passed as the last argument to a method call # can also be configured. The options are: # # * always_inspect # * always_ignore # * ignore_implicit (without curly braces) # # Alternatively you can specify multiple allowed styles. That's done by # passing a list of styles to EnforcedStyles. # # @example EnforcedHashRocketStyle: key (default) # # bad # { # :foo => bar, # :ba => baz # } # { # :foo => bar, # :ba => baz # } # # # good # { # :foo => bar, # :ba => baz # } # @example EnforcedHashRocketStyle: separator # # bad # { # :foo => bar, # :ba => baz # } # { # :foo => bar, # :ba => baz # } # # # good # { # :foo => bar, # :ba => baz # } # @example EnforcedHashRocketStyle: table # # bad # { # :foo => bar, # :ba => baz # } # # # good # { # :foo => bar, # :ba => baz # } # @example EnforcedColonStyle: key (default) # # bad # { # foo: bar, # ba: baz # } # { # foo: bar, # ba: baz # } # # # good # { # foo: bar, # ba: baz # } # @example EnforcedColonStyle: separator # # bad # { # foo: bar, # ba: baz # } # # # good # { # foo: bar, # ba: baz # } # @example EnforcedColonStyle: table # # bad # { # foo: bar, # ba: baz # } # # # good # { # foo: bar, # ba: baz # } # @example EnforcedLastArgumentHashStyle: always_inspect (default) # # Inspect both implicit and explicit hashes. # # # bad # do_something(foo: 1, # bar: 2) # # # bad # do_something({foo: 1, # bar: 2}) # # # good # do_something(foo: 1, # bar: 2) # # # good # do_something( # foo: 1, # bar: 2 # ) # # # good # do_something({foo: 1, # bar: 2}) # # # good # do_something({ # foo: 1, # bar: 2 # }) # @example EnforcedLastArgumentHashStyle: always_ignore # # Ignore both implicit and explicit hashes. # # # good # do_something(foo: 1, # bar: 2) # # # good # do_something({foo: 1, # bar: 2}) # @example EnforcedLastArgumentHashStyle: ignore_implicit # # Ignore only implicit hashes. # # # bad # do_something({foo: 1, # bar: 2}) # # # good # do_something(foo: 1, # bar: 2) # @example EnforcedLastArgumentHashStyle: ignore_explicit # # Ignore only explicit hashes. # # # bad # do_something(foo: 1, # bar: 2) # # # good # do_something({foo: 1, # bar: 2}) # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#178 class RuboCop::Cop::Layout::HashAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::HashAlignmentStyles include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # Returns the value of attribute column_deltas. # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#216 def column_deltas; end # Sets the attribute column_deltas # # @param value the value to set the attribute column_deltas to. # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#216 def column_deltas=(_arg0); end # Returns the value of attribute offences_by. # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#216 def offences_by; end # Sets the attribute offences_by # # @param value the value to set the attribute offences_by to. # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#216 def offences_by=(_arg0); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#204 def on_hash(node); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#190 def on_send(node); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#190 def on_super(node); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#190 def on_yield(node); end private # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#248 def add_offences; end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#347 def adjust(corrector, delta, range); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#276 def alignment_for(pair); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#289 def alignment_for_colons; end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#284 def alignment_for_hash_rockets; end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#259 def check_delta(delta, node:, alignment:); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#229 def check_pairs(node); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#313 def correct_key_value(corrector, delta, key, value, separator); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#309 def correct_no_value(corrector, key_delta, key); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#294 def correct_node(corrector, node, delta); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#225 def double_splat?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#356 def good_alignment?(column_deltas); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#267 def ignore_hash_argument?(node); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#329 def new_alignment(key); end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#220 def reset!; end end # source://rubocop//lib/rubocop/cop/layout/hash_alignment.rb#183 RuboCop::Cop::Layout::HashAlignment::MESSAGES = T.let(T.unsafe(nil), Hash) # This cop checks for the placement of the closing parenthesis # in a method call that passes a HEREDOC string as an argument. # It should be placed at the end of the line containing the # opening HEREDOC tag. # # @example # # bad # # foo(<<-SQL # bar # SQL # ) # # foo(<<-SQL, 123, <<-NOSQL, # bar # SQL # baz # NOSQL # ) # # foo( # bar(<<-SQL # baz # SQL # ), # 123, # ) # # # good # # foo(<<-SQL) # bar # SQL # # foo(<<-SQL, 123, <<-NOSQL) # bar # SQL # baz # NOSQL # # foo( # bar(<<-SQL), # baz # SQL # 123, # ) # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#53 class RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#64 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#168 def add_correct_closing_paren(node, corrector); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#246 def add_correct_external_trailing_comma(node, corrector); end # Autocorrection note: # # Commas are a bit tricky to handle when the method call is # embedded in another expression. Here's an example: # # [ # first_array_value, # foo(<<-SQL, 123, 456, # SELECT * FROM db # SQL # ), # third_array_value, # ] # # The "internal" trailing comma is after `456`. # The "external" trailing comma is after `)`. # # To autocorrect, we remove the latter, and move the former up: # # [ # first_array_value, # foo(<<-SQL, 123, 456), # SELECT * FROM db # SQL # third_array_value, # ] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#106 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#264 def external_trailing_comma?(node); end # Returns nil if no trailing external comma. # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#269 def external_trailing_comma_offset_from_loc_end(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#138 def extract_heredoc(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#132 def extract_heredoc_argument(node); end # Closing parenthesis helpers. # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#163 def fix_closing_parenthesis(node, corrector); end # External trailing comma helpers. # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#241 def fix_external_trailing_comma(node, corrector); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#150 def heredoc_node?(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#181 def incorrect_parenthesis_removal_begin(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#197 def incorrect_parenthesis_removal_end(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#219 def internal_trailing_comma?(node); end # Returns nil if no trailing internal comma. # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#224 def internal_trailing_comma_offset_from_last_arg(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#114 def outermost_send_on_same_line(heredoc); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#172 def remove_incorrect_closing_paren(node, corrector); end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#252 def remove_incorrect_external_trailing_comma(node, corrector); end # Internal trailing comma helpers. # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#208 def remove_internal_trailing_comma(node, corrector); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#191 def safe_to_remove_line_containing_closing_paren?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#125 def send_missing_closing_parens?(parent, child, heredoc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#154 def single_line_send_with_heredoc_receiver?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#280 def space?(pos); end class << self # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#60 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/layout/heredoc_argument_closing_parenthesis.rb#57 RuboCop::Cop::Layout::HeredocArgumentClosingParenthesis::MSG = T.let(T.unsafe(nil), String) # This cop checks the indentation of the here document bodies. The bodies # are indented one step. # # Note: When ``Layout/LineLength``'s `AllowHeredoc` is false (not default), # this cop does not add any offenses for long here documents to # avoid `Layout/LineLength`'s offenses. # # @example # # bad # <<-RUBY # something # RUBY # # # good # <<~RUBY # something # RUBY # # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#24 class RuboCop::Cop::Layout::HeredocIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Heredoc extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#32 def on_heredoc(node); end private # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#119 def adjust_minus(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#114 def adjust_squiggly(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#144 def base_indent_level(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#166 def heredoc_body(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#170 def heredoc_end(node); end # Returns '~', '-' or nil # # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#158 def heredoc_indent_type(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#150 def indent_level(str); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#162 def indentation_width; end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#125 def indented_body(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#133 def indented_end(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#90 def line_too_long?(node); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#102 def longest_line(lines); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#110 def max_line_length; end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#65 def message(heredoc_indent_type); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#53 def register_offense(node, heredoc_indent_type); end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#75 def type_message(indentation_width, current_indent_type); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#106 def unlimited_heredoc_length?; end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#83 def width_message(indentation_width); end end # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#28 RuboCop::Cop::Layout::HeredocIndentation::TYPE_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/heredoc_indentation.rb#30 RuboCop::Cop::Layout::HeredocIndentation::WIDTH_MSG = T.let(T.unsafe(nil), String) # This cop checks for inconsistent indentation. # # The difference between `indented_internal_methods` and `normal` is # that the `indented_internal_methods` style prescribes that in # classes and modules the `protected` and `private` modifier keywords # shall be indented the same as public methods and that protected and # private members shall be indented one step more than the modifiers. # Other than that, both styles mean that entities on the same logical # depth shall have the same indentation. # # @example EnforcedStyle: normal (default) # # bad # class A # def test # puts 'hello' # puts 'world' # end # end # # # bad # class A # def test # puts 'hello' # puts 'world' # end # # protected # # def foo # end # # private # # def bar # end # end # # # good # class A # def test # puts 'hello' # puts 'world' # end # end # # # good # class A # def test # puts 'hello' # puts 'world' # end # # protected # # def foo # end # # private # # def bar # end # end # @example EnforcedStyle: indented_internal_methods # # bad # class A # def test # puts 'hello' # puts 'world' # end # end # # # bad # class A # def test # puts 'hello' # puts 'world' # end # # protected # # def foo # end # # private # # def bar # end # end # # # good # class A # def test # puts 'hello' # puts 'world' # end # end # # # good # class A # def test # puts 'hello' # puts 'world' # end # # protected # # def foo # end # # private # # def bar # end # end # # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#121 class RuboCop::Cop::Layout::IndentationConsistency < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#135 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#127 def on_begin(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#131 def on_kwbegin(node); end private # Not all nodes define `bare_access_modifier?` (for example, # `RuboCop::AST::DefNode` does not), so we must check `send_type?` first # to avoid a NoMethodError. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#144 def bare_access_modifier?(node); end # Returns an integer representing the correct indentation, or nil to # indicate that the correct indentation is that of the first child that # is not an access modifier. # # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#151 def base_column_for_normal_style(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#169 def check(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#184 def check_indented_internal_methods_style(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#177 def check_normal_style(node); end end # source://rubocop//lib/rubocop/cop/layout/indentation_consistency.rb#125 RuboCop::Cop::Layout::IndentationConsistency::MSG = T.let(T.unsafe(nil), String) # This cop checks that the indentation method is consistent. # Either tabs only or spaces only are used for indentation. # # @example EnforcedStyle: spaces (default) # # bad # # This example uses a tab to indent bar. # def foo # bar # end # # # good # # This example uses spaces to indent bar. # def foo # bar # end # @example EnforcedStyle: tabs # # bad # # This example uses spaces to indent bar. # def foo # bar # end # # # good # # This example uses a tab to indent bar. # def foo # bar # end # # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#34 class RuboCop::Cop::Layout::IndentationStyle < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#57 def autocorrect(range); end # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#41 def investigate(processed_source); end private # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#82 def autocorrect_lambda_for_spaces(range); end # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#75 def autocorrect_lambda_for_tabs(range); end # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#67 def find_offence(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#90 def in_string_literal?(ranges, tabs_range); end # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#109 def message(_node); end # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#94 def string_literal_ranges(ast); end end # source://rubocop//lib/rubocop/cop/layout/indentation_style.rb#39 RuboCop::Cop::Layout::IndentationStyle::MSG = T.let(T.unsafe(nil), String) # This cop checks for indentation that doesn't use the specified number # of spaces. # # See also the IndentationConsistency cop which is the companion to this # one. # # @example # # bad # class A # def test # puts 'hello' # end # end # # # good # class A # def test # puts 'hello' # end # end # @example IgnoredPatterns: ['^\s*module'] # # bad # module A # class B # def test # puts 'hello' # end # end # end # # # good # module A # class B # def test # puts 'hello' # end # end # end # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#45 class RuboCop::Cop::Layout::IndentationWidth < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::EndKeywordAlignment include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::CheckAssignment include ::RuboCop::Cop::IgnoredPattern # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#55 def access_modifier?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#147 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#79 def on_block(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#131 def on_case(case_node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#91 def on_class(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#97 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#114 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#114 def on_defs(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#64 def on_ensure(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#64 def on_for(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#140 def on_if(node, base = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#71 def on_kwbegin(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#91 def on_module(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#64 def on_resbody(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#59 def on_rescue(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#91 def on_sclass(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#97 def on_send(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#121 def on_until(node, base = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#121 def on_while(node, base = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#212 def access_modifier_indentation_style; end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#220 def check_assignment(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#240 def check_if(node, body, else_clause, base_loc); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#253 def check_indentation(base_loc, body_node, style = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#153 def check_members(base, members); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#177 def check_members_for_indented_internal_methods_style(members); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#184 def check_members_for_normal_style(base, members); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#350 def configured_indentation_width; end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#192 def each_member(members); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#216 def indentation_consistency_style; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#307 def indentation_to_check?(base_loc, body_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#204 def indented_internal_methods_style?; end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#354 def leftmost_modifier_of(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#286 def message(configured_indentation_width, indentation, name); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#333 def offending_range(body_node, indentation); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#263 def offense(body_node, indentation, style); end # Returns true if the given node is within another node that has # already been marked for auto-correction by this cop. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#297 def other_offense_in_same_range?(node); end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#165 def select_check_member(member); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#318 def skip_check?(base_loc, body_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#208 def special_modifier?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#341 def starts_with_access_modifier?(body_node); end end # source://rubocop//lib/rubocop/cop/layout/indentation_width.rb#52 RuboCop::Cop::Layout::IndentationWidth::MSG = T.let(T.unsafe(nil), String) # This cop checks for indentation of the first non-blank non-comment # line in a file. # # @example # # bad # class A # def foo; end # end # # # good # class A # def foo; end # end # # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#20 class RuboCop::Cop::Layout::InitialIndentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#26 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#36 def first_token; end # @yield [range_between(space_range.begin_pos, token.begin_pos)] # # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#40 def space_before(token); end end # source://rubocop//lib/rubocop/cop/layout/initial_indentation.rb#24 RuboCop::Cop::Layout::InitialIndentation::MSG = T.let(T.unsafe(nil), String) # This cop checks whether comments have a leading space after the # `#` denoting the start of the comment. The leading space is not # required for some RDoc special syntax, like `#++`, `#--`, # `#:nodoc`, `=begin`- and `=end` comments, "shebang" directives, # or rackup options. # # @example # # # bad # #Some comment # # # good # # Some comment # @example AllowDoxygenCommentStyle: false (default) # # # bad # # #** # # Some comment # # Another line of comment # #* # @example AllowDoxygenCommentStyle: true # # # good # # #** # # Some comment # # Another line of comment # #* # @example AllowGemfileRubyComment: false (default) # # # bad # # #ruby=2.7.0 # #ruby-gemset=myproject # @example AllowGemfileRubyComment: true # # # good # # #ruby=2.7.0 # #ruby-gemset=myproject # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#52 class RuboCop::Cop::Layout::LeadingCommentSpace < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#58 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#95 def allow_doxygen_comment?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#103 def allow_gemfile_ruby_comment?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#79 def allowed_on_first_line?(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#99 def doxygen_comment_style?(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#107 def gemfile?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#115 def gemfile_ruby_comment?(comment); end # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#75 def hash_mark(expr); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#91 def rackup_config_file?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#87 def rackup_options?(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#111 def ruby_comment_in_gemfile?(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#83 def shebang?(comment); end end # source://rubocop//lib/rubocop/cop/layout/leading_comment_space.rb#56 RuboCop::Cop::Layout::LeadingCommentSpace::MSG = T.let(T.unsafe(nil), String) # This cop checks for unnecessary leading blank lines at the beginning # of a file. # # @example # # # bad # # (start of file) # # class Foo # end # # # bad # # (start of file) # # # a comment # # # good # # (start of file) # class Foo # end # # # good # # (start of file) # # a comment # # source://rubocop//lib/rubocop/cop/layout/leading_empty_lines.rb#30 class RuboCop::Cop::Layout::LeadingEmptyLines < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/leading_empty_lines.rb#35 def on_new_investigation; end end # source://rubocop//lib/rubocop/cop/layout/leading_empty_lines.rb#33 RuboCop::Cop::Layout::LeadingEmptyLines::MSG = T.let(T.unsafe(nil), String) # This cop checks the length of lines in the source code. # The maximum length is configurable. # The tab size is configured in the `IndentationWidth` # of the `Layout/IndentationStyle` cop. # It also ignores a shebang line by default. # # This cop has some autocorrection capabilities. # It can programmatically shorten certain long lines by # inserting line breaks into expressions that can be safely # split across lines. These include arrays, hashes, and # method calls with argument lists. # # If autocorrection is enabled, the following Layout cops # are recommended to further format the broken lines. # (Many of these are enabled by default.) # # * ArgumentAlignment # * BlockAlignment # * BlockDelimiters # * BlockEndNewline # * ClosingParenthesisIndentation # * FirstArgumentIndentation # * FirstArrayElementIndentation # * FirstHashElementIndentation # * FirstParameterIndentation # * HashAlignment # * IndentationWidth # * MultilineArrayLineBreaks # * MultilineBlockLayout # * MultilineHashBraceLayout # * MultilineHashKeyLineBreaks # * MultilineMethodArgumentLineBreaks # * ParameterAlignment # # Together, these cops will pretty print hashes, arrays, # method calls, etc. For example, let's say the max columns # is 25: # # @example # # # bad # {foo: "0000000000", bar: "0000000000", baz: "0000000000"} # # # good # {foo: "0000000000", # bar: "0000000000", baz: "0000000000"} # # # good (with recommended cops enabled) # { # foo: "0000000000", # bar: "0000000000", # baz: "0000000000", # } # # source://rubocop//lib/rubocop/cop/layout/line_length.rb#61 class RuboCop::Cop::Layout::LineLength < ::RuboCop::Cop::Cop include ::RuboCop::Cop::CheckLineBreakable include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::IgnoredPattern include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::LineLengthHelp # source://rubocop//lib/rubocop/cop/layout/line_length.rb#91 def autocorrect(range); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#81 def investigate(processed_source); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#85 def investigate_post_walk(processed_source); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 def on_array(node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#70 def on_block(node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 def on_hash(node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 def on_potential_breakable_node(node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#74 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/line_length.rb#219 def allow_heredoc?; end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#223 def allowed_heredoc; end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#133 def breakable_block_range(block_node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#141 def breakable_range_after_semicolon(semicolon_token); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#154 def breakable_range_by_line_index; end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#252 def check_directive_line(line, line_index); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#122 def check_for_breakable_block(block_node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#101 def check_for_breakable_node(node); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#114 def check_for_breakable_semicolons(processed_source); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#169 def check_line(line, line_index); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#267 def check_uri_line(line, line_index); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#204 def excess_range(uri_range, line, line_index); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#227 def extract_heredocs(ast); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#158 def heredocs; end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#162 def highlight_start(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/line_length.rb#185 def ignored_line?(line, line_index); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/line_length.rb#246 def line_in_heredoc?(line_number); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/line_length.rb#237 def line_in_permitted_heredoc?(line_number); end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#215 def max; end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#195 def register_offense(loc, line, line_index); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/line_length.rb#191 def shebang?(line, line_index); end end # source://rubocop//lib/rubocop/cop/layout/line_length.rb#68 RuboCop::Cop::Layout::LineLength::MSG = T.let(T.unsafe(nil), String) # This cop checks that the closing brace in an array literal is either # on the same line as the last array element or on a new line. # # When using the `symmetrical` (default) style: # # If an array's opening brace is on the same line as the first element # of the array, then the closing brace should be on the same line as # the last element of the array. # # If an array's opening brace is on the line above the first element # of the array, then the closing brace should be on the line below # the last element of the array. # # When using the `new_line` style: # # The closing brace of a multi-line array literal must be on the line # after the last element of the array. # # When using the `same_line` style: # # The closing brace of a multi-line array literal must be on the same # line as the last element of the array. # # @example EnforcedStyle: symmetrical (default) # # bad # [ :a, # :b # ] # # # bad # [ # :a, # :b ] # # # good # [ :a, # :b ] # # # good # [ # :a, # :b # ] # @example EnforcedStyle: new_line # # bad # [ # :a, # :b ] # # # bad # [ :a, # :b ] # # # good # [ :a, # :b # ] # # # good # [ # :a, # :b # ] # @example EnforcedStyle: same_line # # bad # [ :a, # :b # ] # # # bad # [ # :a, # :b # ] # # # good # [ # :a, # :b ] # # # good # [ :a, # :b ] # # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#91 class RuboCop::Cop::Layout::MultilineArrayBraceLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineLiteralBraceLayout extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#109 def on_array(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#103 RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#106 RuboCop::Cop::Layout::MultilineArrayBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#99 RuboCop::Cop::Layout::MultilineArrayBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_array_brace_layout.rb#95 RuboCop::Cop::Layout::MultilineArrayBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # This cop ensures that each item in a multi-line array # starts on a separate line. # # @example # # # bad # [ # a, b, # c # ] # # # good # [ # a, # b, # c # ] # # source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#23 class RuboCop::Cop::Layout::MultilineArrayLineBreaks < ::RuboCop::Cop::Base include ::RuboCop::Cop::MultilineElementLineBreaks extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#30 def on_array(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_array_line_breaks.rb#27 RuboCop::Cop::Layout::MultilineArrayLineBreaks::MSG = T.let(T.unsafe(nil), String) # This cop checks whether the multiline assignments have a newline # after the assignment operator. # # @example EnforcedStyle: new_line (default) # # bad # foo = if expression # 'bar' # end # # # good # foo = # if expression # 'bar' # end # # # good # foo = # begin # compute # rescue => e # nil # end # @example EnforcedStyle: same_line # # good # foo = if expression # 'bar' # end # # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#34 class RuboCop::Cop::Layout::MultilineAssignmentLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::CheckAssignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#46 def check_assignment(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#55 def check_by_enforced_style(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#64 def check_new_line_offense(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#72 def check_same_line_offense(node, rhs); end private # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#85 def supported_types; end end # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#40 RuboCop::Cop::Layout::MultilineAssignmentLayout::NEW_LINE_OFFENSE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_assignment_layout.rb#43 RuboCop::Cop::Layout::MultilineAssignmentLayout::SAME_LINE_OFFENSE = T.let(T.unsafe(nil), String) # This cop checks whether the multiline do end blocks have a newline # after the start of the block. Additionally, it checks whether the block # arguments, if any, are on the same line as the start of the # block. Putting block arguments on separate lines, because the whole # line would otherwise be too long, is accepted. # # @example # # bad # blah do |i| foo(i) # bar(i) # end # # # bad # blah do # |i| foo(i) # bar(i) # end # # # good # blah do |i| # foo(i) # bar(i) # end # # # bad # blah { |i| foo(i) # bar(i) # } # # # good # blah { |i| # foo(i) # bar(i) # } # # # good # blah { | # long_list, # of_parameters, # that_would_not, # fit_on_one_line # | # foo(i) # bar(i) # } # # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#51 class RuboCop::Cop::Layout::MultilineBlockLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#61 def on_block(node); end private # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#100 def add_offense_for_expression(node, expr, msg); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#76 def args_on_beginning_line?(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#109 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#124 def autocorrect_arguments(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#135 def autocorrect_body(corrector, node, block_body); end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#148 def block_arg_string(node, args); end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#92 def characters_needed_for_space_and_pipes(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#160 def include_trailing_comma?(args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#81 def line_break_necessary_in_args?(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#85 def needed_length_for_args(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#57 RuboCop::Cop::Layout::MultilineBlockLayout::ARG_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#55 RuboCop::Cop::Layout::MultilineBlockLayout::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_block_layout.rb#59 RuboCop::Cop::Layout::MultilineBlockLayout::PIPE_SIZE = T.let(T.unsafe(nil), Integer) # This cop checks that the closing brace in a hash literal is either # on the same line as the last hash element, or a new line. # # When using the `symmetrical` (default) style: # # If a hash's opening brace is on the same line as the first element # of the hash, then the closing brace should be on the same line as # the last element of the hash. # # If a hash's opening brace is on the line above the first element # of the hash, then the closing brace should be on the line below # the last element of the hash. # # When using the `new_line` style: # # The closing brace of a multi-line hash literal must be on the line # after the last element of the hash. # # When using the `same_line` style: # # The closing brace of a multi-line hash literal must be on the same # line as the last element of the hash. # # @example EnforcedStyle: symmetrical (default) # # # bad # { a: 1, # b: 2 # } # # bad # { # a: 1, # b: 2 } # # # good # { a: 1, # b: 2 } # # # good # { # a: 1, # b: 2 # } # @example EnforcedStyle: new_line # # bad # { # a: 1, # b: 2 } # # # bad # { a: 1, # b: 2 } # # # good # { a: 1, # b: 2 # } # # # good # { # a: 1, # b: 2 # } # @example EnforcedStyle: same_line # # bad # { a: 1, # b: 2 # } # # # bad # { # a: 1, # b: 2 # } # # # good # { # a: 1, # b: 2 } # # # good # { a: 1, # b: 2 } # # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#91 class RuboCop::Cop::Layout::MultilineHashBraceLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineLiteralBraceLayout extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#109 def on_hash(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#103 RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#106 RuboCop::Cop::Layout::MultilineHashBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#99 RuboCop::Cop::Layout::MultilineHashBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_hash_brace_layout.rb#95 RuboCop::Cop::Layout::MultilineHashBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # This cop ensures that each key in a multi-line hash # starts on a separate line. # # @example # # # bad # { # a: 1, b: 2, # c: 3 # } # # # good # { # a: 1, # b: 2, # c: 3 # } # # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#23 class RuboCop::Cop::Layout::MultilineHashKeyLineBreaks < ::RuboCop::Cop::Base include ::RuboCop::Cop::MultilineElementLineBreaks extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#30 def on_hash(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#41 def starts_with_curly_brace?(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_hash_key_line_breaks.rb#27 RuboCop::Cop::Layout::MultilineHashKeyLineBreaks::MSG = T.let(T.unsafe(nil), String) # This cop ensures that each argument in a multi-line method call # starts on a separate line. # # @example # # # bad # foo(a, b, # c # ) # # # good # foo( # a, # b, # c # ) # # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#22 class RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks < ::RuboCop::Cop::Base include ::RuboCop::Cop::MultilineElementLineBreaks extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#29 def on_send(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_method_argument_line_breaks.rb#26 RuboCop::Cop::Layout::MultilineMethodArgumentLineBreaks::MSG = T.let(T.unsafe(nil), String) # This cop checks that the closing brace in a method call is either # on the same line as the last method argument, or a new line. # # When using the `symmetrical` (default) style: # # If a method call's opening brace is on the same line as the first # argument of the call, then the closing brace should be on the same # line as the last argument of the call. # # If an method call's opening brace is on the line above the first # argument of the call, then the closing brace should be on the line # below the last argument of the call. # # When using the `new_line` style: # # The closing brace of a multi-line method call must be on the line # after the last argument of the call. # # When using the `same_line` style: # # The closing brace of a multi-line method call must be on the same # line as the last argument of the call. # # @example EnforcedStyle: symmetrical (default) # # bad # foo(a, # b # ) # # # bad # foo( # a, # b) # # # good # foo(a, # b) # # # good # foo( # a, # b # ) # @example EnforcedStyle: new_line # # bad # foo( # a, # b) # # # bad # foo(a, # b) # # # good # foo(a, # b # ) # # # good # foo( # a, # b # ) # @example EnforcedStyle: same_line # # bad # foo(a, # b # ) # # # bad # foo( # a, # b # ) # # # good # foo( # a, # b) # # # good # foo(a, # b) # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#91 class RuboCop::Cop::Layout::MultilineMethodCallBraceLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineLiteralBraceLayout extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#109 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#115 def children(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#119 def ignored_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#123 def single_line_ignoring_receiver?(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#103 RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#106 RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#99 RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_brace_layout.rb#95 RuboCop::Cop::Layout::MultilineMethodCallBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # This cop checks the indentation of the method name part in method calls # that span more than one line. # # @example EnforcedStyle: aligned (default) # # bad # while myvariable # .b # # do something # end # # # good # while myvariable # .b # # do something # end # # # good # Thing.a # .b # .c # @example EnforcedStyle: indented # # good # while myvariable # .b # # # do something # end # @example EnforcedStyle: indented_relative_to_receiver # # good # while myvariable # .a # .b # # # do something # end # # # good # myvariable = Thing # .a # .b # .c # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#49 class RuboCop::Cop::Layout::MultilineMethodCallIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::MultilineExpressionIndentation # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#64 def autocorrect(node); end # @raise [ValidationError] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#54 def validate_config; end private # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#119 def align_with_base_message(rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#135 def alignment_base(node, rhs, given_style); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#123 def base_source; end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#88 def extra_indentation(given_style); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#96 def message(node, lhs, rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#127 def no_base_message(lhs, rhs, node); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#74 def offending_range(node, lhs, rhs, given_style); end # @yield [operation_rhs.first_argument] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#203 def operation_rhs(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#213 def operator_rhs?(node, receiver); end # a # .b # .c # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#181 def receiver_alignment_base(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#114 def relative_to_receiver_message(rhs); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#70 def relevant_node?(send_node); end # a.b # .c # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#169 def semantic_alignment_base(node, rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#189 def semantic_alignment_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#110 def should_align_with_base?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#106 def should_indent_relative_to_receiver?; end # source://rubocop//lib/rubocop/cop/layout/multiline_method_call_indentation.rb#147 def syntactic_alignment_base(lhs, rhs); end end # This cop checks that the closing brace in a method definition is either # on the same line as the last method parameter, or a new line. # # When using the `symmetrical` (default) style: # # If a method definition's opening brace is on the same line as the # first parameter of the definition, then the closing brace should be # on the same line as the last parameter of the definition. # # If an method definition's opening brace is on the line above the first # parameter of the definition, then the closing brace should be on the # line below the last parameter of the definition. # # When using the `new_line` style: # # The closing brace of a multi-line method definition must be on the line # after the last parameter of the definition. # # When using the `same_line` style: # # The closing brace of a multi-line method definition must be on the same # line as the last parameter of the definition. # # @example EnforcedStyle: symmetrical (default) # # bad # def foo(a, # b # ) # end # # # bad # def foo( # a, # b) # end # # # good # def foo(a, # b) # end # # # good # def foo( # a, # b # ) # end # @example EnforcedStyle: new_line # # bad # def foo( # a, # b) # end # # # bad # def foo(a, # b) # end # # # good # def foo(a, # b # ) # end # # # good # def foo( # a, # b # ) # end # @example EnforcedStyle: same_line # # bad # def foo(a, # b # ) # end # # # bad # def foo( # a, # b # ) # end # # # good # def foo( # a, # b) # end # # # good # def foo(a, # b) # end # # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#103 class RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineLiteralBraceLayout extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#121 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#121 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#115 RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#118 RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::ALWAYS_SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#111 RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::NEW_LINE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/multiline_method_definition_brace_layout.rb#107 RuboCop::Cop::Layout::MultilineMethodDefinitionBraceLayout::SAME_LINE_MESSAGE = T.let(T.unsafe(nil), String) # This cop checks the indentation of the right hand side operand in # binary operations that span more than one line. # # The `aligned` style checks that operators are aligned if they are part # of an `if` or `while` condition, a `return` statement, etc. In other # contexts, the second operand should be indented regardless of enforced # style. # # @example EnforcedStyle: aligned (default) # # bad # if a + # b # something && # something_else # end # # # good # if a + # b # something && # something_else # end # @example EnforcedStyle: indented # # bad # if a + # b # something && # something_else # end # # # good # if a + # b # something && # something_else # end # # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#44 class RuboCop::Cop::Layout::MultilineOperationIndentation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::MultilineExpressionIndentation # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#66 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#49 def on_and(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#53 def on_or(node); end # @raise [ValidationError] # # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#57 def validate_config; end private # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#78 def check_and_or(node); end # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#110 def message(node, lhs, rhs); end # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#84 def offending_range(node, lhs, rhs, given_style); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#72 def relevant_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/multiline_operation_indentation.rb#97 def should_align?(node, rhs, given_style); end end # Here we check if the parameters on a multi-line method call or # definition are aligned. # # To set the alignment of the first argument, use the cop # FirstParameterIndentation. # # @example EnforcedStyle: with_first_parameter (default) # # good # # def foo(bar, # baz) # 123 # end # # def foo( # bar, # baz # ) # 123 # end # # # bad # # def foo(bar, # baz) # 123 # end # # # bad # # def foo( # bar, # baz) # 123 # end # @example EnforcedStyle: with_fixed_indentation # # good # # def foo(bar, # baz) # 123 # end # # def foo( # bar, # baz # ) # 123 # end # # # bad # # def foo(bar, # baz) # 123 # end # # # bad # # def foo( # bar, # baz) # 123 # end # # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#71 class RuboCop::Cop::Layout::ParameterAlignment < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#87 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#80 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#80 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#101 def base_column(node, args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#97 def fixed_indentation?; end # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#93 def message(_node); end # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#112 def target_method_lineno(node); end end # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#74 RuboCop::Cop::Layout::ParameterAlignment::ALIGN_PARAMS_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/parameter_alignment.rb#77 RuboCop::Cop::Layout::ParameterAlignment::FIXED_INDENT_MSG = T.let(T.unsafe(nil), String) # This cop checks whether the rescue and ensure keywords are aligned # properly. # # @example # # # bad # begin # something # rescue # puts 'error' # end # # # good # begin # something # rescue # puts 'error' # end # # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#24 class RuboCop::Cop::Layout::RescueEnsureAlignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::EndKeywordAlignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#42 def on_ensure(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#46 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#38 def on_resbody(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#175 def access_modifier?(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#152 def access_modifier_node(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#185 def alignment_location(alignment_node); end # We will use ancestor or wrapper with access modifier. # # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#118 def alignment_node(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#97 def alignment_source(node, starting_loc); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#133 def ancestor_node(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#144 def assignment_node(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#75 def autocorrect(corrector, node, alignment_location); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#193 def begin_end_alignment_style; end # Check alignment of node with rescue or ensure modifiers. # # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#59 def check(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#85 def format_message(alignment_node, alignment_loc, kw_loc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#162 def modifier?(node); end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#168 def whitespace_range(node); end end # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#35 RuboCop::Cop::Layout::RescueEnsureAlignment::ALTERNATIVE_ACCESS_MODIFIERS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#32 RuboCop::Cop::Layout::RescueEnsureAlignment::ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#34 RuboCop::Cop::Layout::RescueEnsureAlignment::ANCESTOR_TYPES_WITH_ACCESS_MODIFIERS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#29 RuboCop::Cop::Layout::RescueEnsureAlignment::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/rescue_ensure_alignment.rb#33 RuboCop::Cop::Layout::RescueEnsureAlignment::RUBY_2_5_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) # Checks for colon (:) not followed by some kind of space. # N.B. this cop does not handle spaces after a ternary operator, which are # instead handled by Layout/SpaceAroundOperators. # # @example # # bad # def f(a:, b:2); {a:3}; end # # # good # def f(a:, b: 2); {a: 3}; end # # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#16 class RuboCop::Cop::Layout::SpaceAfterColon < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#29 def on_kwoptarg(node); end # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#21 def on_pair(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#45 def followed_by_space?(colon); end # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#39 def register_offense(colon); end end # source://rubocop//lib/rubocop/cop/layout/space_after_colon.rb#19 RuboCop::Cop::Layout::SpaceAfterColon::MSG = T.let(T.unsafe(nil), String) # Checks for comma (,) not followed by some kind of space. # # @example # # # bad # [1,2] # { foo:bar,} # # # good # [1, 2] # { foo:bar, } # # source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#17 class RuboCop::Cop::Layout::SpaceAfterComma < ::RuboCop::Cop::Base include ::RuboCop::Cop::SpaceAfterPunctuation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#26 def kind(token); end # source://rubocop//lib/rubocop/cop/layout/space_after_comma.rb#21 def space_style_before_rcurly; end end # Checks for space between a method name and a left parenthesis in defs. # # @example # # # bad # def func (x) end # def method= (y) end # # # good # def func(x) end # def method=(y) end # # source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#17 class RuboCop::Cop::Layout::SpaceAfterMethodName < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#24 def on_def(node); end # source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#24 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/layout/space_after_method_name.rb#21 RuboCop::Cop::Layout::SpaceAfterMethodName::MSG = T.let(T.unsafe(nil), String) # This cop checks for space after `!`. # # @example # # bad # ! something # # # good # !something # # source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#14 class RuboCop::Cop::Layout::SpaceAfterNot < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#20 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#32 def whitespace_after_operator?(node); end end # source://rubocop//lib/rubocop/cop/layout/space_after_not.rb#18 RuboCop::Cop::Layout::SpaceAfterNot::MSG = T.let(T.unsafe(nil), String) # Checks for semicolon (;) not followed by some kind of space. # # @example # # bad # x = 1;y = 2 # # # good # x = 1; y = 2 # # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#14 class RuboCop::Cop::Layout::SpaceAfterSemicolon < ::RuboCop::Cop::Base include ::RuboCop::Cop::SpaceAfterPunctuation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#23 def kind(token); end # source://rubocop//lib/rubocop/cop/layout/space_after_semicolon.rb#18 def space_style_before_rcurly; end end # Checks the spacing inside and after block parameters pipes. Line breaks # inside parameter pipes are checked by `Layout/MultilineBlockLayout` and # not by this cop. # # @example EnforcedStyleInsidePipes: no_space (default) # # bad # {}.each { | x, y |puts x } # ->( x, y ) { puts x } # # # good # {}.each { |x, y| puts x } # ->(x, y) { puts x } # @example EnforcedStyleInsidePipes: space # # bad # {}.each { |x, y| puts x } # ->(x, y) { puts x } # # # good # {}.each { | x, y | puts x } # ->( x, y ) { puts x } # # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#27 class RuboCop::Cop::Layout::SpaceAroundBlockParameters < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#32 def on_block(node); end private # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#71 def check_after_closing_pipe(arguments); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#125 def check_arg(arg); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#104 def check_closing_pipe_space(args, closing_pipe); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#119 def check_each_arg(args); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#56 def check_inside_pipes(arguments); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#150 def check_no_space(space_begin_pos, space_end_pos, msg); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#79 def check_no_space_style_inside_pipes(args, opening_pipe, closing_pipe); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#94 def check_opening_pipe_space(args, opening_pipe); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#136 def check_space(space_begin_pos, space_end_pos, range, msg, node = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#89 def check_space_style_inside_pipes(args, opening_pipe, closing_pipe); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#114 def last_end_pos_inside_pipes(range); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#44 def pipes(arguments); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#48 def pipes?(arguments); end # source://rubocop//lib/rubocop/cop/layout/space_around_block_parameters.rb#52 def style_parameter_name; end end # Checks that the equals signs in parameter default assignments # have or don't have surrounding space depending on configuration. # # @example EnforcedStyle: space (default) # # bad # def some_method(arg1=:default, arg2=nil, arg3=[]) # # do something... # end # # # good # def some_method(arg1 = :default, arg2 = nil, arg3 = []) # # do something... # end # @example EnforcedStyle: no_space # # bad # def some_method(arg1 = :default, arg2 = nil, arg3 = []) # # do something... # end # # # good # def some_method(arg1=:default, arg2=nil, arg3=[]) # # do something... # end # # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#30 class RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#38 def on_optarg(node); end private # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#66 def autocorrect(corrector, range); end # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#46 def check_optarg(arg, equals, value); end # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#58 def incorrect_style_detected(arg, value); end # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#82 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#78 def no_surrounding_space?(arg, equals); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#74 def space_on_both_sides?(arg, equals); end end # source://rubocop//lib/rubocop/cop/layout/space_around_equals_in_parameter_default.rb#36 RuboCop::Cop::Layout::SpaceAroundEqualsInParameterDefault::MSG = T.let(T.unsafe(nil), String) # Checks the spacing around the keywords. # # @example # # # bad # something 'test'do|x| # end # # while(something) # end # # something = 123if test # # # good # something 'test' do |x| # end # # while (something) # end # # something = 123 if test # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#27 class RuboCop::Cop::Layout::SpaceAroundKeyword < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#42 def on_and(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#46 def on_block(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#50 def on_break(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#54 def on_case(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#130 def on_defined?(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#58 def on_ensure(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#62 def on_for(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#66 def on_if(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#70 def on_kwbegin(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#74 def on_next(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#78 def on_or(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#82 def on_postexe(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#86 def on_preexe(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#90 def on_resbody(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#94 def on_rescue(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#98 def on_return(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#102 def on_send(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#106 def on_super(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#114 def on_until(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#118 def on_when(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#122 def on_while(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#126 def on_yield(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#110 def on_zsuper(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#210 def accept_left_parenthesis?(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#214 def accept_left_square_bracket?(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#218 def accept_namespace_operator?(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#203 def accepted_opening_delimiter?(range, char); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#136 def check(node, locations, begin_keyword = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#151 def check_begin(node, range, begin_keyword); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#157 def check_end(node, range, begin_keyword); end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#170 def check_keyword(node, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#166 def do?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#226 def namespace_operator?(range, pos); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#230 def preceded_by_operator?(node, _range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#222 def safe_navigation_call?(range, pos); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#191 def space_after_missing?(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#184 def space_before_missing?(range); end end # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#36 RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_PAREN = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#38 RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_LEFT_SQUARE_BRACKET = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#40 RuboCop::Cop::Layout::SpaceAroundKeyword::ACCEPT_NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#33 RuboCop::Cop::Layout::SpaceAroundKeyword::DO = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#31 RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_AFTER = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#30 RuboCop::Cop::Layout::SpaceAroundKeyword::MSG_BEFORE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#35 RuboCop::Cop::Layout::SpaceAroundKeyword::NAMESPACE_OPERATOR = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_keyword.rb#34 RuboCop::Cop::Layout::SpaceAroundKeyword::SAFE_NAVIGATION = T.let(T.unsafe(nil), String) # Checks method call operators to not have spaces around them. # # @example # # bad # foo. bar # foo .bar # foo . bar # foo. bar .buzz # foo # . bar # . buzz # foo&. bar # foo &.bar # foo &. bar # foo &. bar&. buzz # RuboCop:: Cop # RuboCop:: Cop:: Cop # :: RuboCop::Cop # # # good # foo.bar # foo.bar.buzz # foo # .bar # .buzz # foo&.bar # foo&.bar&.buzz # RuboCop::Cop # RuboCop::Cop::Cop # ::RuboCop::Cop # # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#37 class RuboCop::Cop::Layout::SpaceAroundMethodCallOperator < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#53 def on_const(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#45 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#45 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#87 def check_space(begin_pos, end_pos); end # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#67 def check_space_after_dot(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#81 def check_space_after_double_colon(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#61 def check_space_before_dot(node); end end # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#43 RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_method_call_operator.rb#41 RuboCop::Cop::Layout::SpaceAroundMethodCallOperator::SPACES_REGEXP = T.let(T.unsafe(nil), Regexp) # Checks that operators have space around them, except for ** which # should or shouldn't have surrounding space depending on configuration. # # This cop has `AllowForAlignment` option. When `true`, allows most # uses of extra spacing if the intent is to align with an operator on # the previous or next line, not counting empty lines or comment lines. # # @example # # bad # total = 3*4 # "apple"+"juice" # my_number = 38/4 # # # good # total = 3 * 4 # "apple" + "juice" # my_number = 38 / 4 # @example AllowForAlignment: true (default) # # good # { # 1 => 2, # 11 => 3 # } # @example AllowForAlignment: false # # bad # { # 1 => 2, # 11 => 3 # } # @example EnforcedStyleForExponentOperator: no_space (default) # # bad # a ** b # # # good # a**b # @example EnforcedStyleForExponentOperator: space # # bad # a**b # # # good # a ** b # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#51 class RuboCop::Cop::Layout::SpaceAroundOperators < ::RuboCop::Cop::Base include ::RuboCop::Cop::PrecedingFollowingAlignment include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::RationalLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#107 def on_and(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_and_asgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_assignment(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#107 def on_binary(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#107 def on_class(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#72 def on_if(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_masgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 def on_op_asgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#107 def on_or(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#99 def on_or_asgn(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#64 def on_pair(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#79 def on_resbody(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#87 def on_send(node); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#115 def on_special_asgn(node); end private # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#220 def align_hash_cop_config; end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#164 def autocorrect(corrector, range); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#148 def check_operator(type, operator, right_operand); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#174 def enclose_operator_with_space(corrector, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#201 def excess_leading_space?(type, operator, with_space); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#215 def excess_trailing_space?(right_operand, with_space); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#233 def force_equal_sign_alignment?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#224 def hash_table_style?; end # @yield [msg] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#159 def offense(type, operator, with_space, right_operand); end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#187 def offense_message(type, operator, with_space, right_operand); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#143 def operator_with_regular_syntax?(send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#138 def regular_operator?(send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#237 def should_not_have_surrounding_space?(operator); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#229 def space_around_exponent_operator?; end class << self # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#60 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#58 RuboCop::Cop::Layout::SpaceAroundOperators::EXCESSIVE_SPACE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_around_operators.rb#57 RuboCop::Cop::Layout::SpaceAroundOperators::IRREGULAR_METHODS = T.let(T.unsafe(nil), Array) # Checks that block braces have or don't have a space before the opening # brace depending on configuration. # # @example EnforcedStyle: space (default) # # bad # foo.map{ |a| # a.bar.to_s # } # # # good # foo.map { |a| # a.bar.to_s # } # @example EnforcedStyle: no_space # # bad # foo.map { |a| # a.bar.to_s # } # # # good # foo.map{ |a| # a.bar.to_s # } # @example EnforcedStyleForEmptyBraces: space (default) # # bad # 7.times{} # # # good # 7.times {} # @example EnforcedStyleForEmptyBraces: no_space # # bad # 7.times {} # # # good # 7.times{} # # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#44 class RuboCop::Cop::Layout::SpaceBeforeBlockBraces < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#56 def on_block(node); end private # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#120 def autocorrect(corrector, range); end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#141 def block_delimiters_style; end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#81 def check_empty(left_brace, space_plus_brace, used_style); end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#98 def check_non_empty(left_brace, space_plus_brace, used_style); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#136 def conflict_with_block_delimiters?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#145 def empty_braces?(loc); end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#112 def space_detected(left_brace, space_plus_brace); end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#106 def space_missing(left_brace); end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#127 def style_for_empty_braces; end class << self # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#52 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#50 RuboCop::Cop::Layout::SpaceBeforeBlockBraces::DETECTED_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_before_block_braces.rb#49 RuboCop::Cop::Layout::SpaceBeforeBlockBraces::MISSING_MSG = T.let(T.unsafe(nil), String) # Checks for comma (,) preceded by space. # # @example # # bad # [1 , 2 , 3] # a(1 , 2) # each { |a , b| } # # # good # [1, 2, 3] # a(1, 2) # each { |a, b| } # # source://rubocop//lib/rubocop/cop/layout/space_before_comma.rb#19 class RuboCop::Cop::Layout::SpaceBeforeComma < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SpaceBeforePunctuation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_before_comma.rb#23 def kind(token); end end # This cop checks for missing space between a token and a comment on the # same line. # # @example # # bad # 1 + 1# this operation does ... # # # good # 1 + 1 # this operation does ... # # source://rubocop//lib/rubocop/cop/layout/space_before_comment.rb#15 class RuboCop::Cop::Layout::SpaceBeforeComment < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_before_comment.rb#20 def on_new_investigation; end end # source://rubocop//lib/rubocop/cop/layout/space_before_comment.rb#18 RuboCop::Cop::Layout::SpaceBeforeComment::MSG = T.let(T.unsafe(nil), String) # Checks that exactly one space is used between a method name and the # first argument for method calls without parentheses. # # Alternatively, extra spaces can be added to align the argument with # something on a preceding or following line, if the AllowForAlignment # config parameter is true. # # @example # # bad # something x # something y, z # something'hello' # # # good # something x # something y, z # something 'hello' # # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#24 class RuboCop::Cop::Layout::SpaceBeforeFirstArg < ::RuboCop::Cop::Base include ::RuboCop::Cop::PrecedingFollowingAlignment include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#32 def on_csend(node); end # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#32 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#55 def expect_params_after_method_name?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#66 def no_space_between_method_name_and_first_argument?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#51 def regular_method_call_with_arguments?(node); end end # source://rubocop//lib/rubocop/cop/layout/space_before_first_arg.rb#29 RuboCop::Cop::Layout::SpaceBeforeFirstArg::MSG = T.let(T.unsafe(nil), String) # Checks for semicolon (;) preceded by space. # # @example # # bad # x = 1 ; y = 2 # # # good # x = 1; y = 2 # # source://rubocop//lib/rubocop/cop/layout/space_before_semicolon.rb#14 class RuboCop::Cop::Layout::SpaceBeforeSemicolon < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SpaceBeforePunctuation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_before_semicolon.rb#18 def kind(token); end end # This cop checks for spaces between `->` and opening parameter # parenthesis (`(`) in lambda literals. # # @example EnforcedStyle: require_no_space (default) # # bad # a = -> (x, y) { x + y } # # # good # a = ->(x, y) { x + y } # @example EnforcedStyle: require_space # # bad # a = ->(x, y) { x + y } # # # good # a = -> (x, y) { x + y } # # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#22 class RuboCop::Cop::Layout::SpaceInLambdaLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#32 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#50 def arrow_lambda_with_args?(node); end # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#65 def range_of_offense(node); end # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#58 def space_after_arrow(lambda_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#54 def space_after_arrow?(lambda_node); end end # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#29 RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_NO_SPACE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_in_lambda_literal.rb#27 RuboCop::Cop::Layout::SpaceInLambdaLiteral::MSG_REQUIRE_SPACE = T.let(T.unsafe(nil), String) # Checks that brackets used for array literals have or don't have # surrounding space depending on configuration. # # @example EnforcedStyle: space # # The `space` style enforces that array literals have # # surrounding space. # # # bad # array = [a, b, c, d] # # # good # array = [ a, b, c, d ] # @example EnforcedStyle: no_space (default) # # The `no_space` style enforces that array literals have # # no surrounding space. # # # bad # array = [ a, b, c, d ] # # # good # array = [a, b, c, d] # @example EnforcedStyle: compact # # The `compact` style normally requires a space inside # # array brackets, with the exception that successive left # # or right brackets are collapsed together in nested arrays. # # # bad # array = [ a, [ b, c ] ] # array = [ # [ a ], # [ b, c ] # ] # # # good # array = [ a, [ b, c ]] # array = [[ a ], # [ b, c ]] # @example EnforcedStyleForEmptyBrackets: no_space (default) # # The `no_space` EnforcedStyleForEmptyBrackets style enforces that # # empty array brackets do not contain spaces. # # # bad # foo = [ ] # bar = [ ] # # # good # foo = [] # bar = [] # @example EnforcedStyleForEmptyBrackets: space # # The `space` EnforcedStyleForEmptyBrackets style enforces that # # empty array brackets contain exactly one space. # # # bad # foo = [] # bar = [ ] # # # good # foo = [ ] # bar = [ ] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#70 class RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#78 def on_array(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#106 def array_brackets(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#92 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#220 def compact(corrector, bracket, side); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#207 def compact_corrections(corrector, node, left, right); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#199 def compact_offense(node, token, side: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#159 def compact_offenses(node, left, right, start_ok, end_ok); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#118 def empty_config; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#126 def end_has_own_line?(token); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#133 def index_for(node, token); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#141 def issue_offenses(node, left, right, start_ok, end_ok); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#110 def left_array_bracket(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#137 def line_and_column_for(token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#184 def multi_dimensional_array?(node, token, side: T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#193 def next_to_bracket?(token, side: T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#155 def next_to_comment?(node, token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#122 def next_to_newline?(node, token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#174 def qualifies_for_compact?(node, token, side: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#114 def right_array_bracket(node); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#76 RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_inside_array_literal_brackets.rb#75 RuboCop::Cop::Layout::SpaceInsideArrayLiteralBrackets::MSG = T.let(T.unsafe(nil), String) # Checks for unnecessary additional spaces inside array percent literals # (i.e. %i/%w). # # @example # # # bad # %w(foo bar baz) # # good # %i(foo bar baz) # # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#15 class RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::MatchRange include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#24 def on_array(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#28 def on_percent_literal(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#38 def each_unnecessary_space_match(node, &blk); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#20 RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_inside_array_percent_literal.rb#21 RuboCop::Cop::Layout::SpaceInsideArrayPercentLiteral::MULTIPLE_SPACES_BETWEEN_ITEMS_REGEX = T.let(T.unsafe(nil), Regexp) # Checks that block braces have or don't have surrounding space inside # them on configuration. For blocks taking parameters, it checks that the # left brace has or doesn't have trailing space depending on # configuration. # # @example EnforcedStyle: space (default) # # The `space` style enforces that block braces have # # surrounding space. # # # bad # some_array.each {puts e} # # # good # some_array.each { puts e } # @example EnforcedStyle: no_space # # The `no_space` style enforces that block braces don't # # have surrounding space. # # # bad # some_array.each { puts e } # # # good # some_array.each {puts e} # @example EnforcedStyleForEmptyBraces: no_space (default) # # The `no_space` EnforcedStyleForEmptyBraces style enforces that # # block braces don't have a space in between when empty. # # # bad # some_array.each { } # some_array.each { } # some_array.each { } # # # good # some_array.each {} # @example EnforcedStyleForEmptyBraces: space # # The `space` EnforcedStyleForEmptyBraces style enforces that # # block braces have at least a space in between when empty. # # # bad # some_array.each {} # # # good # some_array.each { } # some_array.each { } # some_array.each { } # @example SpaceBeforeBlockParameters: true (default) # # The SpaceBeforeBlockParameters style set to `true` enforces that # # there is a space between `{` and `|`. Overrides `EnforcedStyle` # # if there is a conflict. # # # bad # [1, 2, 3].each {|n| n * 2 } # # # good # [1, 2, 3].each { |n| n * 2 } # @example SpaceBeforeBlockParameters: false # # The SpaceBeforeBlockParameters style set to `false` enforces that # # there is no space between `{` and `|`. Overrides `EnforcedStyle` # # if there is a conflict. # # # bad # [1, 2, 3].each { |n| n * 2 } # # # good # [1, 2, 3].each {|n| n * 2 } # # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#79 class RuboCop::Cop::Layout::SpaceInsideBlockBraces < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#85 def on_block(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#119 def adjacent_braces(left_brace, right_brace); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#158 def aligned_braces?(left_brace, right_brace); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#126 def braces_with_contents_inside(node, inner); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#103 def check_inside(node, left_brace, right_brace); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#134 def check_left_brace(inner, left_brace, args_delimiter); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#142 def check_right_brace(inner, left_brace, right_brace, single_line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#154 def multiline_block?(left_brace, right_brace); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#207 def no_space(begin_pos, end_pos, msg); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#162 def no_space_inside_left_brace(left_brace, args_delimiter); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#223 def offense(begin_pos, end_pos, msg); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#196 def pipe?(args_delimiter); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#215 def space(begin_pos, end_pos, msg); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#180 def space_inside_left_brace(left_brace, args_delimiter); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#200 def space_inside_right_brace(right_brace); end # source://rubocop//lib/rubocop/cop/layout/space_inside_block_braces.rb#235 def style_for_empty_braces; end end # Checks that braces used for hash literals have or don't have # surrounding space depending on configuration. # # @example EnforcedStyle: space (default) # # The `space` style enforces that hash literals have # # surrounding space. # # # bad # h = {a: 1, b: 2} # # # good # h = { a: 1, b: 2 } # @example EnforcedStyle: no_space # # The `no_space` style enforces that hash literals have # # no surrounding space. # # # bad # h = { a: 1, b: 2 } # # # good # h = {a: 1, b: 2} # @example EnforcedStyle: compact # # The `compact` style normally requires a space inside # # hash braces, with the exception that successive left # # braces or right braces are collapsed together in nested hashes. # # # bad # h = { a: { b: 2 } } # foo = { { a: 1 } => { b: { c: 2 } } } # # # good # h = { a: { b: 2 }} # foo = {{ a: 1 } => { b: { c: 2 }}} # @example EnforcedStyleForEmptyBraces: no_space (default) # # The `no_space` EnforcedStyleForEmptyBraces style enforces that # # empty hash braces do not contain spaces. # # # bad # foo = { } # bar = { } # # # good # foo = {} # bar = {} # @example EnforcedStyleForEmptyBraces: space # # The `space` EnforcedStyleForEmptyBraces style enforces that # # empty hash braces contain space. # # # bad # foo = {} # # # good # foo = { } # foo = { } # foo = { } # # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#66 class RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#74 def on_hash(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#133 def ambiguous_or_unexpected_style_detected(style, is_match); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#125 def autocorrect(corrector, range); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#84 def check(token1, token2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#100 def expect_space?(token1, token2); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#113 def incorrect_style_detected(token1, token2, expect_space, is_empty_braces); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#146 def message(brace, is_empty_braces, expect_space); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#141 def offense?(token1, expect_space); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#172 def range_of_space_to_the_left(range); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#164 def range_of_space_to_the_right(range); end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#156 def space_range(token_range); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_hash_literal_braces.rb#72 RuboCop::Cop::Layout::SpaceInsideHashLiteralBraces::MSG = T.let(T.unsafe(nil), String) # Checks for spaces inside ordinary round parentheses. # # @example EnforcedStyle: no_space (default) # # The `no_space` style enforces that parentheses do not have spaces. # # # bad # f( 3) # g = (a + 3 ) # # # good # f(3) # g = (a + 3) # @example EnforcedStyle: space # # The `space` style enforces that parentheses have a space at the # # beginning and end. # # Note: Empty parentheses should not have spaces. # # # bad # f(3) # g = (a + 3) # y( ) # # # good # f( 3 ) # g = ( a + 3 ) # y() # # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#34 class RuboCop::Cop::Layout::SpaceInsideParens < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#43 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#96 def can_be_ignored?(token1, token2); end # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#63 def each_extraneous_space(tokens); end # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#76 def each_missing_space(tokens); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#92 def parens?(token1, token2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#88 def same_line?(token1, token2); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#40 RuboCop::Cop::Layout::SpaceInsideParens::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_inside_parens.rb#41 RuboCop::Cop::Layout::SpaceInsideParens::MSG_SPACE = T.let(T.unsafe(nil), String) # Checks for unnecessary additional spaces inside the delimiters of # %i/%w/%x literals. # # @example # # # good # %i(foo bar baz) # # # bad # %w( foo bar baz ) # # # bad # %x( ls -l ) # # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#19 class RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::MatchRange include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#28 def on_array(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#36 def on_percent_literal(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#32 def on_xstr(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#42 def add_offenses_for_unnecessary_spaces(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#52 def regex_matches(node, &blk); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#25 RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::BEGIN_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#26 RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::END_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/layout/space_inside_percent_literal_delimiters.rb#24 RuboCop::Cop::Layout::SpaceInsidePercentLiteralDelimiters::MSG = T.let(T.unsafe(nil), String) # Checks for spaces inside range literals. # # @example # # bad # 1 .. 3 # # # good # 1..3 # # # bad # 'a' .. 'z' # # # good # 'a'..'z' # # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#20 class RuboCop::Cop::Layout::SpaceInsideRangeLiteral < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#29 def on_erange(node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#25 def on_irange(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#35 def check(node); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_range_literal.rb#23 RuboCop::Cop::Layout::SpaceInsideRangeLiteral::MSG = T.let(T.unsafe(nil), String) # Checks that reference brackets have or don't have # surrounding space depending on configuration. # # @example EnforcedStyle: no_space (default) # # The `no_space` style enforces that reference brackets have # # no surrounding space. # # # bad # hash[ :key ] # array[ index ] # # # good # hash[:key] # array[index] # @example EnforcedStyle: space # # The `space` style enforces that reference brackets have # # surrounding space. # # # bad # hash[:key] # array[index] # # # good # hash[ :key ] # array[ index ] # @example EnforcedStyleForEmptyBrackets: no_space (default) # # The `no_space` EnforcedStyleForEmptyBrackets style enforces that # # empty reference brackets do not contain spaces. # # # bad # foo[ ] # foo[ ] # # # good # foo[] # @example EnforcedStyleForEmptyBrackets: space # # The `space` EnforcedStyleForEmptyBrackets style enforces that # # empty reference brackets contain exactly one space. # # # bad # foo[] # foo[ ] # # # good # foo[ ] # # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#56 class RuboCop::Cop::Layout::SpaceInsideReferenceBrackets < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#66 def on_send(node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#88 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#118 def closing_bracket(tokens, opening_bracket); end # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#134 def empty_config; end # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#106 def left_ref_bracket(node, tokens); end # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#129 def previous_token(current_token); end # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#100 def reference_brackets(node); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#62 RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::EMPTY_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#61 RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_inside_reference_brackets.rb#64 RuboCop::Cop::Layout::SpaceInsideReferenceBrackets::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for whitespace within string interpolations. # # @example EnforcedStyle: no_space (default) # # bad # var = "This is the #{ space } example" # # # good # var = "This is the #{no_space} example" # @example EnforcedStyle: space # # bad # var = "This is the #{no_space} example" # # # good # var = "This is the #{ space } example" # # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#21 class RuboCop::Cop::Layout::SpaceInsideStringInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#31 def on_interpolation(begin_node); end private # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#46 def autocorrect(corrector, begin_node); end # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#56 def delimiters(begin_node); end end # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#28 RuboCop::Cop::Layout::SpaceInsideStringInterpolation::NO_SPACE_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/layout/space_inside_string_interpolation.rb#29 RuboCop::Cop::Layout::SpaceInsideStringInterpolation::SPACE_MSG = T.let(T.unsafe(nil), String) # This cop looks for trailing blank lines and a final newline in the # source code. # # @example EnforcedStyle: final_blank_line # # `final_blank_line` looks for one blank line followed by a new line # # at the end of files. # # # bad # class Foo; end # # EOF # # # bad # class Foo; end # EOF # # # good # class Foo; end # # # EOF # @example EnforcedStyle: final_newline (default) # # `final_newline` looks for one newline at the end of files. # # # bad # class Foo; end # # # EOF # # # bad # class Foo; end # EOF # # # good # class Foo; end # # EOF # # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#40 class RuboCop::Cop::Layout::TrailingEmptyLines < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#45 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#79 def ends_in_end?(processed_source); end # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#89 def message(wanted_blank_lines, blank_lines); end # source://rubocop//lib/rubocop/cop/layout/trailing_empty_lines.rb#66 def offense_detected(buffer, wanted_blank_lines, blank_lines, whitespace_at_end); end end # This cop looks for trailing whitespace in the source code. # # @example # # The line in this example contains spaces after the 0. # # bad # x = 0 # # # The line in this example ends directly after the 0. # # good # x = 0 # @example AllowInHeredoc: false # # The line in this example contains spaces after the 0. # # bad # code = <<~RUBY # x = 0 # RUBY # @example AllowInHeredoc: true (default) # # The line in this example contains spaces after the 0. # # good # code = <<~RUBY # x = 0 # RUBY # # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#31 class RuboCop::Cop::Layout::TrailingWhitespace < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#37 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#62 def extract_heredoc_ranges(ast); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#58 def inside_heredoc?(heredoc_ranges, line_number); end # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#71 def offense_range(lineno, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#54 def skip_heredoc?; end end # source://rubocop//lib/rubocop/cop/layout/trailing_whitespace.rb#35 RuboCop::Cop::Layout::TrailingWhitespace::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#5 module RuboCop::Cop::Legacy; end # Legacy support for Corrector#corrections # See https://docs.rubocop.org/rubocop/cop_api_v1_changelog.html # # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#8 class RuboCop::Cop::Legacy::CorrectionsProxy # @return [CorrectionsProxy] a new instance of CorrectionsProxy # # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#9 def initialize(corrector); end # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#13 def <<(callable); end # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#25 def concat(corrections); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#21 def empty?; end protected # Returns the value of attribute corrector. # # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#37 def corrector; end private # source://rubocop//lib/rubocop/cop/legacy/corrections_proxy.rb#41 def suppress_clobbering; end end # This class handles autocorrection for code that needs to be moved # to new lines. # # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#7 class RuboCop::Cop::LineBreakCorrector extend ::RuboCop::Cop::Alignment extend ::RuboCop::Cop::TrailingBody extend ::RuboCop::PathUtil extend ::RuboCop::Cop::Util class << self # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#28 def break_line_before(range:, node:, corrector:, configured_width:, indent_steps: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#15 def correct_trailing_body(configured_width:, corrector:, node:, processed_source:); end # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#37 def move_comment(eol_comment:, node:, corrector:); end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#13 def processed_source; end private # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#48 def remove_semicolon(node, corrector); end # source://rubocop//lib/rubocop/cop/correctors/line_break_corrector.rb#54 def semicolon(node); end end end # Help methods for determining if a line is too long. # # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#6 module RuboCop::Cop::LineLengthHelp private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#22 def allow_uri?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#26 def allowed_uri_position?(line, uri_range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#13 def directive_on_source_line?(line_index); end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#36 def find_excessive_uri_range(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#9 def ignore_cop_directives?; end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#57 def indentation_difference(line); end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#32 def line_length(line); end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#81 def line_length_without_directive(line); end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#49 def match_uris(string); end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#63 def tab_indentation_width; end # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#68 def uri_regexp; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/line_length_help.rb#74 def valid_uri?(uri_ish_string); end end # source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#5 module RuboCop::Cop::Lint; end # This cop checks for ambiguous block association with method # when param passed without parentheses. # # @example # # # bad # some_method a { |val| puts val } # @example # # # good # # With parentheses, there's no ambiguity. # some_method(a { |val| puts val }) # # or (different meaning) # some_method(a) { |val| puts val } # # # good # # Operator methods require no disambiguation # foo == bar { |b| b.baz } # # # good # # Lambda arguments require no disambiguation # foo = ->(bar) { bar.baz } # # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#29 class RuboCop::Cop::Lint::AmbiguousBlockAssociation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#34 def on_csend(node); end # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#34 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#54 def allowed_method?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#49 def ambiguous_block_association?(send_node); end # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#58 def message(send_node); end end # source://rubocop//lib/rubocop/cop/lint/ambiguous_block_association.rb#30 RuboCop::Cop::Lint::AmbiguousBlockAssociation::MSG = T.let(T.unsafe(nil), String) # This cop 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 possibly be # # a `*` method invocation (i.e. `do_something.*(some_array)`). # do_something *some_array # @example # # # good # # # With parentheses, there's no ambiguity. # do_something(*some_array) # # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#23 class RuboCop::Cop::Lint::AmbiguousOperator < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#41 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#60 def find_offense_node_by(diagnostic); end # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#78 def message(diagnostic); end # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#88 def offense_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#84 def offense_position?(node, diagnostic); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#97 def unary_operator?(node, diagnostic); end end # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#26 RuboCop::Cop::Lint::AmbiguousOperator::AMBIGUITIES = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/lint/ambiguous_operator.rb#36 RuboCop::Cop::Lint::AmbiguousOperator::MSG_FORMAT = T.let(T.unsafe(nil), String) # This cop checks for ambiguous regexp literals in the first argument of # a method invocation without parentheses. # # @example # # # bad # # # This is interpreted as a method invocation with a regexp literal, # # but it could possibly be `/` method invocations. # # (i.e. `do_something./(pattern)./(i)`) # do_something /pattern/i # @example # # # good # # # With parentheses, there's no ambiguity. # do_something(/pattern/i) # # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#24 class RuboCop::Cop::Lint::AmbiguousRegexpLiteral < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#31 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#53 def find_offense_node(node, regexp_receiver); end # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#45 def find_offense_node_by(diagnostic); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#63 def method_chain_to_regexp_receiver?(node, regexp_receiver); end end # source://rubocop//lib/rubocop/cop/lint/ambiguous_regexp_literal.rb#27 RuboCop::Cop::Lint::AmbiguousRegexpLiteral::MSG = T.let(T.unsafe(nil), String) # This cop checks for assignments in the conditions of # if/while/until. # # `AllowSafeAssignment` option for safe assignment. # By safe assignment we mean putting parentheses around # an assignment to indicate "I know I'm using an assignment # as a condition. It's not a mistake." # # @example # # bad # if some_var = true # do_something # end # # # good # if some_var == true # do_something # end # @example AllowSafeAssignment: true (default) # # good # if (some_var = true) # do_something # end # @example AllowSafeAssignment: false # # bad # if (some_var = true) # do_something # end # # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#37 class RuboCop::Cop::Lint::AssignmentInCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::SafeAssignment # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#49 def on_if(node); end # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#49 def on_until(node); end # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#49 def on_while(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#72 def allowed_construct?(asgn_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#76 def conditional_assignment?(asgn_node); end # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#64 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#80 def skip_children?(asgn_node); end # each_node/visit_descendants_with_types with :skip_children # # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#87 def traverse_node(node, types, &block); end end # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#47 RuboCop::Cop::Lint::AssignmentInCondition::ASGN_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#44 RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITHOUT_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/assignment_in_condition.rb#40 RuboCop::Cop::Lint::AssignmentInCondition::MSG_WITH_SAFE_ASSIGNMENT_ALLOWED = T.let(T.unsafe(nil), String) # `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) # # # good # BigDecimal(123.456, 3) # # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#17 class RuboCop::Cop::Lint::BigDecimalNew < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#24 def big_decimal_new(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#29 def on_send(node); end end # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#20 RuboCop::Cop::Lint::BigDecimalNew::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/big_decimal_new.rb#22 RuboCop::Cop::Lint::BigDecimalNew::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for places where binary operator has identical operands. # # It covers arithmetic operators: `+`, `-`, `*`, `/`, `%`, `**`; # comparison operators: `==`, `===`, `=~`, `>`, `>=`, `<`, `<=`; # bitwise operators: `|`, `^`, `&`, `<<`, `>>`; # boolean operators: `&&`, `||` # and "spaceship" operator - `<=>`. # # This cop is marked as unsafe as it does not consider side effects when calling methods # and thus can generate false positives: # if wr.take_char == '\0' && wr.take_char == '\0' # # @example # # bad # x.top >= x.top # # if a.x != 0 && a.x != 0 # do_something # end # # def childs? # left_child || left_child # end # # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#30 class RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#43 def on_and(node); end # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#43 def on_or(node); end # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#34 def on_send(node); end end # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#32 RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MATH_OPERATORS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/lint/binary_operator_with_identical_operands.rb#31 RuboCop::Cop::Lint::BinaryOperatorWithIdenticalOperands::MSG = T.let(T.unsafe(nil), String) # This cop checks for `:true` and `:false` symbols. # In most cases it would be a typo. # # @example # # # bad # :true # # # good # true # @example # # # bad # :false # # # good # false # # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#24 class RuboCop::Cop::Lint::BooleanSymbol < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#30 def boolean_symbol?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#32 def on_sym(node); end private # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#45 def autocorrect(corrector, node); end end # source://rubocop//lib/rubocop/cop/lint/boolean_symbol.rb#27 RuboCop::Cop::Lint::BooleanSymbol::MSG = T.let(T.unsafe(nil), String) # This cop checks for circular argument references in optional keyword # arguments and optional ordinal arguments. # # This cop mirrors a warning produced by MRI since 2.2. # # @example # # # bad # # def bake(pie: pie) # pie.heat_up # end # @example # # # good # # def bake(pie:) # pie.refrigerate # end # @example # # # good # # def bake(pie: self.pie) # pie.feed_to(user) # end # @example # # # bad # # def cook(dry_ingredients = dry_ingredients) # dry_ingredients.reduce(&:+) # end # @example # # # good # # def cook(dry_ingredients = self.dry_ingredients) # dry_ingredients.combine # end # # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#50 class RuboCop::Cop::Lint::CircularArgumentReference < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#53 def on_kwoptarg(node); end # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#57 def on_optarg(node); end private # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#63 def check_for_circular_argument_references(arg_name, arg_value); end end # source://rubocop//lib/rubocop/cop/lint/circular_argument_reference.rb#51 RuboCop::Cop::Lint::CircularArgumentReference::MSG = T.let(T.unsafe(nil), String) # Do not define constants within a block, since the block's scope does not # isolate or namespace the constant in any way. # # If you are trying to define that constant once, define it outside of # the block instead, or use a variable or method if defining the constant # in the outer scope would be problematic. # # For meta-programming, use `const_set`. # # @example # # bad # task :lint do # FILES_TO_LINT = Dir['lib/*.rb'] # end # # # bad # describe 'making a request' do # class TestRequest; end # end # # # bad # module M # extend ActiveSupport::Concern # included do # LIST = [] # end # end # # # good # task :lint do # files_to_lint = Dir['lib/*.rb'] # end # # # good # describe 'making a request' do # let(:test_request) { Class.new } # # see also `stub_const` for RSpec # end # # # good # module M # extend ActiveSupport::Concern # included do # const_set(:LIST, []) # end # end # # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#52 class RuboCop::Cop::Lint::ConstantDefinitionInBlock < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#55 def constant_assigned_in_block?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#59 def module_defined_in_block?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#63 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#67 def on_class(node); end # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#67 def on_module(node); end end # source://rubocop//lib/rubocop/cop/lint/constant_definition_in_block.rb#53 RuboCop::Cop::Lint::ConstantDefinitionInBlock::MSG = T.let(T.unsafe(nil), String) # 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 conflicts with # the code that uses the gem. Enable this cop without using `Only`/`Ignore` # # Large projects will over time end up with one or two constant names that # are problematic because of a conflict with a library or just internally # using the same name a namespace and a class. To avoid too many unnecessary # offenses, Enable this cop with `Only: [The, Constant, Names, Causing, Issues]` # # @example # # By default checks every constant # # # bad # User # # # bad # User::Login # # # good # ::User # # # good # ::User::Login # @example Only: ['Login'] # # Restrict this cop to only being concerned about certain constants # # # bad # Login # # # good # ::Login # # # good # User::Login # @example Ignore: ['Login'] # # Restrict this cop not being concerned about certain constants # # # bad # User # # # good # ::User::Login # # # good # Login # # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#58 class RuboCop::Cop::Lint::ConstantResolution < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#65 def on_const(node); end # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#61 def unqualified_const?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#79 def allowed_names; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#73 def const_name?(name); end # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#83 def ignored_names; end end # source://rubocop//lib/rubocop/cop/lint/constant_resolution.rb#59 RuboCop::Cop::Lint::ConstantResolution::MSG = T.let(T.unsafe(nil), String) # This cop checks for calls to debugger or pry. # # @example # # # bad (ok during development) # # # using pry # def some_method # binding.pry # do_something # end # @example # # # bad (ok during development) # # # using byebug # def some_method # byebug # do_something # end # @example # # # good # # def some_method # do_something # end # # source://rubocop//lib/rubocop/cop/lint/debugger.rb#35 class RuboCop::Cop::Lint::Debugger < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/debugger.rb#60 def binding_irb_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/debugger.rb#50 def debugger_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/debugger.rb#43 def kernel?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/debugger.rb#64 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/debugger.rb#76 def binding_irb?(node); end # source://rubocop//lib/rubocop/cop/lint/debugger.rb#72 def message(node); end end # source://rubocop//lib/rubocop/cop/lint/debugger.rb#36 RuboCop::Cop::Lint::Debugger::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/debugger.rb#38 RuboCop::Cop::Lint::Debugger::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for uses of the deprecated class method usages. # # @example # # # bad # # File.exists?(some_path) # Dir.exists?(some_path) # iterator? # @example # # # good # # File.exist?(some_path) # Dir.exist?(some_path) # block_given? # # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#23 class RuboCop::Cop::Lint::DeprecatedClassMethods < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#67 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#80 def check(node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#89 def deprecated_method(data); end # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#97 def method_call(class_constant, method); end # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#93 def replacement_method(data); end end # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#54 RuboCop::Cop::Lint::DeprecatedClassMethods::DEPRECATED_METHODS_OBJECT = T.let(T.unsafe(nil), Array) # Inner class to DeprecatedClassMethods. # This class exists to add abstraction and clean naming to the # objects that are going to be operated on. # # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#29 class RuboCop::Cop::Lint::DeprecatedClassMethods::DeprecatedClassMethod include ::RuboCop::AST::Sexp # @return [DeprecatedClassMethod] a new instance of DeprecatedClassMethod # # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#34 def initialize(deprecated:, replacement:, class_constant: T.unsafe(nil)); end # Returns the value of attribute class_constant. # # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#32 def class_constant; end # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#40 def class_nodes; end # Returns the value of attribute deprecated_method. # # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#32 def deprecated_method; end # Returns the value of attribute replacement_method. # # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#32 def replacement_method; end end # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#53 RuboCop::Cop::Lint::DeprecatedClassMethods::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/deprecated_class_methods.rb#65 RuboCop::Cop::Lint::DeprecatedClassMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Algorithmic constants for `OpenSSL::Cipher` and `OpenSSL::Digest` # deprecated since OpenSSL version 2.2.0. Prefer passing a string # instead. # # @example # # # Example for OpenSSL::Cipher instantiation. # # # bad # OpenSSL::Cipher::AES.new(128, :GCM) # # # good # OpenSSL::Cipher.new('aes-128-gcm') # @example # # # Example for OpenSSL::Digest instantiation. # # # bad # OpenSSL::Digest::SHA256.new # # # good # OpenSSL::Digest.new('SHA256') # @example # # # Example for ::Digest inherited class methods. # # # bad # OpenSSL::Digest::SHA256.digest('foo') # # # good # OpenSSL::Digest.digest('SHA256', 'foo') # # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#40 class RuboCop::Cop::Lint::DeprecatedOpenSSLConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#47 def algorithm_const(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#56 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#104 def algorithm_name(node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#69 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#133 def build_cipher_arguments(node, algorithm_name); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#96 def correction_range(node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#81 def message(node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#100 def openssl_class(node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#122 def replacement_args(node); end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#114 def sanitize_arguments(arguments); end end # source://rubocop//lib/rubocop/cop/lint/deprecated_open_ssl_constant.rb#44 RuboCop::Cop::Lint::DeprecatedOpenSSLConstant::MSG = T.let(T.unsafe(nil), String) # This cop checks constructors for disjunctive assignments that should # be plain assignments. # # So far, this cop is only concerned with disjunctive assignment of # instance variables. # # In ruby, an instance variable is nil until a value is assigned, so the # disjunction is unnecessary. A plain assignment has the same effect. # # @example # # bad # def initialize # @x ||= 1 # end # # # good # def initialize # @x = 1 # end # # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#25 class RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#30 def on_def(node); end private # @param node [DefNode] a constructor definition # # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#37 def check(node); end # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#43 def check_body(body); end # @param lines [Array] the logical lines of the constructor # # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#55 def check_body_lines(lines); end # Add an offense if the LHS of the given disjunctive assignment is # an instance variable. # # For now, we only care about assignments to instance variables. # # @param node [Node] a disjunctive assignment # # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#76 def check_disjunctive_assignment(node); end end # source://rubocop//lib/rubocop/cop/lint/disjunctive_assignment_in_constructor.rb#28 RuboCop::Cop::Lint::DisjunctiveAssignmentInConstructor::MSG = T.let(T.unsafe(nil), String) # This cop checks that there are no repeated conditions # used in case 'when' expressions. # # @example # # # bad # # case x # when 'first' # do_something # when 'first' # do_something_else # end # @example # # # good # # case x # when 'first' # do_something # when 'second' # do_something_else # end # # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#30 class RuboCop::Cop::Lint::DuplicateCaseCondition < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#33 def on_case(case_node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#47 def repeated_condition?(previous, condition); end end # source://rubocop//lib/rubocop/cop/lint/duplicate_case_condition.rb#31 RuboCop::Cop::Lint::DuplicateCaseCondition::MSG = T.let(T.unsafe(nil), String) # This cop 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 # # # good # if x == 1 # do_something # elsif x == 2 # do_something_else # end # # source://rubocop//lib/rubocop/cop/lint/duplicate_elsif_condition.rb#23 class RuboCop::Cop::Lint::DuplicateElsifCondition < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/duplicate_elsif_condition.rb#26 def on_if(node); end end # source://rubocop//lib/rubocop/cop/lint/duplicate_elsif_condition.rb#24 RuboCop::Cop::Lint::DuplicateElsifCondition::MSG = T.let(T.unsafe(nil), String) # This cop checks for duplicated keys in hash literals. # # This cop mirrors a warning in Ruby 2.2. # # @example # # # bad # # hash = { food: 'apple', food: 'orange' } # @example # # # good # # hash = { food: 'apple', other_food: 'orange' } # # source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#21 class RuboCop::Cop::Lint::DuplicateHashKey < ::RuboCop::Cop::Base include ::RuboCop::Cop::Duplication # source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#26 def on_hash(node); end end # source://rubocop//lib/rubocop/cop/lint/duplicate_hash_key.rb#24 RuboCop::Cop::Lint::DuplicateHashKey::MSG = T.let(T.unsafe(nil), String) # This cop checks for duplicated instance (or singleton) method # definitions. # # @example # # # bad # # def foo # 1 # end # # def foo # 2 # end # @example # # # bad # # def foo # 1 # end # # alias foo bar # @example # # # good # # def foo # 1 # end # # def bar # 2 # end # @example # # # good # # def foo # 1 # end # # alias bar foo # # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#52 class RuboCop::Cop::Lint::DuplicateMethods < ::RuboCop::Cop::Base # @return [DuplicateMethods] a new instance of DuplicateMethods # # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#59 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#97 def alias_method?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#85 def method_alias?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#89 def on_alias(node); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#64 def on_def(node); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#73 def on_defs(node); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#102 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#101 def sym_name(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#115 def check_const_receiver(node, name, const_name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#122 def check_self_receiver(node, name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#174 def found_attr(node, args, readable: T.unsafe(nil), writable: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#134 def found_instance_method(node, name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#144 def found_method(node, method_name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#184 def lookup_constant(node, const_name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#129 def message_for_dup(node, method_name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#160 def on_attr(node, attr_name, args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#218 def possible_dsl?(node); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#204 def qualified_name(enclosing, namespace, mod_name); end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#228 def source_location(node); end end # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#53 RuboCop::Cop::Lint::DuplicateMethods::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/duplicate_methods.rb#56 RuboCop::Cop::Lint::DuplicateMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for duplicate `require`s and `require_relative`s. # # @example # # bad # require 'foo' # require 'bar' # require 'foo' # # # good # require 'foo' # require 'bar' # # # good # require 'foo' # require_relative 'foo' # # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#22 class RuboCop::Cop::Lint::DuplicateRequire < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#31 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#37 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#27 def require_call?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#23 RuboCop::Cop::Lint::DuplicateRequire::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#24 RuboCop::Cop::Lint::DuplicateRequire::REQUIRE_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/duplicate_require.rb#25 RuboCop::Cop::Lint::DuplicateRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks that there are no repeated exceptions # used in 'rescue' expressions. # # @example # # bad # begin # something # rescue FirstException # handle_exception # rescue FirstException # handle_other_exception # end # # # good # begin # something # rescue FirstException # handle_exception # rescue SecondException # handle_other_exception # end # # source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#28 class RuboCop::Cop::Lint::DuplicateRescueException < ::RuboCop::Cop::Base include ::RuboCop::Cop::RescueNode # source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#33 def on_rescue(node); end end # source://rubocop//lib/rubocop/cop/lint/duplicate_rescue_exception.rb#31 RuboCop::Cop::Lint::DuplicateRescueException::MSG = T.let(T.unsafe(nil), String) # This cop checks if each_with_object is called with an immutable # argument. Since the argument is the object that the given block shall # make calls on to build something based on the enumerable that # each_with_object iterates over, an immutable argument makes no sense. # It's definitely a bug. # # @example # # # bad # # sum = numbers.each_with_object(0) { |e, a| a += e } # @example # # # good # # num = 0 # sum = numbers.each_with_object(num) { |e, a| a += e } # # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#24 class RuboCop::Cop::Lint::EachWithObjectArgument < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#28 def each_with_object?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#32 def on_csend(node); end # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#32 def on_send(node); end end # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#25 RuboCop::Cop::Lint::EachWithObjectArgument::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/each_with_object_argument.rb#26 RuboCop::Cop::Lint::EachWithObjectArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for odd else block layout - like # having an expression on the same line as the else keyword, # which is usually a mistake. # # @example # # # bad # # if something # # ... # else do_this # do_that # end # @example # # # good # # if something # # ... # else # do_this # do_that # end # # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#30 class RuboCop::Cop::Lint::ElseLayout < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#33 def on_if(node); end private # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#41 def check(node); end # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#51 def check_else(node); end end # source://rubocop//lib/rubocop/cop/lint/else_layout.rb#31 RuboCop::Cop::Lint::ElseLayout::MSG = T.let(T.unsafe(nil), String) # This cop checks for the presence of `if`, `elsif` and `unless` branches without a body. # # @example # # bad # if condition # end # # # bad # unless condition # end # # # bad # if condition # do_something # elsif other_condition # end # # # good # if condition # do_something # end # # # good # unless condition # do_something # end # # # good # if condition # do_something # elsif other_condition # do_something_else # end # @example AllowComments: true (default) # # good # if condition # do_something # elsif other_condition # # noop # end # @example AllowComments: false # # bad # if condition # do_something # elsif other_condition # # noop # end # # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#55 class RuboCop::Cop::Lint::EmptyConditionalBody < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#58 def on_if(node); end end # source://rubocop//lib/rubocop/cop/lint/empty_conditional_body.rb#56 RuboCop::Cop::Lint::EmptyConditionalBody::MSG = T.let(T.unsafe(nil), String) # This cop checks for empty `ensure` blocks # # @example # # # bad # # def some_method # do_something # ensure # end # @example # # # bad # # begin # do_something # ensure # end # @example # # # good # # def some_method # do_something # ensure # do_something_else # end # @example # # # good # # begin # do_something # ensure # do_something_else # end # # source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#45 class RuboCop::Cop::Lint::EmptyEnsure < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#50 def on_ensure(node); end end # source://rubocop//lib/rubocop/cop/lint/empty_ensure.rb#48 RuboCop::Cop::Lint::EmptyEnsure::MSG = T.let(T.unsafe(nil), String) # This cop checks for the presence of empty expressions. # # @example # # # bad # # foo = () # if () # bar # end # @example # # # good # # foo = (some_expression) # if (some_expression) # bar # end # # source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#25 class RuboCop::Cop::Lint::EmptyExpression < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#28 def on_begin(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#36 def empty_expression?(begin_node); end end # source://rubocop//lib/rubocop/cop/lint/empty_expression.rb#26 RuboCop::Cop::Lint::EmptyExpression::MSG = T.let(T.unsafe(nil), String) # This cop enforces that Ruby source files are not empty. # # @example # # bad # # Empty file # # # good # # File containing non commented source lines # @example AllowComments: true (default) # # good # # File consisting only of comments # @example AllowComments: false # # bad # # File consisting only of comments # # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#23 class RuboCop::Cop::Lint::EmptyFile < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#28 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#42 def contains_only_comments?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#38 def empty_file?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#34 def offending?; end end # source://rubocop//lib/rubocop/cop/lint/empty_file.rb#26 RuboCop::Cop::Lint::EmptyFile::MSG = T.let(T.unsafe(nil), String) # This cop checks for empty interpolation. # # @example # # # bad # # "result is #{}" # @example # # # good # # "result is #{some_result}" # # source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#19 class RuboCop::Cop::Lint::EmptyInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#25 def on_interpolation(begin_node); end end # source://rubocop//lib/rubocop/cop/lint/empty_interpolation.rb#23 RuboCop::Cop::Lint::EmptyInterpolation::MSG = T.let(T.unsafe(nil), String) # This cop checks for the presence of `when` branches without a body. # # @example # # # bad # case foo # when bar # do_something # when baz # end # @example # # # good # case condition # when foo # do_something # when bar # nil # end # @example AllowComments: true (default) # # # good # case condition # when foo # do_something # when bar # # noop # end # @example AllowComments: false # # # bad # case condition # when foo # do_something # when bar # # do nothing # end # # source://rubocop//lib/rubocop/cop/lint/empty_when.rb#47 class RuboCop::Cop::Lint::EmptyWhen < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/empty_when.rb#50 def on_case(node); end end # source://rubocop//lib/rubocop/cop/lint/empty_when.rb#48 RuboCop::Cop::Lint::EmptyWhen::MSG = T.let(T.unsafe(nil), String) # This cop 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 it were rescued. # # If you want to rescue some (or all) exceptions, best to do it explicitly # # @example # # # bad # # def foo # do_something # ensure # cleanup # return self # end # @example # # # good # # def foo # do_something # self # ensure # cleanup # end # # # also good # # def foo # begin # do_something # rescue SomeException # # Let's ignore this exception # end # self # ensure # cleanup # end # # source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#47 class RuboCop::Cop::Lint::EnsureReturn < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#53 def on_ensure(node); end end # source://rubocop//lib/rubocop/cop/lint/ensure_return.rb#51 RuboCop::Cop::Lint::EnsureReturn::MSG = T.let(T.unsafe(nil), String) # This cop emulates the following Ruby warnings in Ruby 2.6. # # % cat example.rb # ERB.new('hi', nil, '-', '@output_buffer') # % ruby -rerb example.rb # example.rb:1: warning: Passing safe_level with the 2nd argument of # ERB.new is deprecated. Do not use it, and specify other arguments as # keyword arguments. # example.rb:1: warning: Passing trim_mode with the 3rd argument of # ERB.new is deprecated. Use keyword argument like # ERB.new(str, trim_mode:...) instead. # example.rb:1: warning: Passing eoutvar with the 4th argument of ERB.new # is deprecated. Use keyword argument like ERB.new(str, eoutvar: ...) # instead. # # Now non-keyword arguments other than first one are softly deprecated # and will be removed when Ruby 2.5 becomes EOL. # `ERB.new` with non-keyword arguments is deprecated since ERB 2.2.0. # Use `:trim_mode` and `:eoutvar` keyword arguments to `ERB.new`. # This cop identifies places where `ERB.new(str, trim_mode, eoutvar)` can # be replaced by `ERB.new(str, :trim_mode: trim_mode, eoutvar: eoutvar)`. # # @example # # Target codes supports Ruby 2.6 and higher only # # bad # ERB.new(str, nil, '-', '@output_buffer') # # # good # ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') # # # Target codes supports Ruby 2.5 and lower only # # good # ERB.new(str, nil, '-', '@output_buffer') # # # Target codes supports Ruby 2.6, 2.5 and lower # # bad # ERB.new(str, nil, '-', '@output_buffer') # # # good # # Ruby standard library style # # https://github.com/ruby/ruby/commit/3406c5d # if ERB.instance_method(:initialize).parameters.assoc(:key) # Ruby 2.6+ # ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') # else # ERB.new(str, nil, '-', '@output_buffer') # end # # # good # # Use `RUBY_VERSION` style # if RUBY_VERSION >= '2.6' # ERB.new(str, trim_mode: '-', eoutvar: '@output_buffer') # else # ERB.new(str, nil, '-', '@output_buffer') # end # # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#62 class RuboCop::Cop::Lint::ErbNewArguments < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::TargetRubyVersion extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#83 def erb_new_with_non_keyword_arguments(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#88 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#156 def arguments_range(node); end # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#108 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#126 def build_kwargs(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#121 def correct_arguments?(arguments); end # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#143 def override_by_legacy_args(kwargs, node); end end # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#69 RuboCop::Cop::Lint::ErbNewArguments::MESSAGES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/erb_new_arguments.rb#81 RuboCop::Cop::Lint::ErbNewArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop looks for uses of flip-flop operator. # flip-flop operator is deprecated since Ruby 2.6.0. # # @example # # bad # (1..20).each do |x| # puts x if (x == 5) .. (x == 10) # end # # # good # (1..20).each do |x| # puts x if (x >= 5) && (x <= 10) # end # # source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#19 class RuboCop::Cop::Lint::FlipFlop < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#26 def on_eflipflop(node); end # source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#22 def on_iflipflop(node); end end # source://rubocop//lib/rubocop/cop/lint/flip_flop.rb#20 RuboCop::Cop::Lint::FlipFlop::MSG = T.let(T.unsafe(nil), String) # This cop 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 the `==/!=` operators checks # floating-point value representation to be exactly the same, which is very unlikely # if you perform any arithmetic operations involving precision loss. # # @example # # bad # x == 0.1 # x != 0.1 # # # good - using BigDecimal # x.to_d == 0.1.to_d # # # good # (x - 0.1).abs < Float::EPSILON # # # good # tolerance = 0.0001 # (x - 0.1).abs < tolerance # # # Or some other epsilon based type of comparison: # # https://www.embeddeduse.com/2019/08/26/qt-compare-two-floats/ # # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#31 class RuboCop::Cop::Lint::FloatComparison < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#40 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#79 def check_numeric_returning_method(node); end # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#63 def check_send(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#47 def float?(node); end end # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#34 RuboCop::Cop::Lint::FloatComparison::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#36 RuboCop::Cop::Lint::FloatComparison::FLOAT_INSTANCE_METHODS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#35 RuboCop::Cop::Lint::FloatComparison::FLOAT_RETURNING_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#32 RuboCop::Cop::Lint::FloatComparison::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/float_comparison.rb#38 RuboCop::Cop::Lint::FloatComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop 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. # # @example # # # bad # # float = 3.0e400 # @example # # # good # # float = 42.9 # # source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#21 class RuboCop::Cop::Lint::FloatOutOfRange < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#24 def on_float(node); end end # source://rubocop//lib/rubocop/cop/lint/float_out_of_range.rb#22 RuboCop::Cop::Lint::FloatOutOfRange::MSG = T.let(T.unsafe(nil), String) # 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 same # format string. Do not mix numbered, unnumbered, and named formats in # the same format string. # # @example # # # bad # # format('A value: %s and another: %i', a_value) # @example # # # good # # format('A value: %s and another: %i', a_value, another) # @example # # # bad # # format('Unnumbered format: %s and numbered: %2$s', a_value, another) # @example # # # good # # format('Numbered format: %1$s and numbered %2$s', a_value, another) # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#38 class RuboCop::Cop::Lint::FormatParameterMismatch < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#95 def called_on_string?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#49 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#132 def count_format_matches(node); end # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#114 def count_matches(node); end # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#136 def count_percent_matches(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#124 def countable_format?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#128 def countable_percent?(node); end # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#149 def expected_fields_count(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#164 def format?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#141 def format_method?(name, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#64 def format_string?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#110 def heredoc?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#68 def invalid_format_string?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#87 def matched_arguments_count?(expected, passed); end # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#185 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#100 def method_with_format_args?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#77 def offending_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#172 def percent?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#104 def splat_args?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#168 def sprintf?(node); end end # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#44 RuboCop::Cop::Lint::FormatParameterMismatch::KERNEL = T.let(T.unsafe(nil), String) # http://rubular.com/r/CvpbxkcTzy # # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#39 RuboCop::Cop::Lint::FormatParameterMismatch::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#41 RuboCop::Cop::Lint::FormatParameterMismatch::MSG_INVALID = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#47 RuboCop::Cop::Lint::FormatParameterMismatch::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#45 RuboCop::Cop::Lint::FormatParameterMismatch::SHOVEL = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/format_parameter_mismatch.rb#46 RuboCop::Cop::Lint::FormatParameterMismatch::STRING_TYPES = T.let(T.unsafe(nil), Array) # Prefer using `Hash#compare_by_identity` than using `object_id` for hash keys. # # This cop is marked as unsafe as a hash possibly can contain other keys # besides `object_id`s. # # @example # # bad # hash = {} # hash[foo.object_id] = :bar # hash.key?(baz.object_id) # # # good # hash = {}.compare_by_identity # hash[foo] = :bar # hash.key?(baz) # # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#22 class RuboCop::Cop::Lint::HashCompareByIdentity < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#27 def id_as_hash_key?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#31 def on_send(node); end end # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#25 RuboCop::Cop::Lint::HashCompareByIdentity::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/hash_compare_by_identity.rb#23 RuboCop::Cop::Lint::HashCompareByIdentity::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the ordering of a method call where # the receiver of the call is a HEREDOC. # # @example # # bad # # <<-SQL # bar # SQL # .strip_indent # # <<-SQL # bar # SQL # .strip_indent # .trim # # # good # # <<~SQL # bar # SQL # # <<~SQL.trim # bar # SQL # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#33 class RuboCop::Cop::Lint::HeredocMethodCallPosition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#40 def on_csend(node); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#40 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#100 def all_on_same_line?(nodes); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#53 def autocorrect(corrector, node, heredoc); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#80 def call_after_heredoc_range(heredoc); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#110 def call_end_pos(node); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#119 def call_line_range(node); end # Returns nil if no range can be safely repositioned. # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#125 def call_range_to_safely_reposition(node, heredoc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#89 def calls_on_multiple_lines?(node, _heredoc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#85 def correctly_positioned?(node, heredoc); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#114 def heredoc_begin_line_range(heredoc); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#106 def heredoc_end_pos(heredoc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#76 def heredoc_node?(node); end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#62 def heredoc_node_descendent_receiver(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#70 def send_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#149 def trailing_comma?(call_source, call_line_source); end end # source://rubocop//lib/rubocop/cop/lint/heredoc_method_call_position.rb#37 RuboCop::Cop::Lint::HeredocMethodCallPosition::MSG = T.let(T.unsafe(nil), String) # Prefer `equal?` over `==` when comparing `object_id`. # # `Object#equal?` is provided to compare objects for identity, and in contrast # `Object#==` is provided for the purpose of doing value comparison. # # @example # # bad # foo.object_id == bar.object_id # # # good # foo.equal?(bar) # # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#19 class RuboCop::Cop::Lint::IdentityComparison < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#25 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#41 def compare_between_object_id_by_double_equal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#45 def object_id_method?(node); end end # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#22 RuboCop::Cop::Lint::IdentityComparison::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/identity_comparison.rb#23 RuboCop::Cop::Lint::IdentityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for implicit string concatenation of string literals # which are on the same line. # # @example # # # bad # # array = ['Item 1' 'Item 2'] # @example # # # good # # array = ['Item 1Item 2'] # array = ['Item 1' + 'Item 2'] # array = [ # 'Item 1' \ # 'Item 2' # ] # # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#25 class RuboCop::Cop::Lint::ImplicitStringConcatenation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#33 def on_dstr(node); end private # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#84 def display_str(node); end # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#50 def each_bad_cons(node); end # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#65 def ending_delimiter(str); end # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#92 def str_content(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#75 def string_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#80 def string_literals?(node1, node2); end end # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#28 RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_ARRAY = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#30 RuboCop::Cop::Lint::ImplicitStringConcatenation::FOR_METHOD = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/implicit_string_concatenation.rb#26 RuboCop::Cop::Lint::ImplicitStringConcatenation::MSG = T.let(T.unsafe(nil), String) # This cop 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. # # @example # # # bad # # class C # private # # def self.method # puts 'hi' # end # end # @example # # # good # # class C # def self.method # puts 'hi' # end # # private_class_method :method # end # @example # # # good # # class C # class << self # private # # def method # puts 'hi' # end # end # end # # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#48 class RuboCop::Cop::Lint::IneffectiveAccessModifier < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#60 def on_class(node); end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#60 def on_module(node); end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#56 def private_class_methods(param0); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#112 def access_modifier?(node); end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#67 def check_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#116 def correct_visibility?(node, modifier, ignored_methods); end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#81 def format_message(modifier); end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#94 def ineffective_modifier(node, ignored_methods = T.unsafe(nil), modifier = T.unsafe(nil), &block); end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#75 def private_class_method_names(node); end end # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#51 RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PRIVATE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#53 RuboCop::Cop::Lint::IneffectiveAccessModifier::ALTERNATIVE_PROTECTED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/ineffective_access_modifier.rb#49 RuboCop::Cop::Lint::IneffectiveAccessModifier::MSG = T.let(T.unsafe(nil), String) # This cop looks for error classes inheriting from `Exception` # and its standard library subclasses, excluding subclasses of # `StandardError`. It is configurable to suggest using either # `RuntimeError` (default) or `StandardError` instead. # # @example EnforcedStyle: runtime_error (default) # # bad # # class C < Exception; end # # C = Class.new(Exception) # # # good # # class C < RuntimeError; end # # C = Class.new(RuntimeError) # @example EnforcedStyle: standard_error # # bad # # class C < Exception; end # # C = Class.new(Exception) # # # good # # class C < StandardError; end # # C = Class.new(StandardError) # # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#36 class RuboCop::Cop::Lint::InheritException < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#61 def class_new_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#67 def on_class(node); end # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#78 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#95 def illegal_class_name?(class_node); end # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#91 def message(node); end # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#99 def preferred_base_class; end end # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#45 RuboCop::Cop::Lint::InheritException::ILLEGAL_CLASSES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#40 RuboCop::Cop::Lint::InheritException::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#41 RuboCop::Cop::Lint::InheritException::PREFERRED_BASE_CLASS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/lint/inherit_exception.rb#59 RuboCop::Cop::Lint::InheritException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for interpolation in a single quoted string. # # @example # # # bad # # foo = 'something with #{interpolation} inside' # @example # # # good # # foo = "something with #{interpolation} inside" # # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#19 class RuboCop::Cop::Lint::InterpolationCheck < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#25 def on_str(node); end private # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#38 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#49 def heredoc?(node); end end # source://rubocop//lib/rubocop/cop/lint/interpolation_check.rb#22 RuboCop::Cop::Lint::InterpolationCheck::MSG = T.let(T.unsafe(nil), String) # This cop checks for literals used as the conditions or as # operands in and/or expressions serving as the conditions of # if/while/until. # # @example # # # bad # if 20 # do_something # end # # # bad # if some_var && true # do_something # end # # # good # if some_var && some_condition # do_something # end # # # good # # When using a boolean value for an infinite loop. # while true # break if condition # end # # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#32 class RuboCop::Cop::Lint::LiteralAsCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#76 def message(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#55 def on_case(case_node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#37 def on_if(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#70 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#48 def on_until(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#48 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#41 def on_while(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#41 def on_while_post(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#91 def basic_literal?(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#121 def check_case(case_node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#82 def check_for_literal(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#103 def check_node(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#130 def condition(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#113 def handle_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#99 def primitive_array?(node); end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#138 def when_conditions_range(when_node); end end # source://rubocop//lib/rubocop/cop/lint/literal_as_condition.rb#35 RuboCop::Cop::Lint::LiteralAsCondition::MSG = T.let(T.unsafe(nil), String) # This cop checks for interpolated literals. # # @example # # # bad # # "result is #{10}" # @example # # # good # # "result is 10" # # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#19 class RuboCop::Cop::Lint::LiteralInInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#28 def on_interpolation(begin_node); end private # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#51 def autocorrected_value(node); end # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#83 def autocorrected_value_for_array(node); end # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#68 def autocorrected_value_for_string(node); end # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#76 def autocorrected_value_for_symbol(node); end # Does node print its own source when converted to a string? # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#90 def prints_as_self?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#45 def special_keyword?(node); end end # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#26 RuboCop::Cop::Lint::LiteralInInterpolation::COMPOSITE = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/literal_in_interpolation.rb#25 RuboCop::Cop::Lint::LiteralInInterpolation::MSG = T.let(T.unsafe(nil), String) # This cop checks for uses of `begin...end while/until something`. # # @example # # # bad # # # using while # begin # do_something # end while some_condition # @example # # # bad # # # using until # begin # do_something # end until some_condition # @example # # # good # # # while replacement # loop do # do_something # break unless some_condition # end # @example # # # good # # # until replacement # loop do # do_something # break if some_condition # end # # source://rubocop//lib/rubocop/cop/lint/loop.rb#45 class RuboCop::Cop::Lint::Loop < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/loop.rb#55 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/lint/loop.rb#51 def on_while_post(node); end private # source://rubocop//lib/rubocop/cop/lint/loop.rb#75 def build_break_line(node); end # source://rubocop//lib/rubocop/cop/lint/loop.rb#80 def indent(node); end # source://rubocop//lib/rubocop/cop/lint/loop.rb#71 def keyword_and_condition_range(node); end # source://rubocop//lib/rubocop/cop/lint/loop.rb#61 def register_offense(node); end end # source://rubocop//lib/rubocop/cop/lint/loop.rb#48 RuboCop::Cop::Lint::Loop::MSG = T.let(T.unsafe(nil), String) # cop disables on wide ranges of code, that latter contributors to # a file wouldn't be aware of. # # @example # # Lint/MissingCopEnableDirective: # # MaximumRangeSize: .inf # # # good # # rubocop:disable Layout/SpaceAroundOperators # x= 0 # # rubocop:enable Layout/SpaceAroundOperators # # y = 1 # # EOF # # # bad # # rubocop:disable Layout/SpaceAroundOperators # x= 0 # # EOF # @example # # Lint/MissingCopEnableDirective: # # MaximumRangeSize: 2 # # # good # # rubocop:disable Layout/SpaceAroundOperators # x= 0 # # With the previous, there are 2 lines on which cop is disabled. # # rubocop:enable Layout/SpaceAroundOperators # # # bad # # rubocop:disable Layout/SpaceAroundOperators # x= 0 # x += 1 # # Including this, that's 3 lines on which the cop is disabled. # # rubocop:enable Layout/SpaceAroundOperators # # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#45 class RuboCop::Cop::Lint::MissingCopEnableDirective < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#54 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#74 def message(max_range:, cop:); end end # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#48 RuboCop::Cop::Lint::MissingCopEnableDirective::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/missing_cop_enable_directive.rb#50 RuboCop::Cop::Lint::MissingCopEnableDirective::MSG_BOUND = T.let(T.unsafe(nil), String) # This cop checks for the presence of constructors and lifecycle callbacks # without calls to `super`. # # @example # # bad # class Employee < Person # def initialize(name, salary) # @salary = salary # end # end # # # good # class Employee < Person # def initialize(name, salary) # super(name) # @salary = salary # end # end # # # bad # class Parent # def self.inherited(base) # do_something # end # end # # # good # class Parent # def self.inherited(base) # super # do_something # end # end # # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#40 class RuboCop::Cop::Lint::MissingSuper < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#56 def on_def(node); end # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#66 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#78 def callback_method_def?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#84 def contains_super?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#88 def inside_class_with_stateful_parent?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#74 def offender?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#93 def stateless_class?(node); end end # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#52 RuboCop::Cop::Lint::MissingSuper::CALLBACKS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#42 RuboCop::Cop::Lint::MissingSuper::CALLBACK_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#47 RuboCop::Cop::Lint::MissingSuper::CLASS_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#41 RuboCop::Cop::Lint::MissingSuper::CONSTRUCTOR_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#48 RuboCop::Cop::Lint::MissingSuper::METHOD_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#46 RuboCop::Cop::Lint::MissingSuper::OBJECT_LIFECYCLE_CALLBACKS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/missing_super.rb#44 RuboCop::Cop::Lint::MissingSuper::STATELESS_CLASSES = T.let(T.unsafe(nil), Array) # Do not mix named captures and numbered captures in a Regexp literal # because numbered capture is ignored if they're mixed. # Replace numbered captures with non-capturing groupings or # named captures. # # # bad # /(?FOO)(BAR)/ # # # good # /(?FOO)(?BAR)/ # # # good # /(?FOO)(?:BAR)/ # # # good # /(FOO)(BAR)/ # # source://rubocop//lib/rubocop/cop/lint/mixed_regexp_capture_types.rb#23 class RuboCop::Cop::Lint::MixedRegexpCaptureTypes < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/mixed_regexp_capture_types.rb#27 def on_regexp(node); end end # source://rubocop//lib/rubocop/cop/lint/mixed_regexp_capture_types.rb#24 RuboCop::Cop::Lint::MixedRegexpCaptureTypes::MSG = T.let(T.unsafe(nil), String) # 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 # comparison operators. # # @example # # # bad # # x < y < z # 10 <= x <= 20 # @example # # # good # # x < y && y < z # 10 <= x && x <= 20 # # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#24 class RuboCop::Cop::Lint::MultipleComparison < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#31 def multiple_compare?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#35 def on_send(node); end end # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#28 RuboCop::Cop::Lint::MultipleComparison::COMPARISON_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#27 RuboCop::Cop::Lint::MultipleComparison::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/multiple_comparison.rb#29 RuboCop::Cop::Lint::MultipleComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for nested method definitions. # # @example # # # bad # # # `bar` definition actually produces methods in the same scope # # as the outer `foo` method. Furthermore, the `bar` method # # will be redefined every time `foo` is invoked. # def foo # def bar # end # end # @example # # # good # # def foo # bar = -> { puts 'hello' } # bar.call # end # @example # # # good # # def foo # self.class.class_eval do # def bar # end # end # end # # def foo # self.class.module_exec do # def bar # end # end # end # @example # # # good # # def foo # class << self # def bar # end # end # end # # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#57 class RuboCop::Cop::Lint::NestedMethodDefinition < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#92 def class_or_module_or_struct_new_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#84 def eval_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#88 def exec_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#61 def on_def(node); end # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#61 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#79 def scoping_method_call?(child); end end # source://rubocop//lib/rubocop/cop/lint/nested_method_definition.rb#58 RuboCop::Cop::Lint::NestedMethodDefinition::MSG = T.let(T.unsafe(nil), String) # This cop checks for nested percent literals. # # @example # # # bad # # # The percent literal for nested_attributes is parsed as four tokens, # # yielding the array [:name, :content, :"%i[incorrectly", :"nested]"]. # attributes = { # valid_attributes: %i[name content], # nested_attributes: %i[name content %i[incorrectly nested]] # } # # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#18 class RuboCop::Cop::Lint::NestedPercentLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#32 def on_array(node); end # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#36 def on_percent_literal(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#42 def contains_percent_literals?(node); end end # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#21 RuboCop::Cop::Lint::NestedPercentLiteral::MSG = T.let(T.unsafe(nil), String) # The array of regular expressions representing percent literals that, # if found within a percent literal expression, will cause a # NestedPercentLiteral violation to be emitted. # # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#27 RuboCop::Cop::Lint::NestedPercentLiteral::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/nested_percent_literal.rb#28 RuboCop::Cop::Lint::NestedPercentLiteral::REGEXES = T.let(T.unsafe(nil), Array) # Don't omit the accumulator when calling `next` in a `reduce` block. # # @example # # # bad # # result = (1..4).reduce(0) do |acc, i| # next if i.odd? # acc + i # end # @example # # # good # # result = (1..4).reduce(0) do |acc, i| # next acc if i.odd? # acc + i # end # # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#25 class RuboCop::Cop::Lint::NextWithoutAccumulator < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#32 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#28 def on_body_of_reduce(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#44 def parent_block_node(node); end end # source://rubocop//lib/rubocop/cop/lint/next_without_accumulator.rb#26 RuboCop::Cop::Lint::NextWithoutAccumulator::MSG = T.let(T.unsafe(nil), String) # `Dir[...]` and `Dir.glob(...)` do not make any guarantees about # the order in which files are returned. The final order is # determined by the operating system and file system. # This means that using them in cases where the order matters, # such as requiring files, can lead to intermittent failures # that are hard to debug. To ensure this doesn't happen, # always sort the list. # # @example # # # bad # Dir["./lib/**/*.rb"].each do |file| # require file # end # # # good # Dir["./lib/**/*.rb"].sort.each do |file| # require file # end # @example # # # bad # Dir.glob(Rails.root.join(__dir__, 'test', '*.rb')) do |file| # require file # end # # # good # Dir.glob(Rails.root.join(__dir__, 'test', '*.rb')).sort.each do |file| # require file # end # @example # # # bad # Dir['./lib/**/*.rb'].each(&method(:require)) # # # good # Dir['./lib/**/*.rb'].sort.each(&method(:require)) # @example # # # bad # Dir.glob(Rails.root.join('test', '*.rb'), &method(:require)) # # # good # Dir.glob(Rails.root.join('test', '*.rb')).sort.each(&method(:require)) # # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#54 class RuboCop::Cop::Lint::NonDeterministicRequireOrder < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#150 def loop_variable(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#136 def method_require?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#59 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#72 def on_block_pass(node); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#128 def unsorted_dir_block?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#132 def unsorted_dir_each?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#145 def unsorted_dir_each_pass?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#140 def unsorted_dir_glob_pass?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#154 def var_is_required?(param0, param1); end private # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#89 def correct_block(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#99 def correct_block_pass(corrector, node); end # Returns range of last argument including comma and whitespace. # # @return [Parser::Source::Range] # # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#114 def last_arg_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#120 def unsorted_dir_loop?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#124 def unsorted_dir_pass?(node); end end # source://rubocop//lib/rubocop/cop/lint/non_deterministic_require_order.rb#57 RuboCop::Cop::Lint::NonDeterministicRequireOrder::MSG = T.let(T.unsafe(nil), String) # This cop checks for non-local exits from iterators without a return # value. It registers an offense under these conditions: # # * No value is returned, # * the block is preceded by a method chain, # * the block has arguments, # * the method which receives the block is not `define_method` # or `define_singleton_method`, # * the return is not contained in an inner scope, e.g. a lambda or a # method definition. # # @example # # class ItemApi # rescue_from ValidationError do |e| # non-iteration block with arg # return { message: 'validation error' } unless e.errors # allowed # error_array = e.errors.map do |error| # block with method chain # return if error.suppress? # warned # return "#{error.param}: invalid" unless error.message # allowed # "#{error.param}: #{error.message}" # end # { message: 'validation error', errors: error_array } # end # # def update_items # transaction do # block without arguments # return unless update_necessary? # allowed # find_each do |item| # block without method chain # return if item.stock == 0 # false-negative... # item.update!(foobar: true) # end # end # end # end # # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#41 class RuboCop::Cop::Lint::NonLocalExitFromIterator < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#76 def chained_send?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#77 def define_method?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#46 def on_return(return_node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#72 def return_value?(return_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#68 def scoped_node?(node); end end # source://rubocop//lib/rubocop/cop/lint/non_local_exit_from_iterator.rb#42 RuboCop::Cop::Lint::NonLocalExitFromIterator::MSG = T.let(T.unsafe(nil), String) # This cop 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. # # @example # # # bad # # '10'.to_i # '10.2'.to_f # '10'.to_c # # # good # # Integer('10', 10) # Float('10.2') # Complex('10') # # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#23 class RuboCop::Cop::Lint::NumberConversion < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#41 def datetime?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#45 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#37 def to_method(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#72 def correct_method(node, receiver); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#63 def date_time_object?(node); end end # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#26 RuboCop::Cop::Lint::NumberConversion::CONVERSION_METHOD_CLASS_MAPPING = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#31 RuboCop::Cop::Lint::NumberConversion::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/number_conversion.rb#35 RuboCop::Cop::Lint::NumberConversion::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks the proper ordering of magic comments and whether # a magic comment is not placed before a shebang. # # @example # # bad # # # frozen_string_literal: true # # encoding: ascii # p [''.frozen?, ''.encoding] #=> [true, #] # # # good # # # encoding: ascii # # frozen_string_literal: true # p [''.frozen?, ''.encoding] #=> [true, #] # # # good # # #!/usr/bin/env ruby # # encoding: ascii # # frozen_string_literal: true # p [''.frozen?, ''.encoding] #=> [true, #] # # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#30 class RuboCop::Cop::Lint::OrderedMagicComments < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#37 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#54 def autocorrect(corrector, encoding_line, frozen_string_literal_line); end # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#62 def magic_comment_lines; end # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#78 def magic_comments; end end # source://rubocop//lib/rubocop/cop/lint/ordered_magic_comments.rb#34 RuboCop::Cop::Lint::OrderedMagicComments::MSG = T.let(T.unsafe(nil), String) # This cops looks for references of Regexp captures that are out of range # and thus always returns nil. # # @example # # /(foo)bar/ =~ 'foobar' # # # bad - always returns nil # # puts $2 # => nil # # # good # # puts $1 # => foo # # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#21 class RuboCop::Cop::Lint::OutOfRangeRegexpRef < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#34 def on_match_with_lvasgn(node); end # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#30 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#57 def on_nth_ref(node); end # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#38 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#49 def on_when(node); end private # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#66 def check_regexp(node); end end # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#22 RuboCop::Cop::Lint::OutOfRangeRegexpRef::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#25 RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_ARGUMENT_METHODS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#27 RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_CAPTURE_METHODS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#24 RuboCop::Cop::Lint::OutOfRangeRegexpRef::REGEXP_RECEIVER_METHODS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/lint/out_of_range_regexp_ref.rb#28 RuboCop::Cop::Lint::OutOfRangeRegexpRef::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Set) # Checks for space between the name of a called method and a left # parenthesis. # # @example # # # bad # do_something (foo) # # # good # do_something(foo) # do_something (2 + 3) * 4 # do_something (foo * bar).baz # # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#18 class RuboCop::Cop::Lint::ParenthesesAsGroupedExpression < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#24 def on_csend(node); end # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#24 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#53 def chained_calls?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#49 def first_argument_starts_with_left_parenthesis?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#58 def operator_keyword?(node); end # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#79 def space_range(expr, space_length); end # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#63 def spaces_before_left_parenthesis(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#40 def valid_context?(node); end end # source://rubocop//lib/rubocop/cop/lint/parentheses_as_grouped_expression.rb#22 RuboCop::Cop::Lint::ParenthesesAsGroupedExpression::MSG = T.let(T.unsafe(nil), String) # This cop 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) # rather than meant to be part of the resulting strings. # # @example # # # bad # # %w('foo', "bar") # @example # # # good # # %w(foo bar) # # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#23 class RuboCop::Cop::Lint::PercentStringArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#34 def on_array(node); end # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#38 def on_percent_literal(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#55 def contains_quotes_or_commas?(node); end end # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#28 RuboCop::Cop::Lint::PercentStringArray::LEADING_QUOTE = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#31 RuboCop::Cop::Lint::PercentStringArray::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#27 RuboCop::Cop::Lint::PercentStringArray::QUOTES_AND_COMMAS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/percent_string_array.rb#29 RuboCop::Cop::Lint::PercentStringArray::TRAILING_QUOTE = T.let(T.unsafe(nil), Regexp) # This cop checks for colons and commas in %i, e.g. `%i(:foo, :bar)` # # It is more likely that the additional characters are unintended (for # example, mistranslating an array of literals to percent string notation) # rather than meant to be part of the resulting symbols. # # @example # # # bad # # %i(:foo, :bar) # @example # # # good # # %i(foo bar) # # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#23 class RuboCop::Cop::Lint::PercentSymbolArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#30 def on_array(node); end # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#34 def on_percent_literal(node); end private # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#44 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#54 def contains_colons_or_commas?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#64 def non_alphanumeric_literal?(literal); end end # source://rubocop//lib/rubocop/cop/lint/percent_symbol_array.rb#27 RuboCop::Cop::Lint::PercentSymbolArray::MSG = T.let(T.unsafe(nil), String) # This cop checks for `raise` or `fail` statements which are # raising `Exception` class. # # You can specify a module name that will be an implicit namespace # using `AllowedImplicitNamespaces` option. The cop cause a false positive # for namespaced `Exception` when a namespace is omitted. This option can # prevent the false positive by specifying a namespace to be omitted for # `Exception`. Alternatively, make `Exception` a fully qualified class # name with an explicit namespace. # # @example # # bad # raise Exception, 'Error message here' # # # good # raise StandardError, 'Error message here' # @example AllowedImplicitNamespaces: ['Gem'] # # good # module Gem # def self.foo # raise Exception # This exception means `Gem::Exception`. # end # end # # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#30 class RuboCop::Cop::Lint::RaiseException < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#36 def exception?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#40 def exception_new_with_message?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#45 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#80 def allow_implicit_namespaces; end # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#52 def check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#68 def implicit_namespace?(node); end end # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#33 RuboCop::Cop::Lint::RaiseException::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/raise_exception.rb#34 RuboCop::Cop::Lint::RaiseException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for `rand(1)` calls. # Such calls always return `0`. # # @example # # # bad # # rand 1 # Kernel.rand(-1) # rand 1.0 # rand(-1.0) # @example # # # good # # 0 # just use 0 instead # # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#23 class RuboCop::Cop::Lint::RandOne < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#32 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#28 def rand_one?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#40 def message(node); end end # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#24 RuboCop::Cop::Lint::RandOne::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/rand_one.rb#26 RuboCop::Cop::Lint::RandOne::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # removed without causing any offenses to be reported. It's implemented # as a cop in that it inherits from the Cop base class and calls # add_offense. The unusual part of its implementation is that it doesn't # have any on_* methods or an investigate method. This means that it # doesn't take part in the investigation phase when the other cops do # their work. Instead, it waits until it's called in a later stage of the # execution. The reason it can't be implemented as a normal cop is that # it depends on the results of all other cops to do its work. # # @example # # bad # # rubocop:disable Layout/LineLength # x += 1 # # rubocop:enable Layout/LineLength # # # good # x += 1 # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#28 class RuboCop::Cop::Lint::RedundantCopDisableDirective < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # @return [RedundantCopDisableDirective] a new instance of RedundantCopDisableDirective # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#36 def initialize(config = T.unsafe(nil), options = T.unsafe(nil), offenses = T.unsafe(nil)); end # Returns the value of attribute offenses_to_check. # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#34 def offenses_to_check; end # Sets the attribute offenses_to_check # # @param value the value to set the attribute offenses_to_check to. # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#34 def offenses_to_check=(_arg0); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#41 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#192 def add_offense_for_entire_comment(comment, cops); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#205 def add_offense_for_some_cops(comment, cops); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#181 def add_offenses(redundant_cops); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#259 def all_cop_names; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#165 def all_disabled?(comment); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#63 def comment_range_with_surrounding_space(range); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#221 def cop_range(comment, cop); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#244 def describe(cop); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#175 def directive_count(comment); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#84 def directive_range_in_list(range, ranges); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#127 def each_already_disabled(line_ranges, disabled_ranges); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#115 def each_line_range(line_ranges, disabled_ranges, offenses, cop); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#100 def each_redundant_disable(cop_disabled_line_ranges, offenses, &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#263 def ends_its_line?(range); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#146 def find_redundant(comment, offenses, cop, line_range, next_line_range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#169 def ignore_offense?(disabled_ranges, line_range); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#227 def matching_range(haystack, needle); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#59 def previous_line_blank?(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#236 def trailing_range?(ranges, range); end end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_disable_directive.rb#32 RuboCop::Cop::Lint::RedundantCopDisableDirective::COP_NAME = T.let(T.unsafe(nil), String) # removed. # # that cop checks whether any cop was actually enabled. # # @example # # bad # foo = 1 # # rubocop:enable Layout/LineLength # # # good # foo = 1 # @example # # bad # # rubocop:disable Style/StringLiterals # foo = "1" # # rubocop:enable Style/StringLiterals # baz # # rubocop:enable all # # # good # # rubocop:disable Style/StringLiterals # foo = "1" # # rubocop:enable all # baz # # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#37 class RuboCop::Cop::Lint::RedundantCopEnableDirective < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#44 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#116 def all_or_name(name); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#75 def comment_start(comment); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#79 def cop_name_indention(comment, name); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#70 def range_of_offense(comment, name); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#103 def range_to_remove(begin_pos, end_pos, comma_pos, comment); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#83 def range_with_comma(comment, name); end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#53 def register_offense(comment, cop_names); end end # source://rubocop//lib/rubocop/cop/lint/redundant_cop_enable_directive.rb#42 RuboCop::Cop::Lint::RedundantCopEnableDirective::MSG = T.let(T.unsafe(nil), String) # Checks for unnecessary `require` statement. # # The following features are unnecessary `require` statement because # they are already loaded. # # ruby -ve 'p $LOADED_FEATURES.reject { |feature| %r|/| =~ feature }' # ruby 2.2.8p477 (2017-09-14 revision 59906) [x86_64-darwin13] # ["enumerator.so", "rational.so", "complex.so", "thread.rb"] # # This cop targets Ruby 2.2 or higher containing these 4 features. # # @example # # bad # require 'unloaded_feature' # require 'thread' # # # good # require 'unloaded_feature' # # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#24 class RuboCop::Cop::Lint::RedundantRequireStatement < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#36 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#31 def unnecessary_require_statement?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#28 RuboCop::Cop::Lint::RedundantRequireStatement::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_require_statement.rb#29 RuboCop::Cop::Lint::RedundantRequireStatement::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for redundant safe navigation calls. # `instance_of?`, `kind_of?`, `is_a?`, `eql?`, `respond_to?`, and `equal?` methods # are checked by default. These are customizable with `AllowedMethods` option. # # This cop is marked as unsafe, because auto-correction can change the # return type of the expression. An offending expression that previously # could return `nil` will be auto-corrected to never return `nil`. # # In the example below, the safe navigation operator (`&.`) is unnecessary # because `NilClass` has methods like `respond_to?` and `is_a?`. # # @example # # bad # do_something if attrs&.respond_to?(:[]) # # # good # do_something if attrs.respond_to?(:[]) # # # bad # while node&.is_a?(BeginNode) # node = node.parent # end # # # good # while node.is_a?(BeginNode) # node = node.parent # end # # # good - without `&.` this will always return `true` # foo&.respond_to?(:to_a) # # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#37 class RuboCop::Cop::Lint::RedundantSafeNavigation < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#50 def on_csend(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#46 def respond_to_nil_specific_method?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#62 def check?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#72 def condition?(parent, node); end end # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#42 RuboCop::Cop::Lint::RedundantSafeNavigation::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_safe_navigation.rb#44 RuboCop::Cop::Lint::RedundantSafeNavigation::NIL_SPECIFIC_METHODS = T.let(T.unsafe(nil), Set) # This cop checks for unneeded usages of splat expansion # # @example # # # bad # # a = *[1, 2, 3] # a = *'a' # a = *1 # # begin # foo # rescue *[StandardError, ApplicationError] # bar # end # # case foo # when *[1, 2, 3] # bar # else # baz # end # @example # # # good # # c = [1, 2, 3] # a = *c # a, b = *c # a, *b = *c # a = *1..10 # a = ['a'] # # begin # foo # rescue StandardError, ApplicationError # bar # end # # case foo # when 1, 2, 3 # bar # else # baz # end # # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#52 class RuboCop::Cop::Lint::RedundantSplatExpansion < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#63 def array_new?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#70 def literal_expansion(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#74 def on_splat(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#111 def array_new_inside_array_literal?(array_new_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#133 def array_splat?(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#91 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#137 def method_argument?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#141 def part_of_an_array?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#148 def redundant_brackets?(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#97 def redundant_splat_expansion(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#156 def remove_brackets(array); end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#118 def replacement_range_and_content(node); end end # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#56 RuboCop::Cop::Lint::RedundantSplatExpansion::ARRAY_PARAM_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#61 RuboCop::Cop::Lint::RedundantSplatExpansion::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#55 RuboCop::Cop::Lint::RedundantSplatExpansion::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#60 RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_I = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#58 RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_CAPITAL_W = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#59 RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_I = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_splat_expansion.rb#57 RuboCop::Cop::Lint::RedundantSplatExpansion::PERCENT_W = T.let(T.unsafe(nil), String) # This cop checks for string conversion in string interpolation, # which is redundant. # # @example # # # bad # # "result is #{something.to_s}" # @example # # # good # # "result is #{something}" # # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#20 class RuboCop::Cop::Lint::RedundantStringCoercion < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#30 def on_interpolation(begin_node); end # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#28 def to_s_without_args?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#24 RuboCop::Cop::Lint::RedundantStringCoercion::MSG_DEFAULT = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_string_coercion.rb#25 RuboCop::Cop::Lint::RedundantStringCoercion::MSG_SELF = T.let(T.unsafe(nil), String) # This cop checks for redundant `with_index`. # # @example # # bad # ary.each_with_index do |v| # v # end # # # good # ary.each do |v| # v # end # # # bad # ary.each.with_index do |v| # v # end # # # good # ary.each do |v| # v # end # # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#29 class RuboCop::Cop::Lint::RedundantWithIndex < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#45 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#36 def redundant_with_index?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#62 def message(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#70 def with_index_range(send); end end # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#33 RuboCop::Cop::Lint::RedundantWithIndex::MSG_EACH_WITH_INDEX = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_with_index.rb#34 RuboCop::Cop::Lint::RedundantWithIndex::MSG_WITH_INDEX = T.let(T.unsafe(nil), String) # This cop checks for redundant `with_object`. # # @example # # bad # ary.each_with_object([]) do |v| # v # end # # # good # ary.each do |v| # v # end # # # bad # ary.each.with_object([]) do |v| # v # end # # # good # ary.each do |v| # v # end # # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#29 class RuboCop::Cop::Lint::RedundantWithObject < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#46 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#37 def redundant_with_object?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#63 def message(node); end # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#71 def with_object_range(send); end end # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#33 RuboCop::Cop::Lint::RedundantWithObject::MSG_EACH_WITH_OBJECT = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/redundant_with_object.rb#35 RuboCop::Cop::Lint::RedundantWithObject::MSG_WITH_OBJECT = T.let(T.unsafe(nil), String) # This cop checks for regexp literals used as `match-current-line`. # If a regexp literal is in condition, the regexp matches `$_` implicitly. # # @example # # bad # if /foo/ # do_something # end # # # good # if /foo/ =~ $_ # do_something # end # # source://rubocop//lib/rubocop/cop/lint/regexp_as_condition.rb#19 class RuboCop::Cop::Lint::RegexpAsCondition < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/regexp_as_condition.rb#25 def on_match_current_line(node); end end # source://rubocop//lib/rubocop/cop/lint/regexp_as_condition.rb#22 RuboCop::Cop::Lint::RegexpAsCondition::MSG = T.let(T.unsafe(nil), String) # This cop checks for expressions where there is a call to a predicate # method with at least one argument, where no parentheses are used around # the parameter list, and a boolean operator, && or ||, is used in the # last argument. # # The idea behind warning for these constructs is that the user might # be under the impression that the return value from the method call is # an operand of &&/||. # # @example # # # bad # # if day.is? :tuesday && month == :jan # # ... # end # @example # # # good # # if day.is?(:tuesday) && month == :jan # # ... # end # # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#30 class RuboCop::Cop::Lint::RequireParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#36 def on_csend(node); end # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#36 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#58 def check_predicate(predicate, node); end # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#49 def check_ternary(ternary, node); end end # source://rubocop//lib/rubocop/cop/lint/require_parentheses.rb#33 RuboCop::Cop::Lint::RequireParentheses::MSG = T.let(T.unsafe(nil), String) # This cop checks for `rescue` blocks targeting the Exception class. # # @example # # # bad # # begin # do_something # rescue Exception # handle_exception # end # @example # # # good # # begin # do_something # rescue ArgumentError # handle_exception # end # # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#27 class RuboCop::Cop::Lint::RescueException < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#31 def on_resbody(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#40 def targets_exception?(rescue_arg_node); end end # source://rubocop//lib/rubocop/cop/lint/rescue_exception.rb#28 RuboCop::Cop::Lint::RescueException::MSG = T.let(T.unsafe(nil), String) # Check for arguments to `rescue` that will result in a `TypeError` # if an exception is raised. # # @example # # bad # begin # bar # rescue nil # baz # end # # # bad # def foo # bar # rescue 1, 'a', "#{b}", 0.0, [], {} # baz # end # # # good # begin # bar # rescue # baz # end # # # good # def foo # bar # rescue NameError # baz # end # # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#37 class RuboCop::Cop::Lint::RescueType < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#63 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#44 def on_resbody(node); end private # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#74 def correction(*exceptions); end # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#85 def invalid_exceptions(exceptions); end # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#81 def valid_exceptions(exceptions); end end # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#42 RuboCop::Cop::Lint::RescueType::INVALID_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/rescue_type.rb#40 RuboCop::Cop::Lint::RescueType::MSG = T.let(T.unsafe(nil), String) # This cop 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 # return :qux if bar? # baz # end # # def foo=(bar) # return 42 # end # @example # # # good # def initialize # foo # return if bar? # baz # end # # def foo=(bar) # return # end # # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#34 class RuboCop::Cop::Lint::ReturnInVoidContext < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#37 def on_return(return_node); end private # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#57 def method_name(context_node); end # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#53 def non_void_context(return_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#65 def setter_method?(method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#61 def void_context_method?(method_name); end end # source://rubocop//lib/rubocop/cop/lint/return_in_void_context.rb#35 RuboCop::Cop::Lint::ReturnInVoidContext::MSG = T.let(T.unsafe(nil), String) # 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 safe navigation operator. # This cop checks for the problem outlined above. # # @example # # # bad # # x&.foo.bar # x&.foo + bar # x&.foo[bar] # @example # # # good # # x&.foo&.bar # x&.foo || bar # # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#26 class RuboCop::Cop::Lint::SafeNavigationChain < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#32 def bad_method?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#39 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#54 def method_chain(node); end end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_chain.rb#29 RuboCop::Cop::Lint::SafeNavigationChain::MSG = T.let(T.unsafe(nil), String) # This cop check to make sure that if safe navigation is used for a method # call in an `&&` or `||` condition that safe navigation is used for all # method calls on that same object. # # @example # # bad # foo&.bar && foo.baz # # # bad # foo.bar || foo&.baz # # # bad # foo&.bar && (foobar.baz || foo.baz) # # # good # foo.bar && foo.baz # # # good # foo&.bar || foo&.baz # # # good # foo&.bar && (foobar.baz || foo&.baz) # # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#29 class RuboCop::Cop::Lint::SafeNavigationConsistency < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#43 def check(node); end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#37 def on_csend(node); end private # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#65 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#71 def location(node, unsafe_method_call); end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#75 def top_conditional_ancestor(node); end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#88 def unsafe_method_calls(method_calls, safe_nav_receiver); end end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_consistency.rb#34 RuboCop::Cop::Lint::SafeNavigationConsistency::MSG = T.let(T.unsafe(nil), String) # This cop 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` will actually # do the opposite of what the author intends. # # @example # # bad # return if foo&.empty? # return unless foo&.empty? # # # good # return if foo && foo.empty? # return unless foo && foo.empty? # # source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#22 class RuboCop::Cop::Lint::SafeNavigationWithEmpty < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#32 def on_if(node); end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#28 def safe_navigation_empty_in_conditional?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/lint/safe_navigation_with_empty.rb#25 RuboCop::Cop::Lint::SafeNavigationWithEmpty::MSG = T.let(T.unsafe(nil), String) # This cop 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 execute permission. # # #!/usr/bin/env ruby # puts 'hello, world' # # # good # # # A file which has a shebang line as its first line is # # granted execute permission. # # #!/usr/bin/env ruby # puts 'hello, world' # # # good # # # A file which has not a shebang line as its first line is not # # granted execute permission. # # puts 'hello, world' # # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#33 class RuboCop::Cop::Lint::ScriptPermission < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#39 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#55 def autocorrect(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#59 def executable?(processed_source); end # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#66 def format_message_from(processed_source); end end # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#36 RuboCop::Cop::Lint::ScriptPermission::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/script_permission.rb#37 RuboCop::Cop::Lint::ScriptPermission::SHEBANG = T.let(T.unsafe(nil), String) # This cop checks for self-assignments. # # @example # # bad # foo = foo # foo, bar = foo, bar # Foo = Foo # # # good # foo = bar # foo, bar = bar, foo # Foo = Bar # # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#19 class RuboCop::Cop::Lint::SelfAssignment < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#53 def on_and_asgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#41 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#29 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#29 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#29 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#29 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#49 def on_masgn(node); end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#53 def on_or_asgn(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#61 def multiple_self_assignment?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#71 def rhs_matches_lhs?(rhs, lhs); end end # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#22 RuboCop::Cop::Lint::SelfAssignment::ASSIGNMENT_TYPE_TO_RHS_TYPE = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/lint/self_assignment.rb#20 RuboCop::Cop::Lint::SelfAssignment::MSG = T.let(T.unsafe(nil), String) # This cop 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 or # higher style that can be called by public methods. # And `extend` method that was originally a public method is also targeted # for style unification. # # @example # # bad # Foo.send(:include, Bar) # Foo.send(:prepend, Bar) # Foo.send(:extend, Bar) # # # bad # Foo.public_send(:include, Bar) # Foo.public_send(:prepend, Bar) # Foo.public_send(:extend, Bar) # # # bad # Foo.__send__(:include, Bar) # Foo.__send__(:prepend, Bar) # Foo.__send__(:extend, Bar) # # # good # Foo.include Bar # Foo.prepend Bar # Foo.extend Bar # # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#37 class RuboCop::Cop::Lint::SendWithMixinArgument < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#53 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#46 def send_with_mixin_argument?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#68 def bad_location(node); end # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#74 def message(method, module_name, bad_method); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#81 def mixin_method?(node); end end # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#42 RuboCop::Cop::Lint::SendWithMixinArgument::MIXIN_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#41 RuboCop::Cop::Lint::SendWithMixinArgument::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#44 RuboCop::Cop::Lint::SendWithMixinArgument::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/send_with_mixin_argument.rb#43 RuboCop::Cop::Lint::SendWithMixinArgument::SEND_METHODS = T.let(T.unsafe(nil), Array) # This cop 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 `IgnoreImplicitReferences` is `true`. # # @example # # # bad # do_something do |foo| # foo = 42 # puts foo # end # # def do_something(foo) # foo = 42 # puts foo # end # # # good # do_something do |foo| # foo = foo + 42 # puts foo # end # # def do_something(foo) # foo = foo + 42 # puts foo # end # # def do_something(foo) # puts foo # end # @example IgnoreImplicitReferences: false (default) # # # bad # def do_something(foo) # foo = 42 # super # end # # def do_something(foo) # foo = super # bar # end # @example IgnoreImplicitReferences: true # # # good # def do_something(foo) # foo = 42 # super # end # # def do_something(foo) # foo = super # bar # end # # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#66 class RuboCop::Cop::Lint::ShadowedArgument < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#76 def after_leaving_scope(scope, _variable_table); end # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#70 def uses_var?(param0, param1); end private # Get argument references without assignments' references # # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#163 def argument_references(argument); end # Find the first argument assignment, which doesn't reference the # argument at the rhs. If the assignment occurs inside a branch or # block, it is impossible to tell whether it's executed, so precise # shadowing location is not known. # # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#122 def assignment_without_argument_usage(argument); end # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#84 def check_argument(argument); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#176 def ignore_implicit_references?; end # Check whether the given node is nested into block or conditional. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#154 def node_within_block_or_conditional?(node, stop_search_node); end # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#146 def reference_pos(node); end # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#97 def shadowing_assignment(argument); end class << self # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#72 def joining_forces; end end end # source://rubocop//lib/rubocop/cop/lint/shadowed_argument.rb#67 RuboCop::Cop::Lint::ShadowedArgument::MSG = T.let(T.unsafe(nil), String) # This cop checks for a rescued exception that get shadowed by a # less specific exception being rescued before a more specific # exception is rescued. # # @example # # # bad # # begin # something # rescue Exception # handle_exception # rescue StandardError # handle_standard_error # end # # # good # # begin # something # rescue StandardError # handle_standard_error # rescue Exception # handle_exception # end # # # good, however depending on runtime environment. # # # # This is a special case for system call errors. # # System dependent error code depends on runtime environment. # # For example, whether `Errno::EAGAIN` and `Errno::EWOULDBLOCK` are # # the same error code or different error code depends on environment. # # This good case is for `Errno::EAGAIN` and `Errno::EWOULDBLOCK` with # # the same error code. # begin # something # rescue Errno::EAGAIN, Errno::EWOULDBLOCK # handle_standard_error # end # # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#46 class RuboCop::Cop::Lint::ShadowedException < ::RuboCop::Cop::Base include ::RuboCop::Cop::RescueNode include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#52 def on_rescue(node); end private # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#91 def compare_exceptions(exception, other_exception); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#82 def contains_multiple_levels_of_exceptions?(group); end # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#119 def evaluate_exceptions(group); end # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#165 def find_shadowing_rescue(rescues); end # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#70 def offense_range(rescues); end # @param rescue_group [RuboCop::AST::Node] is a node of array_type # # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#156 def rescued_exceptions(rescue_group); end # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#76 def rescued_groups_for(rescues); end # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#109 def silence_warnings; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#139 def sorted?(rescued_groups); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#105 def system_call_err?(error); end end # source://rubocop//lib/rubocop/cop/lint/shadowed_exception.rb#50 RuboCop::Cop::Lint::ShadowedException::MSG = T.let(T.unsafe(nil), String) # This cop checks for the use of local variable names from an outer scope # in block arguments or block-local variables. This mirrors the warning # given by `ruby -cw` prior to Ruby 2.6: # "shadowing outer local variable - foo". # # @example # # # bad # # def some_method # foo = 1 # # 2.times do |foo| # shadowing outer `foo` # do_something(foo) # end # end # @example # # # good # # def some_method # foo = 1 # # 2.times do |bar| # do_something(bar) # end # end # # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#34 class RuboCop::Cop::Lint::ShadowingOuterLocalVariable < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#41 def before_declaring_variable(variable, variable_table); end class << self # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#37 def joining_forces; end end end # source://rubocop//lib/rubocop/cop/lint/shadowing_outer_local_variable.rb#35 RuboCop::Cop::Lint::ShadowingOuterLocalVariable::MSG = T.let(T.unsafe(nil), String) # This cop 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 #=> [] (overriding `Struct#members`) # b.clone #=> true (overriding `Object#clone`) # b.count #=> 1 (overriding `Enumerable#count`) # # # good # Good = Struct.new(:id, :name) # g = Good.new(1, "foo") # g.members #=> [:id, :name] # g.clone #=> # # g.count #=> 2 # # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#24 class RuboCop::Cop::Lint::StructNewOverride < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#37 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#32 def struct_new(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#25 RuboCop::Cop::Lint::StructNewOverride::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#27 RuboCop::Cop::Lint::StructNewOverride::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#30 RuboCop::Cop::Lint::StructNewOverride::STRUCT_MEMBER_NAME_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/struct_new_override.rb#29 RuboCop::Cop::Lint::StructNewOverride::STRUCT_METHOD_NAMES = T.let(T.unsafe(nil), Array) # This cop checks for `rescue` blocks with no body. # # @example # # # bad # def some_method # do_something # rescue # end # # # bad # begin # do_something # rescue # end # # # good # def some_method # do_something # rescue # handle_exception # end # # # good # begin # do_something # rescue # handle_exception # end # @example AllowComments: true (default) # # # good # def some_method # do_something # rescue # # do nothing # end # # # good # begin # do_something # rescue # # do nothing # end # @example AllowComments: false # # # bad # def some_method # do_something # rescue # # do nothing # end # # # bad # begin # do_something # rescue # # do nothing # end # # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#67 class RuboCop::Cop::Lint::SuppressedException < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#70 def on_resbody(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#79 def comment_between_rescue_and_end?(node); end end # source://rubocop//lib/rubocop/cop/lint/suppressed_exception.rb#68 RuboCop::Cop::Lint::SuppressedException::MSG = T.let(T.unsafe(nil), String) # This cop repacks Parser's diagnostics/errors # into RuboCop's offenses. # # source://rubocop//lib/rubocop/cop/lint/syntax.rb#8 class RuboCop::Cop::Lint::Syntax < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/syntax.rb#9 def on_other_file; end private # source://rubocop//lib/rubocop/cop/lint/syntax.rb#20 def add_offense_from_diagnostic(diagnostic, ruby_version); end # source://rubocop//lib/rubocop/cop/lint/syntax.rb#29 def add_offense_from_error(error); end # source://rubocop//lib/rubocop/cop/lint/syntax.rb#34 def beautify_message(message); end end # This cop 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, your method should too. # # @example # class Point # attr_reader :x, :y # # # bad, incorrect arity # def to_json # JSON.generate([x, y]) # end # # # good, preserving args # def to_json(*args) # JSON.generate([x, y], *args) # end # # # good, discarding args # def to_json(*_args) # JSON.generate([x, y]) # end # end # # source://rubocop//lib/rubocop/cop/lint/to_json.rb#31 class RuboCop::Cop::Lint::ToJSON < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/to_json.rb#37 def on_def(node); end end # source://rubocop//lib/rubocop/cop/lint/to_json.rb#34 RuboCop::Cop::Lint::ToJSON::MSG = T.let(T.unsafe(nil), String) # This cop 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 # # # Detected since Ruby 2.7 # return 1 # 1 is always ignored. # # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#17 class RuboCop::Cop::Lint::TopLevelReturnWithArgument < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#21 def on_return(return_node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#27 def ancestors_valid?(return_node); end end # This cop works by validating the ancestors of the return node. A # top-level return node's ancestors should not be of block, def, or # defs type. # # source://rubocop//lib/rubocop/cop/lint/top_level_return_with_argument.rb#19 RuboCop::Cop::Lint::TopLevelReturnWithArgument::MSG = T.let(T.unsafe(nil), String) # This cop checks for trailing commas in attribute declarations, such as # `#attr_reader`. Leaving a trailing comma will nullify the next method # definition by overriding it with a getter method. # # @example # # # bad # class Foo # attr_reader :foo, # # def bar # puts "Unreachable." # end # end # # # good # class Foo # attr_reader :foo # # def bar # puts "No problem!" # end # end # # source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#30 class RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#36 def on_send(node); end private # source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#48 def trailing_comma_range(node); end end # source://rubocop//lib/rubocop/cop/lint/trailing_comma_in_attribute_declaration.rb#34 RuboCop::Cop::Lint::TrailingCommaInAttributeDeclaration::MSG = T.let(T.unsafe(nil), String) # This cop 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- # prefixed block keyword arguments. # # @example AllowKeywordBlockArguments: false (default) # # # bad # # [1, 2, 3].each do |_num| # do_something(_num) # end # # query(:sales) do |_id:, revenue:, cost:| # {_id: _id, profit: revenue - cost} # end # # # good # # [1, 2, 3].each do |num| # do_something(num) # end # # [1, 2, 3].each do |_num| # do_something # not using `_num` # end # @example AllowKeywordBlockArguments: true # # # good # # query(:sales) do |_id:, revenue:, cost:| # {_id: _id, profit: revenue - cost} # end # # source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#43 class RuboCop::Cop::Lint::UnderscorePrefixedVariableName < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#50 def after_leaving_scope(scope, _variable_table); end # source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#56 def check_variable(variable); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#74 def allowed_keyword_block_argument?(variable); end class << self # source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#46 def joining_forces; end end end # source://rubocop//lib/rubocop/cop/lint/underscore_prefixed_variable_name.rb#44 RuboCop::Cop::Lint::UnderscorePrefixedVariableName::MSG = T.let(T.unsafe(nil), String) # This cop checks for using Fixnum or Bignum constant. # # @example # # # bad # # 1.is_a?(Fixnum) # 1.is_a?(Bignum) # @example # # # good # # 1.is_a?(Integer) # # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#20 class RuboCop::Cop::Lint::UnifiedInteger < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#25 def fixnum_or_bignum_const(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#29 def on_const(node); end end # source://rubocop//lib/rubocop/cop/lint/unified_integer.rb#23 RuboCop::Cop::Lint::UnifiedInteger::MSG = T.let(T.unsafe(nil), String) # This cop 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 # return # do_something # end # # # bad # # def some_method # if cond # return # else # return # end # do_something # end # @example # # # good # # def some_method # do_something # end # # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#37 class RuboCop::Cop::Lint::UnreachableCode < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#54 def flow_command?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#40 def on_begin(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#40 def on_kwbegin(node); end private # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#87 def check_case(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#80 def check_if(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#64 def flow_expression?(node); end end # source://rubocop//lib/rubocop/cop/lint/unreachable_code.rb#38 RuboCop::Cop::Lint::UnreachableCode::MSG = T.let(T.unsafe(nil), String) # This cop checks for loops that will have at most one iteration. # # A loop that can never reach the second iteration is a possible error in the code. # In rare cases where only one iteration (or at most one iteration) is intended behavior, # the code should be refactored to use `if` conditionals. # # @example # # bad # while node # do_something(node) # node = node.parent # break # end # # # good # while node # do_something(node) # node = node.parent # end # # # bad # def verify_list(head) # item = head # begin # if verify(item) # return true # else # return false # end # end while(item) # end # # # good # def verify_list(head) # item = head # begin # if verify(item) # item = item.next # else # return false # end # end while(item) # # true # end # # # bad # def find_something(items) # items.each do |item| # if something?(item) # return item # else # raise NotFoundError # end # end # end # # # good # def find_something(items) # items.each do |item| # if something?(item) # return item # end # end # raise NotFoundError # end # # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#73 class RuboCop::Cop::Lint::UnreachableLoop < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#117 def break_command?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#84 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#76 def on_for(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#76 def on_until(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#76 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#76 def on_while(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#76 def on_while_post(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#127 def break_statement?(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#97 def check(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#151 def check_case(node); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#144 def check_if(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#90 def loop_method?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#161 def preceded_by_continue_statement?(break_statement); end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#105 def statements(node); end end # source://rubocop//lib/rubocop/cop/lint/unreachable_loop.rb#74 RuboCop::Cop::Lint::UnreachableLoop::MSG = T.let(T.unsafe(nil), String) # Common functionality for cops handling unused arguments. # # source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#7 module RuboCop::Cop::Lint::UnusedArgument extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#10 def after_leaving_scope(scope, _variable_table); end private # source://rubocop//lib/rubocop/cop/mixin/unused_argument.rb#18 def check_argument(variable); end end # This cop checks for unused block arguments. # # @example # # bad # do_something do |used, unused| # puts used # end # # do_something do |bar| # puts :foo # end # # define_method(:foo) do |bar| # puts :baz # end # # # good # do_something do |used, _unused| # puts used # end # # do_something do # puts :foo # end # # define_method(:foo) do |_bar| # puts :baz # end # @example IgnoreEmptyBlocks: true (default) # # good # do_something { |unused| } # @example IgnoreEmptyBlocks: false # # bad # do_something { |unused| } # @example AllowUnusedKeywordArguments: false (default) # # bad # do_something do |unused: 42| # foo # end # @example AllowUnusedKeywordArguments: true # # good # do_something do |unused: 42| # foo # end # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#55 class RuboCop::Cop::Lint::UnusedBlockArgument < ::RuboCop::Cop::Base include ::RuboCop::Cop::Lint::UnusedArgument extend ::RuboCop::Cop::AutoCorrector private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#160 def allow_unused_keyword_arguments?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#76 def allowed_block?(variable); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#81 def allowed_keyword_argument?(variable); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#96 def augment_message(message, variable); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#65 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#69 def check_argument(variable); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#147 def define_method_call?(variable); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#154 def empty_block?(variable); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#164 def ignore_empty_blocks?; end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#86 def message(variable); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#130 def message_for_lambda(variable, all_arguments); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#117 def message_for_normal_block(variable, all_arguments); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#142 def message_for_underscore_prefix(variable); end # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#109 def variable_type(variable); end class << self # source://rubocop//lib/rubocop/cop/lint/unused_block_argument.rb#59 def joining_forces; end end end # This cop checks for unused method arguments. # # @example # # bad # def some_method(used, unused, _unused_but_allowed) # puts used # end # # # good # def some_method(used, _unused, _unused_but_allowed) # puts used # end # @example AllowUnusedKeywordArguments: false (default) # # bad # def do_something(used, unused: 42) # used # end # @example AllowUnusedKeywordArguments: true # # good # def do_something(used, unused: 42) # used # end # @example IgnoreEmptyMethods: true (default) # # good # def do_something(unused) # end # @example IgnoreEmptyMethods: false # # bad # def do_something(unused) # end # @example IgnoreNotImplementedMethods: true (default) # # good # def do_something(unused) # raise NotImplementedError # end # # def do_something_else(unused) # fail "TODO" # end # @example IgnoreNotImplementedMethods: false # # bad # def do_something(unused) # raise NotImplementedError # end # # def do_something_else(unused) # fail "TODO" # end # # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#61 class RuboCop::Cop::Lint::UnusedMethodArgument < ::RuboCop::Cop::Base include ::RuboCop::Cop::Lint::UnusedArgument extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#65 def not_implemented?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#76 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#80 def check_argument(variable); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#89 def ignored_method?(body); end # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#95 def message(variable); end class << self # source://rubocop//lib/rubocop/cop/lint/unused_method_argument.rb#70 def joining_forces; end end end # This cop identifies places where `URI.escape` can be replaced by # `CGI.escape`, `URI.encode_www_form`, or `URI.encode_www_form_component` # depending on your specific use case. # Also this cop identifies places where `URI.unescape` can be replaced by # `CGI.unescape`, `URI.decode_www_form`, # or `URI.decode_www_form_component` depending on your specific use case. # # @example # # bad # URI.escape('http://example.com') # URI.encode('http://example.com') # # # good # CGI.escape('http://example.com') # URI.encode_www_form([['example', 'param'], ['lang', 'en']]) # URI.encode_www_form(page: 10, locale: 'en') # URI.encode_www_form_component('http://example.com') # # # bad # URI.unescape(enc_uri) # URI.decode(enc_uri) # # # good # CGI.unescape(enc_uri) # URI.decode_www_form(enc_uri) # URI.decode_www_form_component(enc_uri) # # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#32 class RuboCop::Cop::Lint::UriEscapeUnescape < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#56 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#50 def uri_escape_unescape?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#33 RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_ESCAPE = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#38 RuboCop::Cop::Lint::UriEscapeUnescape::ALTERNATE_METHODS_OF_URI_UNESCAPE = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#47 RuboCop::Cop::Lint::UriEscapeUnescape::METHOD_NAMES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#44 RuboCop::Cop::Lint::UriEscapeUnescape::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/uri_escape_unescape.rb#48 RuboCop::Cop::Lint::UriEscapeUnescape::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop identifies places where `URI.regexp` is obsolete and should # not be used. Instead, use `URI::DEFAULT_PARSER.make_regexp`. # # @example # # bad # URI.regexp('http://example.com') # # # good # URI::DEFAULT_PARSER.make_regexp('http://example.com') # # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#16 class RuboCop::Cop::Lint::UriRegexp < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#23 def on_send(node); end end # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#19 RuboCop::Cop::Lint::UriRegexp::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#21 RuboCop::Cop::Lint::UriRegexp::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/uri_regexp.rb#20 RuboCop::Cop::Lint::UriRegexp::URI_CONSTANTS = T.let(T.unsafe(nil), Array) # This cop checks for redundant access modifiers, including those with no # code, those which are repeated, and leading `public` modifiers in a # class or module body. Conditionally-defined methods are considered as # always being defined, and thus access modifiers guarding such methods # are not redundant. # # This cop has `ContextCreatingMethods` option. The default setting value # is an empty array that means no method is specified. # This setting is an array of methods which, when called, are known to # create its own context in the module's current access context. # # It also has `MethodCreatingMethods` option. The default setting value # is an empty array that means no method is specified. # This setting is an array of methods which, when called, are known to # create other methods in the module's current access context. # # @example # # bad # class Foo # public # this is redundant (default access is public) # # def method # end # end # # # bad # class Foo # # The following is redundant (methods defined on the class' # # singleton class are not affected by the public modifier) # public # # def self.method3 # end # end # # # bad # class Foo # protected # # define_method(:method2) do # end # # protected # this is redundant (repeated from previous modifier) # # [1,2,3].each do |i| # define_method("foo#{i}") do # end # end # end # # # bad # class Foo # private # this is redundant (no following methods are defined) # end # # # good # class Foo # private # this is not redundant (a method is defined) # # def method2 # end # end # # # good # class Foo # # The following is not redundant (conditionally defined methods are # # considered as always defining a method) # private # # if condition? # def method # end # end # end # # # good # class Foo # protected # this is not redundant (a method is defined) # # define_method(:method2) do # end # end # @example ContextCreatingMethods: concerning # # Lint/UselessAccessModifier: # # ContextCreatingMethods: # # - concerning # # # good # require 'active_support/concern' # class Foo # concerning :Bar do # def some_public_method # end # # private # # def some_private_method # end # end # # # this is not redundant because `concerning` created its own context # private # # def some_other_private_method # end # end # @example MethodCreatingMethods: delegate # # Lint/UselessAccessModifier: # # MethodCreatingMethods: # # - delegate # # # good # require 'active_support/core_ext/module/delegation' # class Foo # # this is not redundant because `delegate` creates methods # private # # delegate :method_a, to: :method_b # end # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#127 class RuboCop::Cop::Lint::UselessAccessModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#161 def class_or_instance_eval?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#165 def class_or_module_or_struct_new_call?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#157 def dynamic_method_definition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#139 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#133 def on_class(node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#133 def on_module(node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#133 def on_sclass(node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#153 def static_method_definition?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#181 def access_modifier?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#273 def any_context_creating_methods?(child); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#249 def any_method_definition?(child); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#147 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#195 def check_child_nodes(node, unused, cur_vis); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#222 def check_new_visibility(node, unused, new_vis, cur_vis); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#169 def check_node(node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#186 def check_scope(node); end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#211 def check_send_node(node, cur_vis, unused); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#267 def eval_call?(child); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#243 def method_definition?(child); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#262 def start_of_new_scope?(child); end end # source://rubocop//lib/rubocop/cop/lint/useless_access_modifier.rb#131 RuboCop::Cop::Lint::UselessAccessModifier::MSG = T.let(T.unsafe(nil), String) # This cop checks for every useless assignment to local variable in every # scope. # The basic idea for this cop was from the warning of `ruby -cw`: # # assigned but unused variable - foo # # Currently this cop has advanced logic that detects unreferenced # reassignments and properly handles varied cases such as branch, loop, # rescue, ensure, etc. # # @example # # # bad # # def some_method # some_var = 1 # do_something # end # @example # # # good # # def some_method # some_var = 1 # do_something(some_var) # end # # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#33 class RuboCop::Cop::Lint::UselessAssignment < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#40 def after_leaving_scope(scope, _variable_table); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#46 def check_for_unused_assignments(variable); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#113 def collect_variable_like_names(scope); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#64 def message_for_useless_assignment(assignment); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#71 def message_specification(assignment, variable); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#81 def multiple_assignment_message(variable_name); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#86 def operator_assignment_message(scope, assignment); end # TODO: More precise handling (rescue, ensure, nested begin, etc.) # # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#103 def return_value_node_of_scope(scope); end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#95 def similar_name_message(variable); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#122 def variable_like_method_invocation?(node); end class << self # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#36 def joining_forces; end end end # source://rubocop//lib/rubocop/cop/lint/useless_assignment.rb#34 RuboCop::Cop::Lint::UselessAssignment::MSG = T.let(T.unsafe(nil), String) # This cop checks for useless `else` in `begin..end` without `rescue`. # # NOTE: This syntax is no longer valid on Ruby 2.6 or higher and # this cop is going to be removed at some point the future. # # @example # # # bad # # begin # do_something # else # do_something_else # This will never be run. # end # @example # # # good # # begin # do_something # rescue # handle_errors # else # do_something_else # end # # source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#32 class RuboCop::Cop::Lint::UselessElseWithoutRescue < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#35 def on_new_investigation; end end # source://rubocop//lib/rubocop/cop/lint/useless_else_without_rescue.rb#33 RuboCop::Cop::Lint::UselessElseWithoutRescue::MSG = T.let(T.unsafe(nil), String) # This cop checks for useless method definitions, specifically: empty constructors # and methods just delegating to `super`. # # This cop is marked as unsafe as it can trigger false positives for cases when # an empty constructor just overrides the parent constructor, which is bad anyway. # # @example # # bad # def initialize # super # end # # def method # super # end # # # good - with default arguments # def initialize(x = Object.new) # super # end # # # good # def initialize # super # initialize_internals # end # # def method(*args) # super(:extra_arg, *args) # end # # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#37 class RuboCop::Cop::Lint::UselessMethodDefinition < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#42 def on_def(node); end # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#42 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#56 def delegating?(node, def_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#52 def optional_args?(node); end end # source://rubocop//lib/rubocop/cop/lint/useless_method_definition.rb#40 RuboCop::Cop::Lint::UselessMethodDefinition::MSG = T.let(T.unsafe(nil), String) # This cop checks for setter call to local variable as the final # expression of a function definition. # # NOTE: There are edge cases in which the local variable references a # value that is also accessible outside the local scope. This is not # detected by the cop, and it can yield a false positive. # # @example # # # bad # # def something # x = Something.new # x.attr = 5 # end # @example # # # good # # def something # x = Something.new # x.attr = 5 # x # end # # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#31 class RuboCop::Cop::Lint::UselessSetterCall < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#35 def on_def(node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#35 def on_defs(node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#54 def setter_call_to_local_variable?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#58 def last_expression(body); end end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#33 RuboCop::Cop::Lint::UselessSetterCall::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#32 RuboCop::Cop::Lint::UselessSetterCall::MSG = T.let(T.unsafe(nil), String) # This class tracks variable assignments in a method body # and if a variable contains object passed as argument at the end of # the method. # # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#67 class RuboCop::Cop::Lint::UselessSetterCall::MethodVariableTracker # @return [MethodVariableTracker] a new instance of MethodVariableTracker # # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#68 def initialize(body_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#156 def constructor?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#73 def contain_local_object?(variable_name); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#145 def process_assignment(asgn_node, rhs_node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#93 def process_assignment_node(node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#135 def process_binary_operator_assignment(op_asgn_node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#126 def process_logical_operator_assignment(asgn_node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#107 def process_multiple_assignment(masgn_node); end # source://rubocop//lib/rubocop/cop/lint/useless_setter_call.rb#83 def scan(node, &block); end end # This cop checks for uses of `Integer#times` that will never yield # (when the integer <= 0) or that will only ever yield once # (`1.times`). # # This cop is marked as unsafe as `times` returns its receiver, which # is *usually* OK, but might change behavior. # # @example # # bad # -5.times { do_something } # 0.times { do_something } # 1.times { do_something } # 1.times { |i| do_something(i) } # # # good # do_something # do_something(1) # # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#23 class RuboCop::Cop::Lint::UselessTimes < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#34 def block_arg(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#38 def block_reassigns_arg?(param0, param1); end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#42 def on_send(node); end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#30 def times_call?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#76 def autocorrect_block(corrector, node); end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#72 def autocorrect_block_pass(corrector, node, proc_name); end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#86 def fix_indentation(source, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#64 def never_process?(count, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#98 def own_line?(node); end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#68 def remove_node(corrector, node); end end # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#27 RuboCop::Cop::Lint::UselessTimes::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/useless_times.rb#28 RuboCop::Cop::Lint::UselessTimes::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for operators, variables, literals, and nonmutating # methods used in void context. # # @example CheckForMethodsWithNoSideEffects: false (default) # # bad # def some_method # some_num * 10 # do_something # end # # def some_method(some_var) # some_var # do_something # end # @example CheckForMethodsWithNoSideEffects: true # # bad # def some_method(some_array) # some_array.sort # do_something(some_array) # end # # # good # def some_method # do_something # some_num * 10 # end # # def some_method(some_var) # do_something # some_var # end # # def some_method(some_array) # some_array.sort! # do_something(some_array) # end # # source://rubocop//lib/rubocop/cop/lint/void.rb#43 class RuboCop::Cop::Lint::Void < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/lint/void.rb#71 def on_begin(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#64 def on_block(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#71 def on_kwbegin(node); end private # source://rubocop//lib/rubocop/cop/lint/void.rb#78 def check_begin(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#121 def check_defined(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#86 def check_expression(expr); end # source://rubocop//lib/rubocop/cop/lint/void.rb#109 def check_literal(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#127 def check_nonmutating(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#115 def check_self(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#103 def check_var(node); end # source://rubocop//lib/rubocop/cop/lint/void.rb#97 def check_void_op(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/lint/void.rb#137 def in_void_context?(node); end end # source://rubocop//lib/rubocop/cop/lint/void.rb#52 RuboCop::Cop::Lint::Void::BINARY_OPERATORS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/void.rb#48 RuboCop::Cop::Lint::Void::DEFINED_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/void.rb#46 RuboCop::Cop::Lint::Void::LIT_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/void.rb#56 RuboCop::Cop::Lint::Void::NONMUTATING_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/void.rb#49 RuboCop::Cop::Lint::Void::NONMUTATING_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/void.rb#54 RuboCop::Cop::Lint::Void::OPERATORS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/void.rb#44 RuboCop::Cop::Lint::Void::OP_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/void.rb#47 RuboCop::Cop::Lint::Void::SELF_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/void.rb#53 RuboCop::Cop::Lint::Void::UNARY_OPERATORS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/lint/void.rb#45 RuboCop::Cop::Lint::Void::VAR_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/lint/void.rb#55 RuboCop::Cop::Lint::Void::VOID_CONTEXT_TYPES = T.let(T.unsafe(nil), Array) # Common functionality for obtaining source ranges from regexp matches # # source://rubocop//lib/rubocop/cop/mixin/match_range.rb#6 module RuboCop::Cop::MatchRange include ::RuboCop::Cop::RangeHelp private # Return a new `Range` covering the first matching group number for each # match of `regex` inside `range` # # source://rubocop//lib/rubocop/cop/mixin/match_range.rb#13 def each_match_range(range, regex); end # For a `match` inside `range`, return a new `Range` covering the match # # source://rubocop//lib/rubocop/cop/mixin/match_range.rb#20 def match_range(range, match); end end # Message Annotator class annotates a basic offense message # based on params passed into initializer. # # #=> 'Cop/CopName: message (http://example.org/styleguide)' # # @example # RuboCop::Cop::MessageAnnotator.new( # config, cop_name, cop_config, @options # ).annotate('message') # @see #initialize # # source://rubocop//lib/rubocop/cop/message_annotator.rb#15 class RuboCop::Cop::MessageAnnotator # @option cop_config # @option cop_config # @option cop_config # @option options # @option options # @option options # @option options # @param config [RuboCop::Config] Check configs for all cops # @note Message Annotator specifically checks the # following config options for_all_cops # :StyleGuideBaseURL [String] URL for styleguide # :DisplayStyleGuide [Boolean] Include styleguide and reference URLs # :ExtraDetails [Boolean] Include cop details # :DisplayCopNames [Boolean] Include cop name # @param cop_name [String] for specific cop name # @param cop_config [Hash] configs for specific cop, from config#for_cop # @param options [Hash, nil] optional # @return [MessageAnnotator] a new instance of MessageAnnotator # # source://rubocop//lib/rubocop/cop/message_annotator.rb#47 def initialize(config, cop_name, cop_config, options); end # Returns the annotated message, # based on params passed into initializer # # @return [String] annotated message # # source://rubocop//lib/rubocop/cop/message_annotator.rb#58 def annotate(message); end # Returns the value of attribute config. # # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 def config; end # Returns the value of attribute cop_config. # # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 def cop_config; end # Returns the value of attribute cop_name. # # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 def cop_name; end # Returns the value of attribute options. # # source://rubocop//lib/rubocop/cop/message_annotator.rb#16 def options; end # source://rubocop//lib/rubocop/cop/message_annotator.rb#68 def urls; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/message_annotator.rb#110 def debug?; end # source://rubocop//lib/rubocop/cop/message_annotator.rb#123 def details; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/message_annotator.rb#114 def display_cop_names?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/message_annotator.rb#95 def display_style_guide?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/message_annotator.rb#106 def extra_details?; end # source://rubocop//lib/rubocop/cop/message_annotator.rb#101 def reference_urls; end # source://rubocop//lib/rubocop/cop/message_annotator.rb#88 def style_guide_base_url; end # source://rubocop//lib/rubocop/cop/message_annotator.rb#74 def style_guide_url; end class << self # Returns the value of attribute style_guide_urls. # # source://rubocop//lib/rubocop/cop/message_annotator.rb#21 def style_guide_urls; end end end # This module handles measurement and reporting of complexity in methods. # # @api private # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#8 module RuboCop::Cop::MethodComplexity include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::IgnoredMethods include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#31 def define_method?(param0 = T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#21 def on_block(node); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#14 def on_def(node); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#14 def on_defs(node); end private # @api private # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#38 def check_complexity(node, method_name); end # @api private # # source://rubocop//lib/rubocop/cop/mixin/method_complexity.rb#59 def complexity(body); end end # Common code for cops that deal with preferred methods. # # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#6 module RuboCop::Cop::MethodPreference private # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#26 def default_cop_config; end # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#9 def preferred_method(method); end # source://rubocop//lib/rubocop/cop/mixin/method_preference.rb#13 def preferred_methods; end end # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#5 module RuboCop::Cop::Metrics; end # This cop checks that the ABC size of methods is not higher than the # configured maximum. The ABC size is based on assignments, branches # (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric # and https://en.wikipedia.org/wiki/ABC_Software_Metric. # # source://rubocop//lib/rubocop/cop/metrics/abc_size.rb#10 class RuboCop::Cop::Metrics::AbcSize < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::IgnoredMethods include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount include ::RuboCop::Cop::MethodComplexity private # source://rubocop//lib/rubocop/cop/metrics/abc_size.rb#18 def complexity(node); end end # source://rubocop//lib/rubocop/cop/metrics/abc_size.rb#13 RuboCop::Cop::Metrics::AbcSize::MSG = T.let(T.unsafe(nil), String) # This cop checks if the length of a block exceeds some maximum value. # Comment lines can optionally be ignored. # The maximum allowed length is configurable. # The cop can be configured to ignore blocks passed to certain methods. # # You can set literals you want to fold with `CountAsOne`. # Available are: 'array', 'hash', and 'heredoc'. Each literal # will be counted as one line regardless of its actual size. # # NOTE: This cop does not apply for `Struct` definitions. # # @example CountAsOne: ['array', 'heredoc'] # # something do # array = [ # +1 # 1, # 2 # ] # # hash = { # +3 # key: 'value' # } # # msg = <<~HEREDOC # +1 # Heredoc # content. # HEREDOC # end # 5 points # # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#34 class RuboCop::Cop::Metrics::BlockLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::CodeLength # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#39 def on_block(node); end private # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#68 def cop_label; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#48 def excluded_method?(node); end # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#64 def excluded_methods; end end # source://rubocop//lib/rubocop/cop/metrics/block_length.rb#37 RuboCop::Cop::Metrics::BlockLength::LABEL = T.let(T.unsafe(nil), String) # This cop checks for excessive nesting of conditional and looping # constructs. # # You can configure if blocks are considered using the `CountBlocks` # option. When set to `false` (the default) blocks are not counted # towards the nesting level. Set to `true` to count blocks as well. # # The maximum level of nesting allowed is configurable. # # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#14 class RuboCop::Cop::Metrics::BlockNesting < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#22 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#31 def check_nesting_level(node, max, current_level); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#49 def consider_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#59 def count_blocks?; end # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#55 def message(max); end end # source://rubocop//lib/rubocop/cop/metrics/block_nesting.rb#17 RuboCop::Cop::Metrics::BlockNesting::NESTING_BLOCKS = T.let(T.unsafe(nil), Array) # This cop checks if the length a class exceeds some maximum value. # Comment lines can optionally be ignored. # The maximum allowed length is configurable. # # You can set literals you want to fold with `CountAsOne`. # Available are: 'array', 'hash', and 'heredoc'. Each literal # will be counted as one line regardless of its actual size. # # NOTE: This cop also applies for `Struct` definitions. # # @example CountAsOne: ['array', 'heredoc'] # # class Foo # ARRAY = [ # +1 # 1, # 2 # ] # # HASH = { # +3 # key: 'value' # } # # MSG = <<~HEREDOC # +1 # Heredoc # content. # HEREDOC # end # 5 points # # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#34 class RuboCop::Cop::Metrics::ClassLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::CodeLength # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#41 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#37 def on_class(node); end private # source://rubocop//lib/rubocop/cop/metrics/class_length.rb#59 def message(length, max_length); end end # This cop checks that the cyclomatic complexity of methods is not higher # than the configured maximum. The cyclomatic complexity is the number of # linearly independent paths through a method. The algorithm counts # decision points and adds one. # # An if statement (or unless or ?:) increases the complexity by one. An # else branch does not, since it doesn't add a decision point. The && # operator (or keyword and) can be converted to a nested if statement, # and ||/or is shorthand for a sequence of ifs, so they also add one. # Loops can be said to have an exit condition, so they add one. # Blocks that are calls to builtin iteration methods # (e.g. `ary.map{...}) also add one, others are ignored. # # def each_child_node(*types) # count begins: 1 # unless block_given? # unless: +1 # return to_enum(__method__, *types) # # children.each do |child| # each{}: +1 # next unless child.is_a?(Node) # unless: +1 # # yield child if types.empty? || # if: +1, ||: +1 # types.include?(child.type) # end # # self # end # total: 6 # # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#32 class RuboCop::Cop::Metrics::CyclomaticComplexity < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::IgnoredMethods include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount include ::RuboCop::Cop::MethodComplexity include ::RuboCop::Cop::Metrics::Utils::IteratingBlock private # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#50 def block_method(node); end # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#43 def complexity_score_for(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#59 def count_block?(block); end end # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#38 RuboCop::Cop::Metrics::CyclomaticComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/metrics/cyclomatic_complexity.rb#36 RuboCop::Cop::Metrics::CyclomaticComplexity::MSG = T.let(T.unsafe(nil), String) # This cop checks if the length of a method exceeds some maximum value. # Comment lines can optionally be ignored. # The maximum allowed length is configurable. # # You can set literals you want to fold with `CountAsOne`. # Available are: 'array', 'hash', and 'heredoc'. Each literal # will be counted as one line regardless of its actual size. # # @example CountAsOne: ['array', 'heredoc'] # # def m # array = [ # +1 # 1, # 2 # ] # # hash = { # +3 # key: 'value' # } # # <<~HEREDOC # +1 # Heredoc # content. # HEREDOC # end # 5 points # # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#32 class RuboCop::Cop::Metrics::MethodLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::CodeLength # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#45 def on_block(node); end # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#37 def on_def(node); end # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#37 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#53 def cop_label; end end # source://rubocop//lib/rubocop/cop/metrics/method_length.rb#35 RuboCop::Cop::Metrics::MethodLength::LABEL = T.let(T.unsafe(nil), String) # This cop checks if the length a module exceeds some maximum value. # Comment lines can optionally be ignored. # The maximum allowed length is configurable. # # You can set literals you want to fold with `CountAsOne`. # Available are: 'array', 'hash', and 'heredoc'. Each literal # will be counted as one line regardless of its actual size. # # @example CountAsOne: ['array', 'heredoc'] # # module M # ARRAY = [ # +1 # 1, # 2 # ] # # HASH = { # +3 # key: 'value' # } # # MSG = <<~HEREDOC # +1 # Heredoc # content. # HEREDOC # end # 5 points # # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#32 class RuboCop::Cop::Metrics::ModuleLength < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::CodeLength # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#47 def module_definition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#39 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#35 def on_module(node); end private # source://rubocop//lib/rubocop/cop/metrics/module_length.rb#51 def message(length, max_length); end end # This cop checks for methods with too many parameters. # The maximum number of parameters is configurable. # Keyword arguments can optionally be excluded from the total count. # # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#9 class RuboCop::Cop::Metrics::ParameterLists < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableMax # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#28 def argument_to_lambda_or_proc?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#15 def on_args(node); end private # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#32 def args_count(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#44 def count_keyword_args?; end # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#40 def max_params; end end # source://rubocop//lib/rubocop/cop/metrics/parameter_lists.rb#12 RuboCop::Cop::Metrics::ParameterLists::MSG = T.let(T.unsafe(nil), String) # This cop tries to produce a complexity score that's a measure of the # complexity the reader experiences when looking at a method. For that # reason it considers `when` nodes as something that doesn't add as much # complexity as an `if` or a `&&`. Except if it's one of those special # `case`/`when` constructs where there's no expression after `case`. Then # the cop treats it as an `if`/`elsif`/`elsif`... and lets all the `when` # nodes count. In contrast to the CyclomaticComplexity cop, this cop # considers `else` nodes as adding complexity. # # @example # # def my_method # 1 # if cond # 1 # case var # 2 (0.8 + 4 * 0.2, rounded) # when 1 then func_one # when 2 then func_two # when 3 then func_three # when 4..10 then func_other # end # else # 1 # do_something until a && b # 2 # end # === # end # 7 complexity points # # source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#29 class RuboCop::Cop::Metrics::PerceivedComplexity < ::RuboCop::Cop::Metrics::CyclomaticComplexity private # source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#37 def complexity_score_for(node); end end # source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#33 RuboCop::Cop::Metrics::PerceivedComplexity::COUNTED_NODES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/metrics/perceived_complexity.rb#30 RuboCop::Cop::Metrics::PerceivedComplexity::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#6 module RuboCop::Cop::Metrics::Utils; end # > ABC is .. a software size metric .. computed by counting the number # > of assignments, branches and conditions for a section of code. # > http://c2.com/cgi/wiki?AbcMetric # # We separate the *calculator* from the *cop* so that the calculation, # the formula itself, is easier to test. # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#13 class RuboCop::Cop::Metrics::Utils::AbcSizeCalculator include ::RuboCop::Cop::Metrics::Utils::IteratingBlock include ::RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount # @return [AbcSizeCalculator] a new instance of AbcSizeCalculator # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#36 def initialize(node); end # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#44 def calculate; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#75 def else_branch?(node); end # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#61 def evaluate_branch_nodes(node); end # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#70 def evaluate_condition_node(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#125 def argument?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#83 def assignment?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#121 def branch?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#117 def capturing_variable?(name); end # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#92 def compound_assignment(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#129 def condition?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#106 def simple_assignment?(node); end class << self # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#27 def calculate(node); end end end # TODO: move to rubocop-ast # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#32 RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::ARGUMENT_TYPES = T.let(T.unsafe(nil), Array) # > Branch -- an explicit forward program branch out of scope -- a # > function call, class method call .. # > http://c2.com/cgi/wiki?AbcMetric # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#20 RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::BRANCH_NODES = T.let(T.unsafe(nil), Array) # > Condition -- a logical/Boolean test, == != <= >= < > else case # > default try catch ? and unary conditionals. # > http://c2.com/cgi/wiki?AbcMetric # # source://rubocop//lib/rubocop/cop/metrics/utils/abc_size_calculator.rb#25 RuboCop::Cop::Metrics::Utils::AbcSizeCalculator::CONDITION_NODES = T.let(T.unsafe(nil), Array) # Helps to calculate code length for the provided node. # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#8 class RuboCop::Cop::Metrics::Utils::CodeLengthCalculator include ::RuboCop::PathUtil include ::RuboCop::Cop::Util extend ::RuboCop::AST::NodePattern::Macros # @return [CodeLengthCalculator] a new instance of CodeLengthCalculator # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#16 def initialize(node, processed_source, count_comments: T.unsafe(nil), foldable_types: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#24 def calculate; end private # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#40 def build_foldable_checks(types); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#78 def classlike_code_length(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#126 def classlike_node?(node); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#61 def code_length(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#151 def count_comments?; end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#114 def each_top_level_descendant(node, types, &block); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#134 def extract_body(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#130 def foldable_node?(node); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#109 def heredoc_length(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#74 def heredoc_node?(node); end # Returns true for lines that shall not be included in the count. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#147 def irrelevant_line?(source_line); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#98 def line_numbers_of_inner_nodes(node, *types); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#94 def namespace_module?(node); end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#56 def normalize_foldable_types(types); end end # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#13 RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::CLASSLIKE_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/metrics/utils/code_length_calculator.rb#12 RuboCop::Cop::Metrics::Utils::CodeLengthCalculator::FOLDABLE_TYPES = T.let(T.unsafe(nil), Array) # Used to identify iterating blocks like `.map{}` and `.map(&:...)` # # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#8 module RuboCop::Cop::Metrics::Utils::IteratingBlock # Returns the name of the method called with a block # if node is a block node, or a block-pass node. # # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#37 def block_method_name(node); end # Returns nil if node is neither a block node or a block-pass node. # Otherwise returns true/false if method call is a known iterating call # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#53 def iterating_block?(node); end # Returns true iff name is a known iterating type (e.g. :each, :transform_values) # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#47 def iterating_method?(name); end end # source://rubocop//lib/rubocop/cop/metrics/utils/iterating_block.rb#33 RuboCop::Cop::Metrics::Utils::IteratingBlock::KNOWN_ITERATING_METHODS = T.let(T.unsafe(nil), Set) # Helps to calculate code length for the provided node. # # @api private # # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#10 module RuboCop::Cop::Metrics::Utils::RepeatedCsendDiscount # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#15 def discount_for_repeated_csend?(csend_node); end # @api private # # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#29 def reset_on_lvasgn(node); end # @api private # # source://rubocop//lib/rubocop/cop/metrics/utils/repeated_csend_discount.rb#11 def reset_repeated_csend; end end # source://rubocop//lib/rubocop/cop/migration/department_name.rb#5 module RuboCop::Cop::Migration; end # department name. # # source://rubocop//lib/rubocop/cop/migration/department_name.rb#8 class RuboCop::Cop::Migration::DepartmentName < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/migration/department_name.rb#22 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/migration/department_name.rb#48 def check_cop_name(name, comment, offset); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/migration/department_name.rb#69 def contain_unexpected_character_for_department_name?(name); end # source://rubocop//lib/rubocop/cop/migration/department_name.rb#44 def disable_comment_offset; end # source://rubocop//lib/rubocop/cop/migration/department_name.rb#73 def qualified_legacy_cop_name(cop_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/migration/department_name.rb#64 def valid_content_token?(content_token); end end # source://rubocop//lib/rubocop/cop/migration/department_name.rb#14 RuboCop::Cop::Migration::DepartmentName::DISABLE_COMMENT_FORMAT = T.let(T.unsafe(nil), Regexp) # The token that makes up a disable comment. # `DepartmentName/CopName` or` all`. # # source://rubocop//lib/rubocop/cop/migration/department_name.rb#20 RuboCop::Cop::Migration::DepartmentName::DISABLING_COPS_CONTENT_TOKEN = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/migration/department_name.rb#12 RuboCop::Cop::Migration::DepartmentName::MSG = T.let(T.unsafe(nil), String) # Common functionality for checking minimum body length. # # source://rubocop//lib/rubocop/cop/mixin/min_body_length.rb#6 module RuboCop::Cop::MinBodyLength private # source://rubocop//lib/rubocop/cop/mixin/min_body_length.rb#13 def min_body_length; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/min_body_length.rb#9 def min_body_length?(node); end end # Common code for indenting the first elements in multiline # array literals, hash literals, and method definitions. # # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#7 module RuboCop::Cop::MultilineElementIndentation private # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#49 def base_column(left_brace, left_parenthesis); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#41 def check_expected_style(styles); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#26 def check_first(first, left_brace, left_parenthesis, offset); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#59 def detected_styles(actual_column, offset, left_parenthesis, left_brace); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#64 def detected_styles_for_column(column, left_parenthesis, left_brace); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#10 def each_argument_node(node, type); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_indentation.rb#77 def incorrect_style_detected(styles, first, left_parenthesis); end end # Common functionality for checking for a line break before each # element in a multi-line collection. # # source://rubocop//lib/rubocop/cop/mixin/multiline_element_line_breaks.rb#10 module RuboCop::Cop::MultilineElementLineBreaks private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_element_line_breaks.rb#28 def all_on_same_line?(nodes); end # source://rubocop//lib/rubocop/cop/mixin/multiline_element_line_breaks.rb#13 def check_line_breaks(_node, children); end end # Common functionality for checking multiline method calls and binary # operations. # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#7 module RuboCop::Cop::MultilineExpressionIndentation # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#16 def on_send(node); end private # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#155 def argument_in_method_call(node, kind); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#214 def assignment_rhs(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#85 def check(range, node, lhs, rhs); end # The correct indentation of `node` is usually `IndentationWidth`, with # one exception: prefix keywords. # # ``` # while foo && # Here, `while` is called a "prefix keyword" # bar # This is called "special indentation" # baz # end # ``` # # Note that *postfix conditionals* do *not* get "special indentation". # # ``` # next if foo && # bar # normal indentation, not special # ``` # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#74 def correct_indentation(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#185 def disqualified_rhs?(candidate, ancestor); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#231 def grouped_expression?(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#93 def incorrect_style_detected(range, node, lhs, rhs); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#104 def indentation(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#145 def indented_keyword_expression(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#235 def inside_arg_list_parentheses?(node, ancestor); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#120 def keyword_message_tail(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#130 def kw_node_with_special_indentation(node); end # In a chain of method calls, we regard the top send node as the base # for indentation of all lines following the first. For example: # a. # b c { block }. <-- b is indented relative to a # d <-- d is indented relative to a # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#33 def left_hand_side(lhs); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#224 def not_for_this_cop?(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#108 def operation_description(node, rhs); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#171 def part_of_assignment_rhs(node, candidate); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#210 def part_of_block_body?(candidate, block_node); end # Returns true if `node` is a conditional whose `body` and `condition` # begin on the same line. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#244 def postfix_conditional?(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#46 def regular_method_right_hand_side(send_node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#38 def right_hand_side(send_node); end # The []= operator and setters (a.b = c) are parsed as :send nodes. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#201 def valid_method_rhs_candidate?(candidate, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#190 def valid_rhs?(candidate, ancestor); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#206 def valid_rhs_candidate?(candidate, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#248 def within_node?(inner, outer); end end # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#12 RuboCop::Cop::MultilineExpressionIndentation::ASSIGNMENT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#11 RuboCop::Cop::MultilineExpressionIndentation::DEFAULT_MESSAGE_TAIL = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#8 RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_ANCESTOR_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#13 RuboCop::Cop::MultilineExpressionIndentation::KEYWORD_MESSAGE_TAIL = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/multiline_expression_indentation.rb#9 RuboCop::Cop::MultilineExpressionIndentation::UNALIGNED_RHS_TYPES = T.let(T.unsafe(nil), Array) # Autocorrection logic for the closing brace of a literal either # on the same line as the last contained elements, or a new line. # # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#7 class RuboCop::Cop::MultilineLiteralBraceCorrector include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MultilineLiteralBraceLayout include ::RuboCop::Cop::RangeHelp # @return [MultilineLiteralBraceCorrector] a new instance of MultilineLiteralBraceCorrector # # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#15 def initialize(corrector, node, processed_source); end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#21 def call; end private # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#54 def content_if_comment_present(corrector, node); end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#43 def correct_next_line_brace(corrector); end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#39 def correct_same_line_brace(corrector); end # Returns the value of attribute corrector. # # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#37 def corrector; end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#80 def last_element_range_with_trailing_comma(node); end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#89 def last_element_trailing_comma_range(node); end # Returns the value of attribute node. # # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#37 def node; end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#37 def processed_source; end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#76 def remove_trailing_content_of_comment(corrector, range); end # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#66 def select_content_to_be_inserted_after_last_element(corrector, node); end class << self # source://rubocop//lib/rubocop/cop/correctors/multiline_literal_brace_corrector.rb#11 def correct(corrector, node, processed_source); end end end # Common functionality for checking the closing brace of a literal is # either on the same line as the last contained elements or a new line. # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#7 module RuboCop::Cop::MultilineLiteralBraceLayout include ::RuboCop::Cop::ConfigurableEnforcedStyle private # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#35 def check(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#12 def check_brace_layout(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#43 def check_new_line(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#51 def check_same_line(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#59 def check_symmetrical(node); end # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#87 def children(node); end # This method depends on the fact that we have guarded # against implicit and empty literals. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#99 def closing_brace_on_same_line?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#75 def empty_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#83 def ignored_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#79 def implicit_literal?(node); end # Starting with the parent node and recursively for the parent node's # children, check if the node is a HEREDOC and if the HEREDOC ends below # or on the last line of the parent node. # # Example: # # # node is `b: ...` parameter # # last_line_heredoc?(node) => false # foo(a, # b: { # a: 1, # c: <<-EOM # baz # EOM # } # ) # # # node is `b: ...` parameter # # last_line_heredoc?(node) => true # foo(a, # b: <<-EOM # baz # EOM # ) # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#127 def last_line_heredoc?(node, parent = T.unsafe(nil)); end # Returns true for the case # [a, # b # comment # ].some_method # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#26 def new_line_needed_before_closing_brace?(node); end # This method depends on the fact that we have guarded # against implicit and empty literals. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/multiline_literal_brace_layout.rb#93 def opening_brace_on_same_line?(node); end end # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#5 module RuboCop::Cop::Naming; end # This cop makes sure that accessor methods are named properly. # # @example # # bad # def set_attribute(value) # end # # # good # def attribute=(value) # end # # # bad # def get_attribute # end # # # good # def attribute # end # # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#24 class RuboCop::Cop::Naming::AccessorMethodName < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#28 def on_def(node); end # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#28 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#47 def bad_reader_name?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#51 def bad_writer_name?(node); end # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#39 def message(node); end end # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#25 RuboCop::Cop::Naming::AccessorMethodName::MSG_READER = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/accessor_method_name.rb#26 RuboCop::Cop::Naming::AccessorMethodName::MSG_WRITER = T.let(T.unsafe(nil), String) # This cop checks for non-ascii characters in identifier and constant names. # Identifiers are always checked and whether constants are checked # can be controlled using AsciiConstants config. # # @example # # bad # def καλημερα # Greek alphabet (non-ascii) # end # # # bad # def こんにちはと言う # Japanese character (non-ascii) # end # # # bad # def hello_🍣 # Emoji (non-ascii) # end # # # good # def say_hello # end # # # bad # 신장 = 10 # Hangul character (non-ascii) # # # good # height = 10 # # # bad # params[:عرض_gteq] # Arabic character (non-ascii) # # # good # params[:width_gteq] # @example AsciiConstants: true (default) # # bad # class Foö # end # # FOÖ = "foo" # @example AsciiConstants: false # # good # class Foö # end # # FOÖ = "foo" # # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#55 class RuboCop::Cop::Naming::AsciiIdentifiers < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#61 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#88 def first_non_ascii_chars(string); end # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#77 def first_offense_range(identifier); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#72 def should_check?(token); end end # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#59 RuboCop::Cop::Naming::AsciiIdentifiers::CONSTANT_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/ascii_identifiers.rb#58 RuboCop::Cop::Naming::AsciiIdentifiers::IDENTIFIER_MSG = T.let(T.unsafe(nil), String) # This cop makes sure that certain binary operator methods have their # sole parameter named `other`. # # @example # # # bad # def +(amount); end # # # good # def +(other); end # # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#16 class RuboCop::Cop::Naming::BinaryOperatorParameterName < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#27 def on_def(node); end # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#23 def op_method_candidate?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#35 def op_method?(name); end end # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#21 RuboCop::Cop::Naming::BinaryOperatorParameterName::EXCLUDED = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#17 RuboCop::Cop::Naming::BinaryOperatorParameterName::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/binary_operator_parameter_name.rb#20 RuboCop::Cop::Naming::BinaryOperatorParameterName::OP_LIKE_METHODS = T.let(T.unsafe(nil), Array) # This cop checks block parameter names for how descriptive they # are. It is highly configurable. # # The `MinNameLength` config option takes an integer. It represents # the minimum amount of characters the name must be. Its default is 1. # The `AllowNamesEndingInNumbers` config option takes a boolean. When # set to false, this cop will register offenses for names ending with # numbers. Its default is false. The `AllowedNames` config option # takes an array of permitted names that will never register an # offense. The `ForbiddenNames` config option takes an array of # restricted names that will always register an offense. # # @example # # bad # bar do |varOne, varTwo| # varOne + varTwo # end # # # With `AllowNamesEndingInNumbers` set to false # foo { |num1, num2| num1 * num2 } # # # With `MinParamNameLength` set to number greater than 1 # baz { |a, b, c| do_stuff(a, b, c) } # # # good # bar do |thud, fred| # thud + fred # end # # foo { |speed, distance| speed * distance } # # baz { |age, height, gender| do_stuff(age, height, gender) } # # source://rubocop//lib/rubocop/cop/naming/block_parameter_name.rb#38 class RuboCop::Cop::Naming::BlockParameterName < ::RuboCop::Cop::Base include ::RuboCop::Cop::UncommunicativeName # source://rubocop//lib/rubocop/cop/naming/block_parameter_name.rb#41 def on_block(node); end end # This cop checks for class and module names with # an underscore in them. # # `AllowedNames` config takes an array of permitted names. # Its default value is `['module_parent']`. # These names can be full class/module names or part of the name. # eg. Adding `my_class` to the `AllowedNames` config will allow names like # `my_class`, `my_class::User`, `App::my_class`, `App::my_class::User`, etc. # # @example # # bad # class My_Class # end # module My_Module # end # # # good # class MyClass # end # module MyModule # end # class module_parent::MyModule # end # # source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#29 class RuboCop::Cop::Naming::ClassAndModuleCamelCase < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#32 def on_class(node); end # source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#32 def on_module(node); end end # source://rubocop//lib/rubocop/cop/naming/class_and_module_camel_case.rb#30 RuboCop::Cop::Naming::ClassAndModuleCamelCase::MSG = T.let(T.unsafe(nil), String) # This cop checks whether constant names are written using # SCREAMING_SNAKE_CASE. # # To avoid false positives, it ignores cases in which we cannot know # for certain the type of value that would be assigned to a constant. # # @example # # bad # InchInCm = 2.54 # INCHinCM = 2.54 # Inch_In_Cm = 2.54 # # # good # INCH_IN_CM = 2.54 # # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#20 class RuboCop::Cop::Naming::ConstantName < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#26 def class_or_struct_return_method?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#67 def literal_receiver?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#32 def on_casgn(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#55 def allowed_assignment?(value); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#72 def allowed_conditional_expression_on_rhs?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#62 def allowed_method_call_on_rhs?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#76 def contains_contant?(node); end end # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#21 RuboCop::Cop::Naming::ConstantName::MSG = T.let(T.unsafe(nil), String) # Use POSIX character classes, so we allow accented characters rather # than just standard ASCII characters # # source://rubocop//lib/rubocop/cop/naming/constant_name.rb#24 RuboCop::Cop::Naming::ConstantName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) # This cop makes sure that Ruby source files have snake_case # names. Ruby scripts (i.e. source files with a shebang in the # first line) are ignored. # # The cop also ignores `.gemspec` files, because Bundler # recommends using dashes to separate namespaces in nested gems # (i.e. `bundler-console` becomes `Bundler::Console`). As such, the # gemspec is supposed to be named `bundler-console.gemspec`. # # @example # # bad # lib/layoutManager.rb # # anything/usingCamelCase # # # good # lib/layout_manager.rb # # anything/using_snake_case.rake # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#27 class RuboCop::Cop::Naming::FileName < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/naming/file_name.rb#38 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/naming/file_name.rb#116 def allowed_acronyms; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#82 def bad_filename_allowed?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#108 def check_definition_path_hierarchy?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#104 def expect_matching_definition?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#120 def filename_good?(basename); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#129 def find_class_or_module(node, namespace); end # @yield [source_range(processed_source.buffer, 1, 0), msg] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#50 def for_bad_filename(file_path); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#100 def ignore_executable_scripts?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#176 def match?(expected); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#180 def match_acronym?(expected, name); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#148 def match_namespace(node, namespace, expected); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#78 def matching_class?(file_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/file_name.rb#74 def matching_definition?(file_path); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#86 def no_definition_message(basename, file_path); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#92 def other_message(basename); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#162 def partial_matcher!(expected); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#62 def perform_class_and_module_naming_checks(file_path, basename); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#112 def regex; end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#216 def to_module_name(basename); end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#189 def to_namespace(path); end end # source://rubocop//lib/rubocop/cop/naming/file_name.rb#32 RuboCop::Cop::Naming::FileName::MSG_NO_DEFINITION = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/file_name.rb#34 RuboCop::Cop::Naming::FileName::MSG_REGEX = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/file_name.rb#30 RuboCop::Cop::Naming::FileName::MSG_SNAKE_CASE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/file_name.rb#36 RuboCop::Cop::Naming::FileName::SNAKE_CASE = T.let(T.unsafe(nil), Regexp) # This cop checks that your heredocs are using the configured case. # By default it is configured to enforce uppercase heredocs. # # @example EnforcedStyle: uppercase (default) # # bad # <<-sql # SELECT * FROM foo # sql # # # good # <<-SQL # SELECT * FROM foo # SQL # @example EnforcedStyle: lowercase # # bad # <<-SQL # SELECT * FROM foo # SQL # # # good # <<-sql # SELECT * FROM foo # sql # # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#30 class RuboCop::Cop::Naming::HeredocDelimiterCase < ::RuboCop::Cop::Base include ::RuboCop::Cop::Heredoc include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#36 def on_heredoc(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#48 def correct_case_delimiters?(node); end # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#52 def correct_delimiters(node); end # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#44 def message(_node); end end # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_case.rb#34 RuboCop::Cop::Naming::HeredocDelimiterCase::MSG = T.let(T.unsafe(nil), String) # This cop checks that your heredocs are using meaningful delimiters. # By default it disallows `END` and `EO*`, and can be configured through # forbidden listing additional delimiters. # # @example # # # good # <<-SQL # SELECT * FROM foo # SQL # # # bad # <<-END # SELECT * FROM foo # END # # # bad # <<-EOS # SELECT * FROM foo # EOS # # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#26 class RuboCop::Cop::Naming::HeredocDelimiterNaming < ::RuboCop::Cop::Base include ::RuboCop::Cop::Heredoc # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#31 def on_heredoc(node); end private # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#49 def forbidden_delimiters; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#39 def meaningful_delimiters?(node); end end # source://rubocop//lib/rubocop/cop/naming/heredoc_delimiter_naming.rb#29 RuboCop::Cop::Naming::HeredocDelimiterNaming::MSG = T.let(T.unsafe(nil), String) # This cop checks for memoized methods whose instance variable name # does not match the method name. # # This cop can be configured with the EnforcedStyleForLeadingUnderscores # directive. It can be configured to allow for memoized instance variables # prefixed with an underscore. Prefixing ivars with an underscore is a # convention that is used to implicitly indicate that an ivar should not # be set or referenced outside of the memoization method. # # @example EnforcedStyleForLeadingUnderscores: disallowed (default) # # bad # # Method foo is memoized using an instance variable that is # # not `@foo`. This can cause confusion and bugs. # def foo # @something ||= calculate_expensive_thing # end # # # good # def _foo # @foo ||= calculate_expensive_thing # end # # # good # def foo # @foo ||= calculate_expensive_thing # end # # # good # def foo # @foo ||= begin # calculate_expensive_thing # end # end # # # good # def foo # helper_variable = something_we_need_to_calculate_foo # @foo ||= calculate_expensive_thing(helper_variable) # end # @example EnforcedStyleForLeadingUnderscores: required # # bad # def foo # @something ||= calculate_expensive_thing # end # # # bad # def foo # @foo ||= calculate_expensive_thing # end # # # good # def foo # @_foo ||= calculate_expensive_thing # end # # # good # def _foo # @_foo ||= calculate_expensive_thing # end # @example EnforcedStyleForLeadingUnderscores :optional # # bad # def foo # @something ||= calculate_expensive_thing # end # # # good # def foo # @foo ||= calculate_expensive_thing # end # # # good # def foo # @_foo ||= calculate_expensive_thing # end # # # good # def _foo # @_foo ||= calculate_expensive_thing # end # # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#87 class RuboCop::Cop::Naming::MemoizedInstanceVariableName < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#106 def memoized?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#108 def on_def(node); end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#108 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#128 def matches?(method_name, ivar_assign); end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#138 def message(variable); end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#124 def style_parameter_name; end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#147 def suggested_var(method_name); end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#153 def variable_name_candidates(method_name); end class << self private # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#95 def node_pattern; end end end # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#90 RuboCop::Cop::Naming::MemoizedInstanceVariableName::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/naming/memoized_instance_variable_name.rb#92 RuboCop::Cop::Naming::MemoizedInstanceVariableName::UNDERSCORE_REQUIRED = T.let(T.unsafe(nil), String) # This cop makes sure that all methods use the configured style, # snake_case or camelCase, for their names. # # This cop has `IgnoredPatterns` configuration option. # # Naming/MethodName: # IgnoredPatterns: # - '\A\s*onSelectionBulkChange\s*' # - '\A\s*onSelectionCleared\s*' # # Method names matching patterns are always allowed. # # @example EnforcedStyle: snake_case (default) # # bad # def fooBar; end # # # good # def foo_bar; end # @example EnforcedStyle: camelCase # # bad # def foo_bar; end # # # good # def fooBar; end # # source://rubocop//lib/rubocop/cop/naming/method_name.rb#31 class RuboCop::Cop::Naming::MethodName < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableNaming include ::RuboCop::Cop::IgnoredPattern include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/naming/method_name.rb#52 def on_def(node); end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#52 def on_defs(node); end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#41 def on_send(node); end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#39 def str_name(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#38 def sym_name(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/naming/method_name.rb#62 def attr_name(name_item); end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#73 def message(style); end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#66 def range_position(node); end end # source://rubocop//lib/rubocop/cop/naming/method_name.rb#36 RuboCop::Cop::Naming::MethodName::MSG = T.let(T.unsafe(nil), String) # This cop checks method parameter names for how descriptive they # are. It is highly configurable. # # The `MinNameLength` config option takes an integer. It represents # the minimum amount of characters the name must be. Its default is 3. # The `AllowNamesEndingInNumbers` config option takes a boolean. When # set to false, this cop will register offenses for names ending with # numbers. Its default is false. The `AllowedNames` config option # takes an array of permitted names that will never register an # offense. The `ForbiddenNames` config option takes an array of # restricted names that will always register an offense. # # @example # # bad # def bar(varOne, varTwo) # varOne + varTwo # end # # # With `AllowNamesEndingInNumbers` set to false # def foo(num1, num2) # num1 * num2 # end # # # With `MinArgNameLength` set to number greater than 1 # def baz(a, b, c) # do_stuff(a, b, c) # end # # # good # def bar(thud, fred) # thud + fred # end # # def foo(speed, distance) # speed * distance # end # # def baz(age_a, height_b, gender_c) # do_stuff(age_a, height_b, gender_c) # end # # source://rubocop//lib/rubocop/cop/naming/method_parameter_name.rb#46 class RuboCop::Cop::Naming::MethodParameterName < ::RuboCop::Cop::Base include ::RuboCop::Cop::UncommunicativeName # source://rubocop//lib/rubocop/cop/naming/method_parameter_name.rb#49 def on_def(node); end # source://rubocop//lib/rubocop/cop/naming/method_parameter_name.rb#49 def on_defs(node); end end # This cop makes sure that predicates are named properly. # # @example # # bad # def is_even(value) # end # # def is_even?(value) # end # # # good # def even?(value) # end # # # bad # def has_value # end # # def has_value? # end # # # good # def value? # end # # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#30 class RuboCop::Cop::Naming::PredicateName < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#33 def dynamic_method_define(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#53 def on_def(node); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#53 def on_defs(node); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#39 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#69 def allowed_method_name?(method_name, prefix); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#76 def expected_name(method_name, prefix); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#90 def forbidden_prefixes; end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#86 def message(method_name, new_name); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#98 def method_definition_macros(macro_name); end # source://rubocop//lib/rubocop/cop/naming/predicate_name.rb#94 def predicate_prefixes; end end # This cop makes sure that rescued exceptions variables are named as # expected. # # The `PreferredName` config option takes a `String`. It represents # the required name of the variable. Its default is `e`. # # @example PreferredName: e (default) # # bad # begin # # do something # rescue MyException => exception # # do something # end # # # good # begin # # do something # rescue MyException => e # # do something # end # # # good # begin # # do something # rescue MyException => _e # # do something # end # @example PreferredName: exception # # bad # begin # # do something # rescue MyException => e # # do something # end # # # good # begin # # do something # rescue MyException => exception # # do something # end # # # good # begin # # do something # rescue MyException => _exception # # do something # end # # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#56 class RuboCop::Cop::Naming::RescuedExceptionsVariableName < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#61 def on_resbody(node); end private # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#105 def message(node); end # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#84 def offense_range(resbody); end # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#89 def preferred_name(variable_name); end # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#98 def variable_name(node); end end # source://rubocop//lib/rubocop/cop/naming/rescued_exceptions_variable_name.rb#59 RuboCop::Cop::Naming::RescuedExceptionsVariableName::MSG = T.let(T.unsafe(nil), String) # This cop makes sure that all variables use the configured style, # snake_case or camelCase, for their names. # # @example EnforcedStyle: snake_case (default) # # bad # fooBar = 1 # # # good # foo_bar = 1 # @example EnforcedStyle: camelCase # # bad # foo_bar = 1 # # # good # fooBar = 1 # # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#22 class RuboCop::Cop::Naming::VariableName < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableNaming # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_arg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_blockarg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_kwarg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_kwoptarg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_kwrestarg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_lvar(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_optarg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#27 def on_restarg(node); end private # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#46 def message(style); end end # source://rubocop//lib/rubocop/cop/naming/variable_name.rb#25 RuboCop::Cop::Naming::VariableName::MSG = T.let(T.unsafe(nil), String) # This cop makes sure that all numbered variables use the # configured style, snake_case, normalcase, or non_integer, # for their numbering. # # @example EnforcedStyle: snake_case # # bad # # variable1 = 1 # # # good # # variable_1 = 1 # @example EnforcedStyle: normalcase (default) # # bad # # variable_1 = 1 # # # good # # variable1 = 1 # @example EnforcedStyle: non_integer # # bad # # variable1 = 1 # # variable_1 = 1 # # # good # # variableone = 1 # # variable_one = 1 # # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#40 class RuboCop::Cop::Naming::VariableNumber < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::ConfigurableFormatting include ::RuboCop::Cop::ConfigurableNumbering # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#45 def on_arg(node); end # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#45 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#45 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#45 def on_lvasgn(node); end private # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#55 def message(style); end end # source://rubocop//lib/rubocop/cop/naming/variable_number.rb#43 RuboCop::Cop::Naming::VariableNumber::MSG = T.let(T.unsafe(nil), String) # Some common code shared between `NegatedIf` and # `NegatedWhile` cops. # # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#7 module RuboCop::Cop::NegativeConditional extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#16 def empty_condition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#15 def single_negative?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#18 def check_negative_conditional(node, message:, &block); end end # source://rubocop//lib/rubocop/cop/mixin/negative_conditional.rb#10 RuboCop::Cop::NegativeConditional::MSG = T.let(T.unsafe(nil), String) # This module provides a list of methods that are: # 1. In the NilClass by default # 2. Added to NilClass by explicitly requiring any standard libraries # 3. Cop's configuration parameter AllowedMethods. # # source://rubocop//lib/rubocop/cop/mixin/nil_methods.rb#9 module RuboCop::Cop::NilMethods include ::RuboCop::Cop::AllowedMethods private # source://rubocop//lib/rubocop/cop/mixin/nil_methods.rb#14 def nil_methods; end # source://rubocop//lib/rubocop/cop/mixin/nil_methods.rb#18 def other_stdlib_methods; end end # An offense represents a style violation detected by RuboCop. # # source://rubocop//lib/rubocop/cop/offense.rb#6 class RuboCop::Cop::Offense include ::Comparable # @api private # @return [Offense] a new instance of Offense # # source://rubocop//lib/rubocop/cop/offense.rb#85 def initialize(severity, location, message, cop_name, status = T.unsafe(nil), corrector = T.unsafe(nil)); end # Returns `-1`, `0`, or `+1` # if this offense is less than, equal to, or greater than `other`. # # @api public # @return [Integer] comparison result # # source://rubocop//lib/rubocop/cop/offense.rb#235 def <=>(other); end # @api public # @return [Boolean] returns `true` if two offenses contain same attributes # # source://rubocop//lib/rubocop/cop/offense.rb#214 def ==(other); end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#163 def column; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#173 def column_length; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#197 def column_range; end # @api public # @example # 'LineLength' # @return [String] a cop class name without department. # i.e. type of the violation. # # source://rubocop//lib/rubocop/cop/offense.rb#52 def cop_name; end # @api public # @return [Boolean] whether this offense can be automatically corrected via # autocorrect or a todo. # # source://rubocop//lib/rubocop/cop/offense.rb#103 def correctable?; end # @api public # @return [Boolean] whether this offense is automatically corrected via # autocorrect or a todo. # # source://rubocop//lib/rubocop/cop/offense.rb#114 def corrected?; end # @api public # @return [Boolean] whether this offense is automatically disabled via a todo. # # source://rubocop//lib/rubocop/cop/offense.rb#124 def corrected_with_todo?; end # @api public # @return [Corrector | nil] the autocorrection for this offense, or `nil` when not available # # source://rubocop//lib/rubocop/cop/offense.rb#63 def corrector; end # @api public # @return [Boolean] whether this offense was locally disabled with a # disable or todo where it occurred. # # source://rubocop//lib/rubocop/cop/offense.rb#135 def disabled?; end # @api public # @return [Boolean] returns `true` if two offenses contain same attributes # # source://rubocop//lib/rubocop/cop/offense.rb#214 def eql?(other); end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#182 def first_line; end # source://rubocop//lib/rubocop/cop/offense.rb#222 def hash; end # @api public # @return [Parser::Source::Range] the range of the code that is highlighted # # source://rubocop//lib/rubocop/cop/offense.rb#143 def highlighted_area; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#192 def last_column; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#187 def last_line; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#158 def line; end # @api public # @return [Parser::Source::Range] the location where the violation is detected. # @see https://www.rubydoc.info/gems/parser/Parser/Source/Range Parser::Source::Range # # source://rubocop//lib/rubocop/cop/offense.rb#29 def location; end # @api public # @example # 'Line is too long. [90/80]' # @return [String] human-readable message # # source://rubocop//lib/rubocop/cop/offense.rb#40 def message; end # Internally we use column number that start at 0, but when # outputting column numbers, we want them to start at 1. One # reason is that editors, such as Emacs, expect this. # # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#206 def real_column; end # @api public # @return [RuboCop::Cop::Severity] # # source://rubocop//lib/rubocop/cop/offense.rb#18 def severity; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#168 def source_line; end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#55 def status; end # This is just for debugging purpose. # # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#151 def to_s; end end # @api private # # source://rubocop//lib/rubocop/cop/offense.rb#10 RuboCop::Cop::Offense::COMPARISON_ATTRIBUTES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/offense.rb#82 RuboCop::Cop::Offense::NO_LOCATION = T.let(T.unsafe(nil), RuboCop::Cop::Offense::PseudoSourceRange) # source://rubocop//lib/rubocop/cop/offense.rb#65 class RuboCop::Cop::Offense::PseudoSourceRange < ::Struct # Returns the value of attribute begin_pos # # @return [Object] the current value of begin_pos def begin_pos; end # Sets the attribute begin_pos # # @param value [Object] the value to set the attribute begin_pos to. # @return [Object] the newly set value def begin_pos=(_); end # Returns the value of attribute column # # @return [Object] the current value of column def column; end # Sets the attribute column # # @param value [Object] the value to set the attribute column to. # @return [Object] the newly set value def column=(_); end # source://rubocop//lib/rubocop/cop/offense.rb#71 def column_range; end # Returns the value of attribute end_pos # # @return [Object] the current value of end_pos def end_pos; end # Sets the attribute end_pos # # @param value [Object] the value to set the attribute end_pos to. # @return [Object] the newly set value def end_pos=(_); end # Returns the value of attribute line # # @return [Object] the current value of line def first_line; end # Returns the value of attribute column # # @return [Object] the current value of column def last_column; end # Returns the value of attribute line # # @return [Object] the current value of line def last_line; end # source://rubocop//lib/rubocop/cop/offense.rb#75 def length; end # Returns the value of attribute line # # @return [Object] the current value of line def line; end # Sets the attribute line # # @param value [Object] the value to set the attribute line to. # @return [Object] the newly set value def line=(_); end # source://rubocop//lib/rubocop/cop/offense.rb#75 def size; end # Returns the value of attribute source_line # # @return [Object] the current value of source_line def source_line; end # Sets the attribute source_line # # @param value [Object] the value to set the attribute source_line to. # @return [Object] the newly set value def source_line=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # Common functionality for cops checking if and unless expressions. # # source://rubocop//lib/rubocop/cop/mixin/on_normal_if_unless.rb#6 module RuboCop::Cop::OnNormalIfUnless # source://rubocop//lib/rubocop/cop/mixin/on_normal_if_unless.rb#7 def on_if(node); end end # This auto-corrects gem dependency order # # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#6 class RuboCop::Cop::OrderedGemCorrector extend ::RuboCop::Cop::OrderedGemNode class << self # Returns the value of attribute comments_as_separators. # # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#10 def comments_as_separators; end # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#12 def correct(processed_source, node, previous_declaration, comments_as_separators); end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#10 def processed_source; end private # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#27 def declaration_with_comment(node); end # source://rubocop//lib/rubocop/cop/correctors/ordered_gem_corrector.rb#35 def swap_range(corrector, range1, range2); end end end # Common functionality for Bundler/OrderedGems and # Gemspec/OrderedDependencies. # # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#7 module RuboCop::Cop::OrderedGemNode private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#23 def case_insensitive_out_of_order?(string_a, string_b); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#27 def consecutive_lines(previous, current); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#50 def find_gem_name(gem_node); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#18 def gem_canonical_name(name); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#44 def gem_name(declaration_node); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#10 def get_source_range(node, comments_as_separators); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#35 def register_offense(previous, current); end # source://rubocop//lib/rubocop/cop/mixin/ordered_gem_node.rb#56 def treat_comments_as_separators; end end # Common functionality for handling parentheses. # # source://rubocop//lib/rubocop/cop/mixin/parentheses.rb#6 module RuboCop::Cop::Parentheses private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/parentheses.rb#9 def parens_required?(node); end end # This auto-corrects parentheses # # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#6 class RuboCop::Cop::ParenthesesCorrector class << self # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#8 def correct(corrector, node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#22 def next_char_is_question_mark?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/parentheses_corrector.rb#18 def ternary_condition?(node); end end end # Common functionality for handling percent arrays. # # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#6 module RuboCop::Cop::PercentArray private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#21 def allowed_bracket_array?(node); end # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#45 def check_bracketed_array(node, literal_prefix); end # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#35 def check_percent_array(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#30 def comments_in_array?(node); end # Ruby does not allow percent arrays in an ambiguous block context. # # @example # # foo %i[bar baz] { qux } # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#14 def invalid_percent_array_context?(node); end # source://rubocop//lib/rubocop/cop/mixin/percent_array.rb#26 def message(_node); end end # Common functionality for handling percent literals. # # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#6 module RuboCop::Cop::PercentLiteral include ::RuboCop::Cop::RangeHelp private # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#23 def begin_source(node); end # A range containing only the contents of the percent literal (e.g. in # %i{1 2 3} this will be the range covering '1 2 3' only) # # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#33 def contents_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#11 def percent_literal?(node); end # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#17 def process(node, *types); end # source://rubocop//lib/rubocop/cop/mixin/percent_literal.rb#27 def type(node); end end # This auto-corrects percent literals # # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#6 class RuboCop::Cop::PercentLiteralCorrector include ::RuboCop::PathUtil include ::RuboCop::Cop::Util # @return [PercentLiteralCorrector] a new instance of PercentLiteralCorrector # # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#11 def initialize(config, preferred_delimiters); end # Returns the value of attribute config. # # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#9 def config; end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#16 def correct(corrector, node, char); end # Returns the value of attribute preferred_delimiters. # # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#9 def preferred_delimiters; end private # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#48 def autocorrect_multiline_words(node, escape, delimiters); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#54 def autocorrect_words(node, escape, delimiters); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#34 def delimiters_for(type); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#106 def end_content(source); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#30 def escape_words?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#84 def first_line?(node, previous_line_num); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#95 def fix_escaped_content(word_node, escape, delimiters); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#75 def line_breaks(node, source, previous_line_num, base_line_num, node_indx); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#40 def new_contents(node, escape, delimiters); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#88 def process_lines(node, previous_line_num, base_line_num, source_in_lines); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#60 def process_multiline_words(node, escape, delimiters); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#102 def substitute_escaped_delimiters(content, delimiters); end # source://rubocop//lib/rubocop/cop/correctors/percent_literal_corrector.rb#26 def wrap_contents(corrector, node, contents, char, delimiters); end end # Common functionality for checking whether an AST node/token is aligned # with something on a preceding or following line # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#7 module RuboCop::Cop::PrecedingFollowingAlignment private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#97 def aligned_assignment?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#93 def aligned_char?(range, line); end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#72 def aligned_comment_lines; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#101 def aligned_identical?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#85 def aligned_operator?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#79 def aligned_token?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#34 def aligned_with_adjacent_line?(range, predicate); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#52 def aligned_with_any_line?(line_ranges, range, indent = T.unsafe(nil), &predicate); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#42 def aligned_with_any_line_range?(line_ranges, range, &predicate); end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#105 def aligned_with_assignment(token, line_range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#58 def aligned_with_line?(line_nos, range, indent = T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#18 def aligned_with_operator?(range); end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#22 def aligned_with_preceding_assignment(token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#14 def aligned_with_something?(range); end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#28 def aligned_with_subsequent_assignment(token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#89 def aligned_words?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#10 def allow_for_alignment?; end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#125 def assignment_lines; end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#129 def assignment_tokens; end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#145 def relevant_assignment_lines(line_range); end # source://rubocop//lib/rubocop/cop/mixin/preceding_following_alignment.rb#174 def remove_optarg_equals(asgn_tokens, processed_source); end end # Common functionality for handling percent literal delimiters. # # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#6 class RuboCop::Cop::PreferredDelimiters # @return [PreferredDelimiters] a new instance of PreferredDelimiters # # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#11 def initialize(type, config, preferred_delimiters); end # Returns the value of attribute config. # # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#7 def config; end # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#17 def delimiters; end # Returns the value of attribute type. # # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#7 def type; end private # @raise [ArgumentError] # # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#23 def ensure_valid_preferred_delimiters; end # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#32 def preferred_delimiters; end # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#48 def preferred_delimiters_config; end end # source://rubocop//lib/rubocop/cop/mixin/preferred_delimiters.rb#9 RuboCop::Cop::PreferredDelimiters::PERCENT_LITERAL_TYPES = T.let(T.unsafe(nil), Array) # This auto-corrects punctuation # # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#6 class RuboCop::Cop::PunctuationCorrector class << self # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#12 def add_space(corrector, token); end # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#8 def remove_space(corrector, space_before); end # source://rubocop//lib/rubocop/cop/correctors/punctuation_corrector.rb#16 def swap_comma(corrector, range); end end end # Methods that calculate and return Parser::Source::Ranges # # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#6 module RuboCop::Cop::RangeHelp private # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#81 def column_offset_between(base_range, range); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#100 def directions(side); end # Returns the column attribute of the range, except if the range is on # the first line and there's a byte order mark at the beginning of that # line, in which case 1 is subtracted from the column value. This gives # the column as it appears when viewing the file in an editor. # # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#91 def effective_column(range); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#109 def final_pos(src, pos, increment, continuations, newlines, whitespace); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#117 def move_pos(src, pos, step, condition, regexp); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#123 def move_pos_str(src, pos, step, condition, needle); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#30 def range_between(start_pos, end_pos); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#69 def range_by_whole_lines(range, include_final_newline: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#34 def range_with_surrounding_comma(range, side = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#48 def range_with_surrounding_space(range:, side: T.unsafe(nil), newlines: T.unsafe(nil), whitespace: T.unsafe(nil), continuations: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#11 def source_range(source_buffer, line_number, column, length = T.unsafe(nil)); end end # The Unicode codepoint # # source://rubocop//lib/rubocop/cop/mixin/range_help.rb#9 RuboCop::Cop::RangeHelp::BYTE_ORDER_MARK = T.let(T.unsafe(nil), Integer) # Common functionality for handling Rational literals. # # source://rubocop//lib/rubocop/cop/mixin/rational_literal.rb#6 module RuboCop::Cop::RationalLiteral extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/rational_literal.rb#11 def rational_literal?(param0 = T.unsafe(nil)); end end # Registry that tracks all cops by their badge and department. # # source://rubocop//lib/rubocop/cop/registry.rb#24 class RuboCop::Cop::Registry include ::Enumerable # @return [Registry] a new instance of Registry # # source://rubocop//lib/rubocop/cop/registry.rb#29 def initialize(cops = T.unsafe(nil), options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/registry.rb#182 def ==(other); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/registry.rb#67 def contains_cop_matching?(names); end # source://rubocop//lib/rubocop/cop/registry.rb#142 def cops; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/registry.rb#117 def department_missing?(badge, name); end # @return [Array] list of departments for current cops. # # source://rubocop//lib/rubocop/cop/registry.rb#47 def departments; end # source://rubocop//lib/rubocop/cop/registry.rb#42 def dismiss(cop); end # source://rubocop//lib/rubocop/cop/registry.rb#197 def each(&block); end # source://rubocop//lib/rubocop/cop/registry.rb#152 def enabled(config, only = T.unsafe(nil), only_safe: T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/registry.rb#158 def enabled?(cop, config, only_safe); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/registry.rb#171 def enabled_pending_cop?(cop_cfg, config); end # source://rubocop//lib/rubocop/cop/registry.rb#38 def enlist(cop); end # @param cop_name [String] # @return [Class, nil] # # source://rubocop//lib/rubocop/cop/registry.rb#203 def find_by_cop_name(cop_name); end # source://rubocop//lib/rubocop/cop/registry.rb#147 def length; end # source://rubocop//lib/rubocop/cop/registry.rb#178 def names; end # Returns the value of attribute options. # # source://rubocop//lib/rubocop/cop/registry.rb#27 def options; end # source://rubocop//lib/rubocop/cop/registry.rb#121 def print_warning(name, path); end # Convert a user provided cop name into a properly namespaced name # # @example gives back a correctly qualified cop name # # cops = RuboCop::Cop::Cop.all # cops. # qualified_cop_name('Layout/EndOfLine') # => 'Layout/EndOfLine' # @example fixes incorrect namespaces # # cops = RuboCop::Cop::Cop.all # cops.qualified_cop_name('Lint/EndOfLine') # => 'Layout/EndOfLine' # @example namespaces bare cop identifiers # # cops = RuboCop::Cop::Cop.all # cops.qualified_cop_name('EndOfLine') # => 'Layout/EndOfLine' # @example passes back unrecognized cop names # # cops = RuboCop::Cop::Cop.all # cops.qualified_cop_name('NotACop') # => 'NotACop' # @note Emits a warning if the provided name has an incorrect namespace # @param name [String] Cop name extracted from config # @param path [String, nil] Path of file that `name` was extracted from # @raise [AmbiguousCopName] if a bare identifier with two possible namespaces is provided # @return [String] Qualified cop name # # source://rubocop//lib/rubocop/cop/registry.rb#103 def qualified_cop_name(name, path, warn: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/registry.rb#193 def select(&block); end # source://rubocop//lib/rubocop/cop/registry.rb#186 def sort!; end # @return [Hash{String => Array}] # # source://rubocop//lib/rubocop/cop/registry.rb#137 def to_h; end # source://rubocop//lib/rubocop/cop/registry.rb#129 def unqualified_cop_names; end # @return [Registry] Cops for that specific department. # # source://rubocop//lib/rubocop/cop/registry.rb#53 def with_department(department); end # @return [Registry] Cops not for a specific department. # # source://rubocop//lib/rubocop/cop/registry.rb#59 def without_department(department); end private # source://rubocop//lib/rubocop/cop/registry.rb#237 def clear_enrollment_queue; end # source://rubocop//lib/rubocop/cop/registry.rb#233 def initialize_copy(reg); end # source://rubocop//lib/rubocop/cop/registry.rb#253 def qualify_badge(badge); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/registry.rb#270 def registered?(badge); end # source://rubocop//lib/rubocop/cop/registry.rb#260 def resolve_badge(given_badge, real_badge, source_path); end # source://rubocop//lib/rubocop/cop/registry.rb#249 def with(cops); end class << self # source://rubocop//lib/rubocop/cop/registry.rb#213 def all; end # Returns the value of attribute global. # # source://rubocop//lib/rubocop/cop/registry.rb#210 def global; end # source://rubocop//lib/rubocop/cop/registry.rb#217 def qualified_cop_name(name, origin); end # Changes momentarily the global registry # Intended for testing purposes # # source://rubocop//lib/rubocop/cop/registry.rb#223 def with_temporary_global(temp_global = T.unsafe(nil)); end end end # Common functionality for checking `rescue` nodes. # # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#6 module RuboCop::Cop::RescueNode # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#7 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#16 def rescue_modifier?(node); end # @deprecated Use ResbodyNode#exceptions instead # # source://rubocop//lib/rubocop/cop/mixin/rescue_node.rb#22 def rescued_exceptions(resbody); end end # Common functionality for safe assignment. By safe assignment we mean # putting parentheses around an assignment to indicate "I know I'm using an # assignment as a condition. It's not a mistake." # # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#8 module RuboCop::Cop::SafeAssignment extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#13 def empty_condition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#15 def safe_assignment?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#14 def setter_method?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/safe_assignment.rb#18 def safe_assignment_allowed?; end end # source://rubocop//lib/rubocop/cop/security/eval.rb#5 module RuboCop::Cop::Security; end # This cop checks for the use of `Kernel#eval` and `Binding#eval`. # # @example # # # bad # # eval(something) # binding.eval(something) # # source://rubocop//lib/rubocop/cop/security/eval.rb#14 class RuboCop::Cop::Security::Eval < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/security/eval.rb#18 def eval?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/security/eval.rb#22 def on_send(node); end end # source://rubocop//lib/rubocop/cop/security/eval.rb#15 RuboCop::Cop::Security::Eval::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/security/eval.rb#16 RuboCop::Cop::Security::Eval::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the use of JSON class methods which have potential # security issues. # # Autocorrect is disabled by default because it's potentially dangerous. # If using a stream, like `JSON.load(open('file'))`, it will need to call # `#read` manually, like `JSON.parse(open('file').read)`. # If reading single values (rather than proper JSON objects), like # `JSON.load('false')`, it will need to pass the `quirks_mode: true` # option, like `JSON.parse('false', quirks_mode: true)`. # Other similar issues may apply. # # @example # # bad # JSON.load("{}") # JSON.restore("{}") # # # good # JSON.parse("{}") # # source://rubocop//lib/rubocop/cop/security/json_load.rb#25 class RuboCop::Cop::Security::JSONLoad < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/security/json_load.rb#31 def json_load(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/security/json_load.rb#35 def on_send(node); end end # source://rubocop//lib/rubocop/cop/security/json_load.rb#28 RuboCop::Cop::Security::JSONLoad::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/security/json_load.rb#29 RuboCop::Cop::Security::JSONLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the use of Marshal class methods which have # potential security issues leading to remote code execution when # loading from an untrusted source. # # @example # # bad # Marshal.load("{}") # Marshal.restore("{}") # # # good # Marshal.dump("{}") # # # okish - deep copy hack # Marshal.load(Marshal.dump({})) # # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#21 class RuboCop::Cop::Security::MarshalLoad < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#25 def marshal_load(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#30 def on_send(node); end end # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#22 RuboCop::Cop::Security::MarshalLoad::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/security/marshal_load.rb#23 RuboCop::Cop::Security::MarshalLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the use of `Kernel#open`. # # `Kernel#open` enables not only file access but also process invocation # by prefixing a pipe symbol (e.g., `open("| ls")`). So, it may lead to # a serious security risk by using variable input to the argument of # `Kernel#open`. It would be better to use `File.open`, `IO.popen` or # `URI#open` explicitly. # # @example # # bad # open(something) # # # good # File.open(something) # IO.popen(something) # URI.parse(something).open # # source://rubocop//lib/rubocop/cop/security/open.rb#22 class RuboCop::Cop::Security::Open < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/security/open.rb#30 def on_send(node); end # source://rubocop//lib/rubocop/cop/security/open.rb#26 def open?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/security/open.rb#58 def composite_string?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/security/open.rb#66 def concatenated_string?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/security/open.rb#62 def interpolated_string?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/security/open.rb#40 def safe?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/security/open.rb#50 def safe_argument?(argument); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/security/open.rb#54 def simple_string?(node); end end # source://rubocop//lib/rubocop/cop/security/open.rb#23 RuboCop::Cop::Security::Open::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/security/open.rb#24 RuboCop::Cop::Security::Open::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the use of YAML class methods which have # potential security issues leading to remote code execution when # loading from an untrusted source. # # @example # # bad # YAML.load("--- foo") # # # good # YAML.safe_load("--- foo") # YAML.dump("foo") # # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#18 class RuboCop::Cop::Security::YAMLLoad < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#28 def on_send(node); end # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#24 def yaml_load(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#21 RuboCop::Cop::Security::YAMLLoad::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/security/yaml_load.rb#22 RuboCop::Cop::Security::YAMLLoad::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Severity class is simple value object about severity # # source://rubocop//lib/rubocop/cop/severity.rb#6 class RuboCop::Cop::Severity include ::Comparable # @api private # @raise [ArgumentError] # @return [Severity] a new instance of Severity # # source://rubocop//lib/rubocop/cop/severity.rb#30 def initialize(name_or_code); end # source://rubocop//lib/rubocop/cop/severity.rb#62 def <=>(other); end # source://rubocop//lib/rubocop/cop/severity.rb#50 def ==(other); end # source://rubocop//lib/rubocop/cop/severity.rb#42 def code; end # source://rubocop//lib/rubocop/cop/severity.rb#58 def hash; end # source://rubocop//lib/rubocop/cop/severity.rb#46 def level; end # @api public # @return [Symbol] severity. # any of `:refactor`, `:convention`, `:warning`, `:error` or `:fatal`. # # source://rubocop//lib/rubocop/cop/severity.rb#22 def name; end # source://rubocop//lib/rubocop/cop/severity.rb#38 def to_s; end class << self # source://rubocop//lib/rubocop/cop/severity.rb#24 def name_from_code(code); end end end # @api private # # source://rubocop//lib/rubocop/cop/severity.rb#12 RuboCop::Cop::Severity::CODE_TABLE = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/severity.rb#9 RuboCop::Cop::Severity::NAMES = T.let(T.unsafe(nil), Array) # Common functionality for cops checking for missing space after # punctuation. # # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#7 module RuboCop::Cop::SpaceAfterPunctuation # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#10 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#40 def allowed_type?(token); end # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#20 def each_missing_space(tokens); end # The normal offset, i.e., the distance from the punctuation # token where a space should be, is 1. # # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#51 def offset; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#44 def space_forbidden_before_rcurly?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#30 def space_missing?(token1, token2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#35 def space_required_before?(token); end end # source://rubocop//lib/rubocop/cop/mixin/space_after_punctuation.rb#8 RuboCop::Cop::SpaceAfterPunctuation::MSG = T.let(T.unsafe(nil), String) # Common functionality for cops checking for space before # punctuation. # # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#7 module RuboCop::Cop::SpaceBeforePunctuation include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#12 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#22 def each_missing_space(tokens); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#35 def space_missing?(token1, token2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#39 def space_required_after?(token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#43 def space_required_after_lcurly?; end end # source://rubocop//lib/rubocop/cop/mixin/space_before_punctuation.rb#10 RuboCop::Cop::SpaceBeforePunctuation::MSG = T.let(T.unsafe(nil), String) # This auto-corrects whitespace # # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#6 class RuboCop::Cop::SpaceCorrector extend ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::SurroundingSpace class << self # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#36 def add_space(processed_source, corrector, left_token, right_token); end # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#12 def empty_corrections(processed_source, corrector, empty_config, left_token, right_token); end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#10 def processed_source; end # source://rubocop//lib/rubocop/cop/correctors/space_corrector.rb#24 def remove_space(processed_source, corrector, left_token, right_token); end end end # Common functionality for modifier cops. # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#6 module RuboCop::Cop::StatementModifier include ::RuboCop::Cop::LineLengthHelp private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#85 def comment_disables_cop?(comment); end # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#59 def first_line_comment(node); end # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#42 def length_in_modifier_form(node); end # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#79 def max_line_length; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#36 def modifier_fits_on_single_line?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#25 def non_eligible_body?(body); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#32 def non_eligible_condition?(condition); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#19 def non_eligible_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#67 def parenthesize?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#11 def single_line_as_modifier?(node); end # source://rubocop//lib/rubocop/cop/mixin/statement_modifier.rb#51 def to_modifier_form(node); end end # Classes that include this module just implement functions to determine # what is an offense and how to do auto-correction. They get help with # adding offenses for the faulty string nodes, and with filtering out # nodes. # # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#9 module RuboCop::Cop::StringHelp # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#23 def on_regexp(node); end # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#10 def on_str(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/string_help.rb#29 def inside_interpolation?(node); end end # This auto-corrects string literals # # source://rubocop//lib/rubocop/cop/correctors/string_literal_corrector.rb#6 class RuboCop::Cop::StringLiteralCorrector extend ::RuboCop::PathUtil extend ::RuboCop::Cop::Util class << self # source://rubocop//lib/rubocop/cop/correctors/string_literal_corrector.rb#10 def correct(node, style); end end end # Common functionality for cops checking single/double quotes. # # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#6 module RuboCop::Cop::StringLiteralsHelp include ::RuboCop::Cop::StringHelp private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/string_literals_help.rb#11 def wrong_quotes?(node); end end # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#5 module RuboCop::Cop::Style; end # Access modifiers should be declared to apply to a group of methods # or inline before each method, depending on configuration. # EnforcedStyle config covers only method definitions. # Applications of visibility methods to symbols can be controlled # using AllowModifiersOnSymbols config. # # @example EnforcedStyle: group (default) # # bad # class Foo # # private def bar; end # private def baz; end # # end # # # good # class Foo # # private # # def bar; end # def baz; end # # end # @example EnforcedStyle: inline # # bad # class Foo # # private # # def bar; end # def baz; end # # end # # # good # class Foo # # private def bar; end # private def baz; end # # end # @example AllowModifiersOnSymbols: true # # good # class Foo # # private :bar, :baz # # end # @example AllowModifiersOnSymbols: false # # bad # class Foo # # private :bar, :baz # # end # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#65 class RuboCop::Cop::Style::AccessModifierDeclarations < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#80 def access_modifier_with_symbol?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#84 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#115 def access_modifier_is_inlined?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#119 def access_modifier_is_not_inlined?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#98 def allow_modifiers_on_symbols?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#107 def group_style?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#111 def inline_style?; end # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#123 def message(range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#102 def offense?(node); end end # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#68 RuboCop::Cop::Style::AccessModifierDeclarations::GROUP_STYLE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#73 RuboCop::Cop::Style::AccessModifierDeclarations::INLINE_STYLE_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/access_modifier_declarations.rb#78 RuboCop::Cop::Style::AccessModifierDeclarations::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for grouping of accessors in `class` and `module` bodies. # By default it enforces accessors to be placed in grouped declarations, # but it can be configured to enforce separating them in multiple declarations. # # Note: `Sorbet` is not compatible with "grouped" style. Consider "separated" style # or disabling this cop. # # @example EnforcedStyle: grouped (default) # # bad # class Foo # attr_reader :bar # attr_reader :baz # end # # # good # class Foo # attr_reader :bar, :baz # end # @example EnforcedStyle: separated # # bad # class Foo # attr_reader :bar, :baz # end # # # good # class Foo # attr_reader :bar # attr_reader :baz # end # # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#37 class RuboCop::Cop::Style::AccessorGrouping < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::VisibilityHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#48 def on_class(node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#48 def on_module(node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#48 def on_sclass(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#96 def accessor?(send_node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#71 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#60 def check(send_node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#84 def class_send_elements(class_node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#131 def group_accessors(node, accessors); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#100 def grouped_style?; end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#117 def message(send_node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#122 def preferred_accessors(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#80 def previous_line_comment?(node); end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#139 def separate_accessors(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#104 def separated_style?; end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#108 def sibling_accessors(send_node); end end # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#46 RuboCop::Cop::Style::AccessorGrouping::ACCESSOR_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#43 RuboCop::Cop::Style::AccessorGrouping::GROUPED_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/accessor_grouping.rb#44 RuboCop::Cop::Style::AccessorGrouping::SEPARATED_MSG = T.let(T.unsafe(nil), String) # This cop enforces the use of either `#alias` or `#alias_method` # depending on configuration. # It also flags uses of `alias :symbol` rather than `alias bareword`. # # @example EnforcedStyle: prefer_alias (default) # # bad # alias_method :bar, :foo # alias :bar :foo # # # good # alias bar foo # @example EnforcedStyle: prefer_alias_method # # bad # alias :bar :foo # alias bar foo # # # good # alias_method :bar, :foo # # source://rubocop//lib/rubocop/cop/style/alias.rb#25 class RuboCop::Cop::Style::Alias < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/alias.rb#148 def identifier(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/alias.rb#47 def on_alias(node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#37 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/alias.rb#82 def add_offense_for_args(node, &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/alias.rb#73 def alias_keyword_possible?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/alias.rb#77 def alias_method_possible?(node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#63 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/alias.rb#123 def bareword?(sym_node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#127 def correct_alias_method_to_alias(corrector, send_node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#134 def correct_alias_to_alias_method(corrector, node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#143 def correct_alias_with_symbol_args(corrector, node); end # source://rubocop//lib/rubocop/cop/style/alias.rb#112 def lexical_scope_type(node); end # In this expression, will `self` be the same as the innermost enclosing # class or module block (:lexical)? Or will it be something else # (:dynamic)? If we're in an instance_eval block, return that. # # source://rubocop//lib/rubocop/cop/style/alias.rb#95 def scope_type(node); end end # source://rubocop//lib/rubocop/cop/style/alias.rb#29 RuboCop::Cop::Style::Alias::MSG_ALIAS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/alias.rb#30 RuboCop::Cop::Style::Alias::MSG_ALIAS_METHOD = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/alias.rb#32 RuboCop::Cop::Style::Alias::MSG_SYMBOL_ARGS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/alias.rb#35 RuboCop::Cop::Style::Alias::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for uses of `and` and `or`, and suggests using `&&` and # `||` instead. It can be configured to check only in conditions or in # all contexts. # # @example EnforcedStyle: always # # bad # foo.save and return # # # bad # if foo and bar # end # # # good # foo.save && return # # # good # if foo && bar # end # @example EnforcedStyle: conditionals (default) # # bad # if foo and bar # end # # # good # foo.save && return # # # good # foo.save and return # # # good # if foo && bar # end # # source://rubocop//lib/rubocop/cop/style/and_or.rb#39 class RuboCop::Cop::Style::AndOr < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/and_or.rb#46 def on_and(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#46 def on_or(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 def on_while(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#51 def on_while_post(node); end private # ! is a special case: # 'x and !obj.method arg' can be auto-corrected if we # recurse down a level and add parens to 'obj.method arg' # however, 'not x' also parses as (send x :!) # # source://rubocop//lib/rubocop/cop/style/and_or.rb#110 def correct_not(node, receiver, corrector); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#122 def correct_other(node, corrector); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#90 def correct_send(node, corrector); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#101 def correct_setter(node, corrector); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/and_or.rb#128 def correctable_send?(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#86 def message(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#80 def on_conditionals(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#61 def process_logical_operator(node); end # source://rubocop//lib/rubocop/cop/style/and_or.rb#132 def whitespace_before_arg(node); end end # source://rubocop//lib/rubocop/cop/style/and_or.rb#44 RuboCop::Cop::Style::AndOr::MSG = T.let(T.unsafe(nil), String) # Common functionality related to annotation comments. # # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#7 module RuboCop::Cop::Style::AnnotationComment private # @api public # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#11 def annotation?(comment); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#31 def just_first_word_of_sentence?(first_word, colon, space, note); end # @api public # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#36 def keyword?(word); end # @api public # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#26 def keyword_appearance?(first_word, colon, space); end # @api public # # source://rubocop//lib/rubocop/cop/mixin/annotation_comment.rb#18 def split_comment(comment); end end # This cop enforces the use of `Array()` instead of explicit `Array` check or `[*var]`. # # This cop is disabled by default because false positive will occur if # the argument of `Array()` is not an array (e.g. Hash, Set), # an array will be returned as an incompatibility result. # # @example # # bad # paths = [paths] unless paths.is_a?(Array) # paths.each { |path| do_something(path) } # # # bad (always creates a new Array instance) # [*paths].each { |path| do_something(path) } # # # good (and a bit more readable) # Array(paths).each { |path| do_something(path) } # # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#23 class RuboCop::Cop::Style::ArrayCoercion < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#29 def array_splat?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#43 def on_array(node); end # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#54 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#33 def unless_array?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#27 RuboCop::Cop::Style::ArrayCoercion::CHECK_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/array_coercion.rb#26 RuboCop::Cop::Style::ArrayCoercion::SPLAT_MSG = T.let(T.unsafe(nil), String) # This cop checks for uses of "*" as a substitute for _join_. # # Not all cases can reliably checked, due to Ruby's dynamic # types, so we consider only cases when the first argument is an # array literal or the second is a string literal. # # @example # # # bad # %w(foo bar baz) * "," # # # good # %w(foo bar baz).join(",") # # source://rubocop//lib/rubocop/cop/style/array_join.rb#20 class RuboCop::Cop::Style::ArrayJoin < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/array_join.rb#26 def join_candidate?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/array_join.rb#28 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/array_join.rb#23 RuboCop::Cop::Style::ArrayJoin::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/array_join.rb#24 RuboCop::Cop::Style::ArrayJoin::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for non-ascii (non-English) characters # in comments. You could set an array of allowed non-ascii chars in # AllowedChars attribute (empty by default). # # @example # # bad # # Translates from English to 日本語。 # # # good # # Translates from English to Japanese # # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#18 class RuboCop::Cop::Style::AsciiComments < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#23 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#54 def allowed_non_ascii_chars; end # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#45 def first_non_ascii_chars(string); end # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#34 def first_offense_range(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#49 def only_allowed_non_ascii_chars?(string); end end # source://rubocop//lib/rubocop/cop/style/ascii_comments.rb#21 RuboCop::Cop::Style::AsciiComments::MSG = T.let(T.unsafe(nil), String) # This cop checks for uses of Module#attr. # # @example # # bad - creates a single attribute accessor (deprecated in Ruby 1.9) # attr :something, true # attr :one, :two, :three # behaves as attr_reader # # # good # attr_accessor :something # attr_reader :one, :two, :three # # source://rubocop//lib/rubocop/cop/style/attr.rb#17 class RuboCop::Cop::Style::Attr < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/attr.rb#65 def class_eval?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/attr.rb#24 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/attr.rb#39 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/attr.rb#51 def message(node); end # source://rubocop//lib/rubocop/cop/style/attr.rb#55 def replacement_method(node); end end # source://rubocop//lib/rubocop/cop/style/attr.rb#21 RuboCop::Cop::Style::Attr::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/attr.rb#22 RuboCop::Cop::Style::Attr::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for cases when you could use a block # accepting version of a method that does automatic # resource cleanup. # # @example # # # bad # f = File.open('file') # # # good # File.open('file') do |f| # # ... # end # # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#19 class RuboCop::Cop::Style::AutoResourceCleanup < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#28 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#43 def cleanup?(node); end end # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#20 RuboCop::Cop::Style::AutoResourceCleanup::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#26 RuboCop::Cop::Style::AutoResourceCleanup::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/auto_resource_cleanup.rb#22 RuboCop::Cop::Style::AutoResourceCleanup::TARGET_METHODS = T.let(T.unsafe(nil), Hash) # This cop checks if usage of %() or %Q() matches configuration. # # @example EnforcedStyle: bare_percent (default) # # bad # %Q(He said: "#{greeting}") # %q{She said: 'Hi'} # # # good # %(He said: "#{greeting}") # %{She said: 'Hi'} # @example EnforcedStyle: percent_q # # bad # %|He said: "#{greeting}"| # %/She said: 'Hi'/ # # # good # %Q|He said: "#{greeting}"| # %q/She said: 'Hi'/ # # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#26 class RuboCop::Cop::Style::BarePercentLiterals < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#32 def on_dstr(node); end # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#36 def on_str(node); end private # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#63 def add_offense_for_wrong_style(node, good, bad); end # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#42 def check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#59 def requires_bare_percent?(source); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#55 def requires_percent_q?(source); end end # source://rubocop//lib/rubocop/cop/style/bare_percent_literals.rb#30 RuboCop::Cop::Style::BarePercentLiterals::MSG = T.let(T.unsafe(nil), String) # This cop checks for BEGIN blocks. # # @example # # bad # BEGIN { test } # # source://rubocop//lib/rubocop/cop/style/begin_block.rb#13 class RuboCop::Cop::Style::BeginBlock < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/begin_block.rb#16 def on_preexe(node); end end # source://rubocop//lib/rubocop/cop/style/begin_block.rb#14 RuboCop::Cop::Style::BeginBlock::MSG = T.let(T.unsafe(nil), String) # This cop checks for places where `attr_reader` and `attr_writer` # for the same method can be combined into single `attr_accessor`. # # @example # # bad # class Foo # attr_reader :bar # attr_writer :bar # end # # # good # class Foo # attr_accessor :bar # end # # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#21 class RuboCop::Cop::Style::BisectedAttrAccessor < ::RuboCop::Cop::Base include ::RuboCop::Cop::VisibilityHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#27 def on_class(class_node); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#27 def on_module(class_node); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#27 def on_sclass(class_node); end private # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#61 def accessor_macroses(class_node, visibility); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#42 def accessor_names(class_node, visibility); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#81 def attr_reader?(send_node); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#126 def attr_reader_replacement(macro, node, rest_args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#75 def attr_within_visibility_scope?(node, visibility); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#85 def attr_writer?(send_node); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#89 def check(macro, reader_names, writer_names); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#135 def indent(node); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#104 def replacement(macro, node); end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#119 def rest_args(args, reader_names, writer_names); end end # source://rubocop//lib/rubocop/cop/style/bisected_attr_accessor.rb#25 RuboCop::Cop::Style::BisectedAttrAccessor::MSG = T.let(T.unsafe(nil), String) # This cop looks for uses of block comments (=begin...=end). # # @example # # bad # =begin # Multiple lines # of comments... # =end # # # good # # Multiple lines # # of comments... # # source://rubocop//lib/rubocop/cop/style/block_comments.rb#19 class RuboCop::Cop::Style::BlockComments < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/block_comments.rb#27 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/block_comments.rb#56 def eq_end_part(comment, expr); end # source://rubocop//lib/rubocop/cop/style/block_comments.rb#48 def parts(comment); end end # source://rubocop//lib/rubocop/cop/style/block_comments.rb#24 RuboCop::Cop::Style::BlockComments::BEGIN_LENGTH = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cop/style/block_comments.rb#25 RuboCop::Cop::Style::BlockComments::END_LENGTH = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cop/style/block_comments.rb#23 RuboCop::Cop::Style::BlockComments::MSG = T.let(T.unsafe(nil), String) # Check for uses of braces or do/end around single line or # multi-line blocks. # # @example EnforcedStyle: line_count_based (default) # # bad - single line block # items.each do |item| item / 5 end # # # good - single line block # items.each { |item| item / 5 } # # # bad - multi-line block # things.map { |thing| # something = thing.some_method # process(something) # } # # # good - multi-line block # things.map do |thing| # something = thing.some_method # process(something) # end # @example EnforcedStyle: semantic # # Prefer `do...end` over `{...}` for procedural blocks. # # # return value is used/assigned # # bad # foo = map do |x| # x # end # puts (map do |x| # x # end) # # # return value is not used out of scope # # good # map do |x| # x # end # # # Prefer `{...}` over `do...end` for functional blocks. # # # return value is not used out of scope # # bad # each { |x| # x # } # # # return value is used/assigned # # good # foo = map { |x| # x # } # map { |x| # x # }.inspect # # # The AllowBracesOnProceduralOneLiners option is ignored unless the # # EnforcedStyle is set to `semantic`. If so: # # # If the AllowBracesOnProceduralOneLiners option is unspecified, or # # set to `false` or any other falsey value, then semantic purity is # # maintained, so one-line procedural blocks must use do-end, not # # braces. # # # bad # collection.each { |element| puts element } # # # good # collection.each do |element| puts element end # # # If the AllowBracesOnProceduralOneLiners option is set to `true`, or # # any other truthy value, then one-line procedural blocks may use # # either style. (There is no setting for requiring braces on them.) # # # good # collection.each { |element| puts element } # # # also good # collection.each do |element| puts element end # @example EnforcedStyle: braces_for_chaining # # bad # words.each do |word| # word.flip.flop # end.join("-") # # # good # words.each { |word| # word.flip.flop # }.join("-") # @example EnforcedStyle: always_braces # # bad # words.each do |word| # word.flip.flop # end # # # good # words.each { |word| # word.flip.flop # } # @example BracesRequiredMethods: ['sig'] # # # Methods listed in the BracesRequiredMethods list, such as 'sig' # # in this example, will require `{...}` braces. This option takes # # precedence over all other configurations except IgnoredMethods. # # # bad # sig do # params( # foo: string, # ).void # end # def bar(foo) # puts foo # end # # # good # sig { # params( # foo: string, # ).void # } # def bar(foo) # puts foo # end # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#135 class RuboCop::Cop::Style::BlockDelimiters < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::IgnoredMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#159 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#144 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#376 def array_or_range?(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#171 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#199 def braces_for_chaining_message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#317 def braces_for_chaining_style?(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#211 def braces_required_message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#294 def braces_required_method?(method_name); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#298 def braces_required_methods; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#327 def braces_style?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#372 def conditional?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#331 def correction_would_break_code?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#341 def functional_block?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#337 def functional_method?(method_name); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#255 def get_blocks(node, &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#302 def line_count_based_block_style?(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#181 def line_count_based_message(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#215 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#349 def procedural_method?(method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#345 def procedural_oneliners_may_have_braces?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#273 def proper_block_style?(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#226 def replace_braces_with_do_end(corrector, loc); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#237 def replace_do_end_with_braces(corrector, loc); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#365 def return_value_of_scope?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#353 def return_value_used?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#306 def semantic_block_style?(node); end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#189 def semantic_message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#284 def special_method?(method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#288 def special_method_proper_block_style?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#251 def whitespace_after?(range, length = T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#247 def whitespace_before?(range); end end # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#140 RuboCop::Cop::Style::BlockDelimiters::ALWAYS_BRACES_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/block_delimiters.rb#142 RuboCop::Cop::Style::BlockDelimiters::BRACES_REQUIRED_MESSAGE = T.let(T.unsafe(nil), String) # Corrector to correct conditional assignment in `case` statements. # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#610 class RuboCop::Cop::Style::CaseCorrector extend ::RuboCop::Cop::Style::ConditionalAssignmentHelper extend ::RuboCop::Cop::Style::ConditionalCorrectorHelper class << self # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#615 def correct(corrector, cop, node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#625 def move_assignment_inside_condition(corrector, node); end private # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#645 def extract_branches(case_node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#639 def extract_tail_branches(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#651 def move_branch_inside_condition(corrector, branch, condition, assignment, column); end end end # This cop checks for uses of the case equality operator(===). # # @example # # bad # Array === something # (1..100) === 7 # /something/ === some_string # # # good # something.is_a?(Array) # (1..100).include?(7) # /something/.match?(some_string) # @example AllowOnConstant # # Style/CaseEquality: # # AllowOnConstant: true # # # bad # (1..100) === 7 # /something/ === some_string # # # good # Array === something # (1..100).include?(7) # /something/.match?(some_string) # # source://rubocop//lib/rubocop/cop/style/case_equality.rb#32 class RuboCop::Cop::Style::CaseEquality < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/case_equality.rb#38 def case_equality?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/case_equality.rb#40 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/case_equality.rb#53 def const?(node); end # source://rubocop//lib/rubocop/cop/style/case_equality.rb#61 def replacement(lhs, rhs); end end # source://rubocop//lib/rubocop/cop/style/case_equality.rb#35 RuboCop::Cop::Style::CaseEquality::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/case_equality.rb#36 RuboCop::Cop::Style::CaseEquality::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop identifies places where `if-elsif` constructions # can be replaced with `case-when`. # # @example # # bad # if status == :active # perform_action # elsif status == :inactive || status == :hibernating # check_timeout # else # final_action # end # # # good # case status # when :active # perform_action # when :inactive, :hibernating # check_timeout # else # final_action # end # # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#29 class RuboCop::Cop::Style::CaseLikeIf < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#35 def on_if(node); end private # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#59 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#198 def branch_conditions(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#217 def class_reference?(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#139 def collect_conditions(node, target, conditions); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#187 def condition_from_binary_op(lhs, rhs, target); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#176 def condition_from_equality_node(node, target); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#182 def condition_from_match_node(node, target); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#158 def condition_from_send_node(node, target); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#207 def const_reference?(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#226 def correction_range(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#221 def deparenthesize(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#80 def find_target(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#115 def find_target_in_equality_node(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#127 def find_target_in_match_node(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#99 def find_target_in_send_node(node); end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#230 def indent(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#246 def regexp_with_named_captures?(node); end # Named captures work with `=~` (if regexp is on lhs) and with `match` (both sides) # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#235 def regexp_with_working_captures?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#74 def should_check?(node); end end # source://rubocop//lib/rubocop/cop/style/case_like_if.rb#33 RuboCop::Cop::Style::CaseLikeIf::MSG = T.let(T.unsafe(nil), String) # Checks for uses of the character literal ?x. # # @example # # bad # ?x # # # good # 'x' # # # good # ?\C-\M-d # # source://rubocop//lib/rubocop/cop/style/character_literal.rb#17 class RuboCop::Cop::Style::CharacterLiteral < ::RuboCop::Cop::Cop include ::RuboCop::Cop::StringHelp # source://rubocop//lib/rubocop/cop/style/character_literal.rb#29 def autocorrect(node); end # Dummy implementation of method in ConfigurableEnforcedStyle that is # called from StringHelp. # # source://rubocop//lib/rubocop/cop/style/character_literal.rb#49 def correct_style_detected; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/character_literal.rb#23 def offense?(node); end # Dummy implementation of method in ConfigurableEnforcedStyle that is # called from StringHelp. # # source://rubocop//lib/rubocop/cop/style/character_literal.rb#45 def opposite_style_detected; end end # source://rubocop//lib/rubocop/cop/style/character_literal.rb#20 RuboCop::Cop::Style::CharacterLiteral::MSG = T.let(T.unsafe(nil), String) # This cop checks the style of children definitions at classes and # modules. Basically there are two different styles: # # The compact style is only forced for classes/modules with one child. # # @example EnforcedStyle: nested (default) # # good # # have each child on its own line # class Foo # class Bar # end # end # @example EnforcedStyle: compact # # good # # combine definitions as much as possible # class Foo::Bar # end # # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#24 class RuboCop::Cop::Style::ClassAndModuleChildren < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#34 def on_class(node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#40 def on_module(node); end private # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#76 def add_trailing_end(corrector, node, padding); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#140 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#132 def check_compact_style(node, body); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#124 def check_nested_style(node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#114 def check_style(node, body); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#81 def compact_definition(corrector, node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#93 def compact_identifier_name(node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#86 def compact_node(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#150 def compact_node_name?(node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#110 def indent_width; end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#106 def leading_spaces(node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#54 def nest_definition(corrector, node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#46 def nest_or_compact(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#146 def one_child?(body); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#98 def remove_end(corrector, body); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#63 def replace_keyword_with_module(corrector, node); end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#67 def split_on_double_colon(corrector, node, padding); end end # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#31 RuboCop::Cop::Style::ClassAndModuleChildren::COMPACT_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/class_and_module_children.rb#29 RuboCop::Cop::Style::ClassAndModuleChildren::NESTED_MSG = T.let(T.unsafe(nil), String) # This cop enforces consistent use of `Object#is_a?` or `Object#kind_of?`. # # @example EnforcedStyle: is_a? (default) # # bad # var.kind_of?(Date) # var.kind_of?(Integer) # # # good # var.is_a?(Date) # var.is_a?(Integer) # @example EnforcedStyle: kind_of? # # bad # var.is_a?(Time) # var.is_a?(String) # # # good # var.kind_of?(Time) # var.kind_of?(String) # # source://rubocop//lib/rubocop/cop/style/class_check.rb#26 class RuboCop::Cop::Style::ClassCheck < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/class_check.rb#44 def message(node); end # source://rubocop//lib/rubocop/cop/style/class_check.rb#33 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/class_check.rb#30 RuboCop::Cop::Style::ClassCheck::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/class_check.rb#31 RuboCop::Cop::Style::ClassCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop enforces the use of `Object#instance_of?` instead of class comparison # for equality. # # @example # # bad # var.class == Date # var.class.equal?(Date) # var.class.eql?(Date) # var.class.name == 'Date' # # # good # var.instance_of?(Date) # # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#19 class RuboCop::Cop::Style::ClassEqualityComparison < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::IgnoredMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#28 def class_comparison_candidate?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#34 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#50 def class_name(class_node, node); end # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#58 def offense_range(receiver_node, node); end end # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#24 RuboCop::Cop::Style::ClassEqualityComparison::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/class_equality_comparison.rb#26 RuboCop::Cop::Style::ClassEqualityComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for uses of the class/module name instead of # self, when defining class/module methods. # # @example # # bad # class SomeClass # def SomeClass.class_method # # ... # end # end # # # good # class SomeClass # def self.class_method # # ... # end # end # # source://rubocop//lib/rubocop/cop/style/class_methods.rb#23 class RuboCop::Cop::Style::ClassMethods < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/class_methods.rb#28 def on_class(node); end # source://rubocop//lib/rubocop/cop/style/class_methods.rb#28 def on_module(node); end private # source://rubocop//lib/rubocop/cop/style/class_methods.rb#43 def check_defs(name, node); end end # source://rubocop//lib/rubocop/cop/style/class_methods.rb#26 RuboCop::Cop::Style::ClassMethods::MSG = T.let(T.unsafe(nil), String) # This cop enforces using `def self.method_name` or `class << self` to define class methods. # # @example EnforcedStyle: def_self (default) # # bad # class SomeClass # class << self # attr_accessor :class_accessor # # def class_method # # ... # end # end # end # # # good # class SomeClass # def self.class_method # # ... # end # # class << self # attr_accessor :class_accessor # end # end # # # good - contains private method # class SomeClass # class << self # attr_accessor :class_accessor # # private # # def private_class_method # # ... # end # end # end # @example EnforcedStyle: self_class # # bad # class SomeClass # def self.class_method # # ... # end # end # # # good # class SomeClass # class << self # def class_method # # ... # end # end # end # # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#61 class RuboCop::Cop::Style::ClassMethodsDefinitions < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::VisibilityHelp include ::RuboCop::Cop::CommentsHelp include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#81 def on_defs(node); end # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#71 def on_sclass(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#94 def all_methods_public?(sclass_node); end # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#114 def autocorrect_sclass(node, corrector); end # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#101 def def_nodes(sclass_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#90 def def_self_style?; end # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#140 def extract_def_from_sclass(def_node, sclass_node); end # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#151 def indentation_diff(node1, node2); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#136 def sclass_only_has_methods?(node); end end # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#68 RuboCop::Cop::Style::ClassMethodsDefinitions::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/class_methods_definitions.rb#69 RuboCop::Cop::Style::ClassMethodsDefinitions::MSG_SCLASS = T.let(T.unsafe(nil), String) # This cop checks for uses of class variables. Offenses # are signaled only on assignment to class variables to # reduce the number of offenses that would be reported. # # You have to be careful when setting a value for a class # variable; if a class has been inherited, changing the # value of a class variable also affects the inheriting # classes. This means that it's almost always better to # use a class instance variable instead. # # @example # # bad # class A # @@test = 10 # end # # class A # def self.test(name, value) # class_variable_set("@@#{name}", value) # end # end # # class A; end # A.class_variable_set(:@@test, 10) # # # good # class A # @test = 10 # end # # class A # def test # @@test # you can access class variable without offense # end # end # # class A # def self.test(name) # class_variable_get("@@#{name}") # you can access without offense # end # end # # source://rubocop//lib/rubocop/cop/style/class_vars.rb#48 class RuboCop::Cop::Style::ClassVars < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/class_vars.rb#52 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/style/class_vars.rb#56 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/class_vars.rb#49 RuboCop::Cop::Style::ClassVars::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/class_vars.rb#50 RuboCop::Cop::Style::ClassVars::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop enforces the use of consistent method names # from the Enumerable module. # # Unfortunately we cannot actually know if a method is from # Enumerable or not (static analysis limitation), so this cop # can yield some false positives. # # You can customize the mapping from undesired method to desired method. # # e.g. to use `detect` over `find`: # # Style/CollectionMethods: # PreferredMethods: # find: detect # # The default mapping for `PreferredMethods` behaves as follows. # # @example # # bad # items.collect # items.collect! # items.inject # items.detect # items.find_all # items.member? # # # good # items.map # items.map! # items.reduce # items.find # items.select # items.include? # # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#40 class RuboCop::Cop::Style::CollectionMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::MethodPreference extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#46 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#50 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#58 def check_method_node(node); end # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#67 def message(node); end end # source://rubocop//lib/rubocop/cop/style/collection_methods.rb#44 RuboCop::Cop::Style::CollectionMethods::MSG = T.let(T.unsafe(nil), String) # This cop checks for methods invoked via the :: operator instead # of the . operator (like FileUtils::rmdir instead of FileUtils.rmdir). # # @example # # bad # Timeout::timeout(500) { do_something } # FileUtils::rmdir(dir) # Marshal::dump(obj) # # # good # Timeout.timeout(500) { do_something } # FileUtils.rmdir(dir) # Marshal.dump(obj) # # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#20 class RuboCop::Cop::Style::ColonMethodCall < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#25 def java_type_node?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#34 def on_send(node); end class << self # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#30 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/colon_method_call.rb#23 RuboCop::Cop::Style::ColonMethodCall::MSG = T.let(T.unsafe(nil), String) # This cop checks for class methods that are defined using the `::` # operator instead of the `.` operator. # # @example # # bad # class Foo # def self::bar # end # end # # # good # class Foo # def self.bar # end # end # # source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#22 class RuboCop::Cop::Style::ColonMethodDefinition < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#27 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/style/colon_method_definition.rb#25 RuboCop::Cop::Style::ColonMethodDefinition::MSG = T.let(T.unsafe(nil), String) # This cop checks for places where multiple consecutive loops over the same data # can be combined into a single loop. It is very likely that combining them # will make the code more efficient and more concise. # # It is marked as unsafe, because the first loop might modify # a state that the second loop depends on; these two aren't combinable. # # @example # # bad # def method # items.each do |item| # do_something(item) # end # # items.each do |item| # do_something_else(item) # end # end # # # good # def method # items.each do |item| # do_something(item) # do_something_else(item) # end # end # # # bad # def method # for item in items do # do_something(item) # end # # for item in items do # do_something_else(item) # end # end # # # good # def method # for item in items do # do_something(item) # do_something_else(item) # end # end # # # good # def method # each_slice(2) { |slice| do_something(slice) } # each_slice(3) { |slice| do_something(slice) } # end # # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#58 class RuboCop::Cop::Style::CombinableLoops < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#61 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#68 def on_for(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#77 def collection_looping_method?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#82 def same_collection_looping?(node, sibling); end end # source://rubocop//lib/rubocop/cop/style/combinable_loops.rb#59 RuboCop::Cop::Style::CombinableLoops::MSG = T.let(T.unsafe(nil), String) # This cop enforces using `` or %x around command literals. # # @example EnforcedStyle: backticks (default) # # bad # folders = %x(find . -type d).split # # # bad # %x( # ln -s foo.example.yml foo.example # ln -s bar.example.yml bar.example # ) # # # good # folders = `find . -type d`.split # # # good # ` # ln -s foo.example.yml foo.example # ln -s bar.example.yml bar.example # ` # @example EnforcedStyle: mixed # # bad # folders = %x(find . -type d).split # # # bad # ` # ln -s foo.example.yml foo.example # ln -s bar.example.yml bar.example # ` # # # good # folders = `find . -type d`.split # # # good # %x( # ln -s foo.example.yml foo.example # ln -s bar.example.yml bar.example # ) # @example EnforcedStyle: percent_x # # bad # folders = `find . -type d`.split # # # bad # ` # ln -s foo.example.yml foo.example # ln -s bar.example.yml bar.example # ` # # # good # folders = %x(find . -type d).split # # # good # %x( # ln -s foo.example.yml foo.example # ln -s bar.example.yml bar.example # ) # @example AllowInnerBackticks: false (default) # # If `false`, the cop will always recommend using `%x` if one or more # # backticks are found in the command string. # # # bad # `echo \`ls\`` # # # good # %x(echo `ls`) # @example AllowInnerBackticks: true # # good # `echo \`ls\`` # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#78 class RuboCop::Cop::Style::CommandLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/command_literal.rb#85 def on_xstr(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#150 def allow_inner_backticks?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#126 def allowed_backtick_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#135 def allowed_percent_x_literal?(node); end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#113 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#163 def backtick_literal?(node); end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#97 def check_backtick_literal(node, message); end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#105 def check_percent_x_literal(node, message); end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#171 def command_delimiter; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#154 def contains_backtick?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/command_literal.rb#146 def contains_disallowed_backtick?(node); end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#175 def default_delimiter; end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#158 def node_body(node); end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#167 def preferred_delimiter; end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#179 def preferred_delimiters_config; end end # source://rubocop//lib/rubocop/cop/style/command_literal.rb#82 RuboCop::Cop::Style::CommandLiteral::MSG_USE_BACKTICKS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/command_literal.rb#83 RuboCop::Cop::Style::CommandLiteral::MSG_USE_PERCENT_X = T.let(T.unsafe(nil), String) # This cop checks that comment annotation keywords are written according # to guidelines. # # NOTE: With a multiline comment block (where each line is only a # comment), only the first line will be able to register an offense, even # if an annotation keyword starts another line. This is done to prevent # incorrect registering of keywords (eg. `review`) inside a paragraph as an # annotation. # # @example # # bad # # TODO make better # # # good # # TODO: make better # # # bad # # TODO:make better # # # good # # TODO: make better # # # bad # # fixme: does not work # # # good # # FIXME: does not work # # # bad # # Optimize does not work # # # good # # OPTIMIZE: does not work # # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#39 class RuboCop::Cop::Style::CommentAnnotation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Style::AnnotationComment include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#50 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#87 def annotation_range(comment, margin, first_word, colon, space); end # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#93 def concat_length(*args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#97 def correct_annotation?(first_word, colon, space, note); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#78 def first_comment_line?(comments, index); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#83 def inline_comment?(comment); end # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#67 def register_offense(range, note, first_word); end end # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#47 RuboCop::Cop::Style::CommentAnnotation::MISSING_NOTE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/comment_annotation.rb#44 RuboCop::Cop::Style::CommentAnnotation::MSG = T.let(T.unsafe(nil), String) # This cop checks for comments put on the same line as some keywords. # These keywords are: `begin`, `class`, `def`, `end`, `module`. # # Note that some comments # are allowed. # # @example # # bad # if condition # statement # end # end if # # # bad # class X # comment # statement # end # # # bad # def x; end # comment # # # good # if condition # statement # end # # # good # class X # :nodoc: # y # end # # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#36 class RuboCop::Cop::Style::CommentedKeyword < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#40 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#69 def line(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#63 def offensive?(comment); end end # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#55 RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENTS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#61 RuboCop::Cop::Style::CommentedKeyword::ALLOWED_COMMENT_REGEXES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#52 RuboCop::Cop::Style::CommentedKeyword::KEYWORDS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#53 RuboCop::Cop::Style::CommentedKeyword::KEYWORD_REGEXES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/commented_keyword.rb#37 RuboCop::Cop::Style::CommentedKeyword::MSG = T.let(T.unsafe(nil), String) # Check for `if` and `case` statements where each branch is used for # assignment to the same variable when using the return of the # condition can be used instead. # # @example EnforcedStyle: assign_to_condition (default) # # bad # if foo # bar = 1 # else # bar = 2 # end # # case foo # when 'a' # bar += 1 # else # bar += 2 # end # # if foo # some_method # bar = 1 # else # some_other_method # bar = 2 # end # # # good # bar = if foo # 1 # else # 2 # end # # bar += case foo # when 'a' # 1 # else # 2 # end # # bar << if foo # some_method # 1 # else # some_other_method # 2 # end # @example EnforcedStyle: assign_inside_condition # # bad # bar = if foo # 1 # else # 2 # end # # bar += case foo # when 'a' # 1 # else # 2 # end # # bar << if foo # some_method # 1 # else # some_other_method # 2 # end # # # good # if foo # bar = 1 # else # bar = 2 # end # # case foo # when 'a' # bar += 1 # else # bar += 2 # end # # if foo # some_method # bar = 1 # else # some_other_method # bar = 2 # end # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#211 class RuboCop::Cop::Style::ConditionalAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::Style::ConditionalAssignmentHelper include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#234 def assignment_type?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#303 def candidate_condition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_and_asgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#269 def on_case(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#255 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_masgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_op_asgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#242 def on_or_asgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#249 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#309 def allowed_single_line?(branches); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#382 def allowed_statements?(branches); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#305 def allowed_ternary?(assignment); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#313 def assignment_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#357 def assignment_types_match?(*nodes); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#374 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#299 def candidate_node?(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#281 def check_assignment_to_condition(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#363 def check_node(node, branches); end # If `Layout/LineLength` is enabled, we do not want to introduce an # offense by auto-correcting this cop. Find the max configured line # length. Find the longest line of condition. Remove the assignment # from lines that contain the offending assignment because after # correcting, this will not be on the line anymore. Check if the length # of the longest line + the length of the corrected assignment is # greater than the max configured line length # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#398 def correction_exceeds_line_limit?(node, branches); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#435 def include_ternary?; end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#427 def indentation_width; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#350 def lhs_all_match?(branches); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#419 def line_length_cop_enabled?; end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#410 def longest_line(node, assignment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#406 def longest_line_exceeds_line_limit?(node, assignment); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#423 def max_line_length; end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#334 def move_assignment_inside_condition(corrector, node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#324 def move_assignment_outside_condition(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#431 def single_line_conditions_only?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#346 def ternary_condition?(node); end end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#223 RuboCop::Cop::Style::ConditionalAssignment::ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#219 RuboCop::Cop::Style::ConditionalAssignment::ASSIGN_TO_CONDITION_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#227 RuboCop::Cop::Style::ConditionalAssignment::ENABLED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#226 RuboCop::Cop::Style::ConditionalAssignment::INDENTATION_WIDTH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#225 RuboCop::Cop::Style::ConditionalAssignment::LINE_LENGTH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#228 RuboCop::Cop::Style::ConditionalAssignment::MAX = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#217 RuboCop::Cop::Style::ConditionalAssignment::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#229 RuboCop::Cop::Style::ConditionalAssignment::SINGLE_LINE_CONDITIONS_ONLY = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#221 RuboCop::Cop::Style::ConditionalAssignment::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#230 RuboCop::Cop::Style::ConditionalAssignment::WIDTH = T.let(T.unsafe(nil), String) # Helper module to provide common methods to classes needed for the # ConditionalAssignment Cop. # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#8 module RuboCop::Cop::Style::ConditionalAssignmentHelper extend ::RuboCop::AST::NodePattern::Macros # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#64 def end_with_eq?(sym); end # `elsif` branches show up in the `node` as an `else`. We need # to recursively iterate over all `else` branches and consider all # but the last `node` an `elsif` branch and consider the last `node` # the actual `else` branch. # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#20 def expand_elses(branch); end # `when` nodes contain the entire branch including the condition. # We only need the contents of the branch, not the condition. # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#28 def expand_when_branches(when_branches); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#55 def indent(cop, source); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#37 def lhs(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#32 def tail(branch); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#110 def assignment_rhs_exist?(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#70 def expand_elsif(node, elsif_branches = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#96 def lhs_for_casgn(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#83 def lhs_for_send(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#105 def setter_method?(method_name); end end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#13 RuboCop::Cop::Style::ConditionalAssignmentHelper::ALIGN_WITH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#12 RuboCop::Cop::Style::ConditionalAssignmentHelper::END_ALIGNMENT = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#11 RuboCop::Cop::Style::ConditionalAssignmentHelper::EQUAL = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#14 RuboCop::Cop::Style::ConditionalAssignmentHelper::KEYWORD = T.let(T.unsafe(nil), String) # Helper module to provide common methods to ConditionalAssignment # correctors # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#442 module RuboCop::Cop::Style::ConditionalCorrectorHelper # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#463 def assignment(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#493 def correct_branches(corrector, branches); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#470 def correct_if_branches(corrector, cop, node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#443 def remove_whitespace_in_branches(corrector, branch, condition, column); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#480 def replace_branch_assignment(corrector, branch); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#454 def white_space_range(node, column); end end # This cop checks that constants defined in classes and modules have # an explicit visibility declaration. By default, Ruby makes all class- # and module constants public, which litters the public API of the # class or module. Explicitly declaring a visibility makes intent more # clear, and prevents outside actors from touching private state. # # @example # # # bad # class Foo # BAR = 42 # BAZ = 43 # end # # # good # class Foo # BAR = 42 # private_constant :BAR # # BAZ = 43 # public_constant :BAZ # end # # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#29 class RuboCop::Cop::Style::ConstantVisibility < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#33 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#68 def visibility_declaration_for?(param0 = T.unsafe(nil), param1); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#49 def class_or_module_scope?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#72 def match_name?(name, constant_name); end # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#43 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#60 def visibility_declaration?(node); end end # source://rubocop//lib/rubocop/cop/style/constant_visibility.rb#30 RuboCop::Cop::Style::ConstantVisibility::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/copyright.rb#18 class RuboCop::Cop::Style::Copyright < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/copyright.rb#27 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/copyright.rb#46 def autocorrect_notice; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/copyright.rb#78 def encoding_token?(processed_source, token_index); end # source://rubocop//lib/rubocop/cop/style/copyright.rb#64 def insert_notice_before(processed_source); end # source://rubocop//lib/rubocop/cop/style/copyright.rb#42 def notice; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/copyright.rb#85 def notice_found?(processed_source); end # source://rubocop//lib/rubocop/cop/style/copyright.rb#50 def offense_range; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/copyright.rb#71 def shebang_token?(processed_source, token_index); end # @raise [Warning] # # source://rubocop//lib/rubocop/cop/style/copyright.rb#54 def verify_autocorrect_notice!; end end # source://rubocop//lib/rubocop/cop/style/copyright.rb#24 RuboCop::Cop::Style::Copyright::AUTOCORRECT_EMPTY_WARNING = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/copyright.rb#22 RuboCop::Cop::Style::Copyright::MSG = T.let(T.unsafe(nil), String) # This cop checks for consistent usage of the `DateTime` class over the # `Time` class. This cop is disabled by default since these classes, # although highly overlapping, have particularities that make them not # replaceable in certain situations when dealing with multiple timezones # and/or DST. # # @example # # # bad - uses `DateTime` for current time # DateTime.now # # # good - uses `Time` for current time # Time.now # # # bad - uses `DateTime` for modern date # DateTime.iso8601('2016-06-29') # # # good - uses `Time` for modern date # Time.iso8601('2016-06-29') # # # good - uses `DateTime` with start argument for historical date # DateTime.iso8601('1751-04-23', Date::ENGLAND) # @example AllowCoercion: false (default) # # # bad - coerces to `DateTime` # something.to_datetime # # # good - coerces to `Time` # something.to_time # @example AllowCoercion: true # # # good # something.to_datetime # # # good # something.to_time # # source://rubocop//lib/rubocop/cop/style/date_time.rb#44 class RuboCop::Cop::Style::DateTime < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/date_time.rb#50 def date_time?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/date_time.rb#54 def historic_date?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/date_time.rb#62 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/date_time.rb#58 def to_datetime?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/date_time.rb#80 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/date_time.rb#76 def disallow_coercion?; end end # source://rubocop//lib/rubocop/cop/style/date_time.rb#47 RuboCop::Cop::Style::DateTime::CLASS_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/date_time.rb#48 RuboCop::Cop::Style::DateTime::COERCION_MSG = T.let(T.unsafe(nil), String) # This cop checks for parentheses in the definition of a method, # that does not take any arguments. Both instance and # class/singleton methods are checked. # # @example # # # bad # def foo() # # does a thing # end # # # good # def foo # # does a thing # end # # # also good # def foo() does_a_thing end # @example # # # bad # def Baz.foo() # # does a thing # end # # # good # def Baz.foo # # does a thing # end # # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#36 class RuboCop::Cop::Style::DefWithParentheses < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#42 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#42 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/style/def_with_parentheses.rb#39 RuboCop::Cop::Style::DefWithParentheses::MSG = T.let(T.unsafe(nil), String) # This cop checks for places where the `#__dir__` method can replace more # complex constructs to retrieve a canonicalized absolute path to the # current file. # # @example # # bad # path = File.expand_path(File.dirname(__FILE__)) # # # bad # path = File.dirname(File.realpath(__FILE__)) # # # good # path = __dir__ # # source://rubocop//lib/rubocop/cop/style/dir.rb#19 class RuboCop::Cop::Style::Dir < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/dir.rb#25 def dir_replacement?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/dir.rb#30 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/dir.rb#40 def file_keyword?(node); end end # source://rubocop//lib/rubocop/cop/style/dir.rb#22 RuboCop::Cop::Style::Dir::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/dir.rb#23 RuboCop::Cop::Style::Dir::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Detects comments to enable/disable RuboCop. # This is useful if want to make sure that every RuboCop error gets fixed # and not quickly disabled with a comment. # # @example # # bad # # rubocop:disable Metrics/AbcSize # def f # end # # rubocop:enable Metrics/AbcSize # # # good # def fixed_method_name_and_no_rubocop_comments # end # # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#23 class RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#29 def on_new_investigation; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#41 def rubocop_directive_comment?(comment); end end # source://rubocop//lib/rubocop/cop/style/disable_cops_within_source_code_directive.rb#27 RuboCop::Cop::Style::DisableCopsWithinSourceCodeDirective::MSG = T.let(T.unsafe(nil), String) # This cop checks for missing top-level documentation of classes and # modules. Classes with no body are exempt from the check and so are # namespace modules - modules that have nothing in their bodies except # classes, other modules, constant definitions or constant visibility # declarations. # # The documentation requirement is annulled if the class or module has # same for all its children. # # @example # # bad # class Person # # ... # end # # module Math # end # # # good # # Description/Explanation of Person class # class Person # # ... # end # # # allowed # # Class without body # class Person # end # # # Namespace - A namespace can be a class or a module # # Containing a class # module Namespace # # Description/Explanation of Person class # class Person # # ... # end # end # # # Containing constant visibility declaration # module Namespace # class Private # end # # private_constant :Private # end # # # Containing constant definition # module Namespace # Public = Class.new # end # # source://rubocop//lib/rubocop/cop/style/documentation.rb#58 class RuboCop::Cop::Style::Documentation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Style::AnnotationComment include ::RuboCop::Cop::DocumentationComment # source://rubocop//lib/rubocop/cop/style/documentation.rb#63 def constant_definition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/documentation.rb#65 def constant_visibility_declaration?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/documentation.rb#69 def on_class(node); end # source://rubocop//lib/rubocop/cop/style/documentation.rb#75 def on_module(node); end # source://rubocop//lib/rubocop/cop/style/documentation.rb#64 def outer_module(param0); end private # source://rubocop//lib/rubocop/cop/style/documentation.rb#81 def check(node, body, type); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/documentation.rb#104 def compact_namespace?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/documentation.rb#100 def constant_declaration?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/documentation.rb#90 def namespace?(node); end # source://rubocop//lib/rubocop/cop/style/documentation.rb#127 def nodoc(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/documentation.rb#123 def nodoc?(comment, require_all: T.unsafe(nil)); end # Note: How end-of-line comments are associated with code changed in # parser-2.2.0.4. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/documentation.rb#113 def nodoc_comment?(node, require_all: T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/documentation.rb#61 RuboCop::Cop::Style::Documentation::MSG = T.let(T.unsafe(nil), String) # This cop checks for missing documentation comment for public methods. # It can optionally be configured to also require documentation for # non-public methods. # # @example # # # bad # # class Foo # def bar # puts baz # end # end # # module Foo # def bar # puts baz # end # end # # def foo.bar # puts baz # end # # # good # # class Foo # # Documentation # def bar # puts baz # end # end # # module Foo # # Documentation # def bar # puts baz # end # end # # # Documentation # def foo.bar # puts baz # end # @example RequireForNonPublicMethods: false (default) # # good # class Foo # protected # def do_something # end # end # # class Foo # private # def do_something # end # end # @example RequireForNonPublicMethods: true # # bad # class Foo # protected # def do_something # end # end # # class Foo # private # def do_something # end # end # # # good # class Foo # protected # # Documentation # def do_something # end # end # # class Foo # private # # Documentation # def do_something # end # end # # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#94 class RuboCop::Cop::Style::DocumentationMethod < ::RuboCop::Cop::Base include ::RuboCop::Cop::Style::AnnotationComment include ::RuboCop::Cop::DocumentationComment include ::RuboCop::Cop::DefNode # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#100 def module_function_node?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#104 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#104 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#112 def check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#119 def require_for_non_public_methods?; end end # source://rubocop//lib/rubocop/cop/style/documentation_method.rb#98 RuboCop::Cop::Style::DocumentationMethod::MSG = T.let(T.unsafe(nil), String) # Detects double disable comments on one line. This is mostly to catch # automatically generated comments that need to be regenerated. # # @example # # bad # def f # rubocop:disable Style/For # rubocop:disable Metrics/AbcSize # end # # # good # # rubocop:disable Metrics/AbcSize # def f # rubocop:disable Style/For # end # # rubocop:enable Metrics/AbcSize # # # if both fit on one line # def f # rubocop:disable Style/For, Metrics/AbcSize # end # # source://rubocop//lib/rubocop/cop/style/double_cop_disable_directive.rb#27 class RuboCop::Cop::Style::DoubleCopDisableDirective < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/double_cop_disable_directive.rb#34 def on_new_investigation; end end # source://rubocop//lib/rubocop/cop/style/double_cop_disable_directive.rb#32 RuboCop::Cop::Style::DoubleCopDisableDirective::MSG = T.let(T.unsafe(nil), String) # This cop checks for uses of double negation (`!!`) to convert something to a boolean value. # # When using `EnforcedStyle: allowed_in_returns`, allow double nagation in contexts # that use boolean as a return value. When using `EnforcedStyle: forbidden`, double nagation # should be forbidden always. # # Please, note that when something is a boolean value # !!something and !something.nil? are not the same thing. # As you're unlikely to write code that can accept values of any type # this is rarely a problem in practice. # # @example # # bad # !!something # # # good # !something.nil? # @example EnforcedStyle: allowed_in_returns (default) # # good # def foo? # !!return_value # end # @example EnforcedStyle: forbidden # # bad # def foo? # !!return_value # end # # source://rubocop//lib/rubocop/cop/style/double_negation.rb#35 class RuboCop::Cop::Style::DoubleNegation < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/style/double_negation.rb#41 def double_negative?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/double_negation.rb#43 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/double_negation.rb#52 def allowed_in_returns?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/double_negation.rb#56 def end_of_method_definition?(node); end # source://rubocop//lib/rubocop/cop/style/double_negation.rb#64 def find_def_node_from_ascendant(node); end end # source://rubocop//lib/rubocop/cop/style/double_negation.rb#38 RuboCop::Cop::Style::DoubleNegation::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/double_negation.rb#39 RuboCop::Cop::Style::DoubleNegation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for loops which iterate a constant number of times, # using a Range literal and `#each`. This can be done more readably using # `Integer#times`. # # This check only applies if the block takes no parameters. # # @example # # bad # (1..5).each { } # # # good # 5.times { } # @example # # bad # (0...10).each {} # # # good # 10.times {} # # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#25 class RuboCop::Cop::Style::EachForSimpleLoop < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#49 def offending_each_range(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#31 def on_block(node); end end # source://rubocop//lib/rubocop/cop/style/each_for_simple_loop.rb#28 RuboCop::Cop::Style::EachForSimpleLoop::MSG = T.let(T.unsafe(nil), String) # This cop looks for inject / reduce calls where the passed in object is # returned at the end and so could be replaced by each_with_object without # the need to return the object at the end. # # However, we can't replace with each_with_object if the accumulator # parameter is assigned to within the block. # # @example # # bad # [1, 2].inject({}) { |a, e| a[e] = e; a } # # # good # [1, 2].each_with_object({}) { |e, a| a[e] = e } # # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#19 class RuboCop::Cop::Style::EachWithObject < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#26 def each_with_object_candidate?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#30 def on_block(node); end private # if the accumulator parameter is assigned to in the block, # then we can't convert to each_with_object # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#70 def accumulator_param_assigned_to?(body, args); end # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#49 def autocorrect(corrector, node, return_value); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#89 def first_argument_returned?(args, return_value); end # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#82 def return_value(body); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#97 def return_value_occupies_whole_line?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#64 def simple_method_arg?(method_arg); end # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#101 def whole_line_expression(node); end end # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#24 RuboCop::Cop::Style::EachWithObject::METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/each_with_object.rb#23 RuboCop::Cop::Style::EachWithObject::MSG = T.let(T.unsafe(nil), String) # This cop checks for pipes for empty block parameters. Pipes for empty # block parameters do not cause syntax errors, but they are redundant. # # @example # # bad # a do || # do_something # end # # # bad # a { || do_something } # # # good # a do # end # # # good # a { do_something } # # source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#24 class RuboCop::Cop::Style::EmptyBlockParameter < ::RuboCop::Cop::Base include ::RuboCop::Cop::EmptyParameter include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#31 def on_block(node); end private # source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#38 def autocorrect(corrector, node); end end # source://rubocop//lib/rubocop/cop/style/empty_block_parameter.rb#29 RuboCop::Cop::Style::EmptyBlockParameter::MSG = T.let(T.unsafe(nil), String) # This cop checks for case statements with an empty condition. # # @example # # # bad: # case # when x == 0 # puts 'x is 0' # when y == 0 # puts 'y is 0' # else # puts 'neither is 0' # end # # # good: # if x == 0 # puts 'x is 0' # elsif y == 0 # puts 'y is 0' # else # puts 'neither is 0' # end # # # good: (the case condition node is not empty) # case n # when 0 # puts 'zero' # when 1 # puts 'one' # else # puts 'more' # end # # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#38 class RuboCop::Cop::Style::EmptyCaseCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#44 def on_case(case_node); end private # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#64 def autocorrect(corrector, case_node); end # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#71 def correct_case_when(corrector, case_node, when_nodes); end # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#83 def correct_when_conditions(corrector, when_nodes); end # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#96 def keep_first_when_comment(case_range, corrector); end end # source://rubocop//lib/rubocop/cop/style/empty_case_condition.rb#42 RuboCop::Cop::Style::EmptyCaseCondition::MSG = T.let(T.unsafe(nil), String) # Checks for empty else-clauses, possibly including comments and/or an # explicit `nil` depending on the EnforcedStyle. # # @example EnforcedStyle: empty # # warn only on empty else # # # bad # if condition # statement # else # end # # # good # if condition # statement # else # nil # end # # # good # if condition # statement # else # statement # end # # # good # if condition # statement # end # @example EnforcedStyle: nil # # warn on else with nil in it # # # bad # if condition # statement # else # nil # end # # # good # if condition # statement # else # end # # # good # if condition # statement # else # statement # end # # # good # if condition # statement # end # @example EnforcedStyle: both (default) # # warn on empty else and else with nil in it # # # bad # if condition # statement # else # nil # end # # # bad # if condition # statement # else # end # # # good # if condition # statement # else # statement # end # # # good # if condition # statement # end # # source://rubocop//lib/rubocop/cop/style/empty_else.rb#92 class RuboCop::Cop::Style::EmptyElse < ::RuboCop::Cop::Base include ::RuboCop::Cop::OnNormalIfUnless include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/empty_else.rb#104 def on_case(node); end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#100 def on_normal_if_unless(node); end private # source://rubocop//lib/rubocop/cop/style/empty_else.rb#139 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_else.rb#162 def autocorrect_forbidden?(type); end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#153 def base_node(node); end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#110 def check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_else.rb#147 def comment_in_else?(loc); end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#123 def empty_check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_else.rb#119 def empty_style?; end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#166 def missing_else_style; end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#131 def nil_check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_else.rb#115 def nil_style?; end end # source://rubocop//lib/rubocop/cop/style/empty_else.rb#98 RuboCop::Cop::Style::EmptyElse::MSG = T.let(T.unsafe(nil), String) # This cop checks for parentheses for empty lambda parameters. Parentheses # for empty lambda parameters do not cause syntax errors, but they are # redundant. # # @example # # bad # -> () { do_something } # # # good # -> { do_something } # # # good # -> (arg) { do_something(arg) } # # source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#19 class RuboCop::Cop::Style::EmptyLambdaParameter < ::RuboCop::Cop::Base include ::RuboCop::Cop::EmptyParameter include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#26 def on_block(node); end private # source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#35 def autocorrect(corrector, node); end end # source://rubocop//lib/rubocop/cop/style/empty_lambda_parameter.rb#24 RuboCop::Cop::Style::EmptyLambdaParameter::MSG = T.let(T.unsafe(nil), String) # This cop checks for the use of a method, the result of which # would be a literal, like an empty array, hash, or string. # # @example # # bad # a = Array.new # h = Hash.new # s = String.new # # # good # a = [] # h = {} # s = '' # # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#19 class RuboCop::Cop::Style::EmptyLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#30 def array_node(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#33 def array_with_block(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#31 def hash_node(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#35 def hash_with_block(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#38 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#32 def str_node(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#102 def correction(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#62 def enforce_double_quotes?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#70 def first_argument_unparenthesized?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#93 def offense_array_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#97 def offense_hash_node?(node); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#48 def offense_message(node); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#58 def preferred_string_literal; end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#78 def replacement_range(node); end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#66 def string_literals_config; end end # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#24 RuboCop::Cop::Style::EmptyLiteral::ARR_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#25 RuboCop::Cop::Style::EmptyLiteral::HASH_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#28 RuboCop::Cop::Style::EmptyLiteral::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/empty_literal.rb#26 RuboCop::Cop::Style::EmptyLiteral::STR_MSG = T.let(T.unsafe(nil), String) # This cop checks for the formatting of empty method definitions. # By default it enforces empty method definitions to go on a single # line (compact style), but it can be configured to enforce the `end` # to go on its own line (expanded style). # # NOTE: A method definition is not considered empty if it contains # comments. # # @example EnforcedStyle: compact (default) # # bad # def foo(bar) # end # # def self.foo(bar) # end # # # good # def foo(bar); end # # def foo(bar) # # baz # end # # def self.foo(bar); end # @example EnforcedStyle: expanded # # bad # def foo(bar); end # # def self.foo(bar); end # # # good # def foo(bar) # end # # def self.foo(bar) # end # # source://rubocop//lib/rubocop/cop/style/empty_method.rb#43 class RuboCop::Cop::Style::EmptyMethod < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/empty_method.rb#51 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/empty_method.rb#51 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_method.rb#90 def compact?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_method.rb#98 def compact_style?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_method.rb#67 def correct_style?(node); end # source://rubocop//lib/rubocop/cop/style/empty_method.rb#72 def corrected(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_method.rb#94 def expanded?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/empty_method.rb#102 def expanded_style?; end # source://rubocop//lib/rubocop/cop/style/empty_method.rb#84 def joint(node); end # source://rubocop//lib/rubocop/cop/style/empty_method.rb#63 def message(_range); end end # source://rubocop//lib/rubocop/cop/style/empty_method.rb#47 RuboCop::Cop::Style::EmptyMethod::MSG_COMPACT = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/empty_method.rb#48 RuboCop::Cop::Style::EmptyMethod::MSG_EXPANDED = T.let(T.unsafe(nil), String) # This cop checks ensures source files have no utf-8 encoding comments. # # @example # # bad # # encoding: UTF-8 # # coding: UTF-8 # # -*- coding: UTF-8 -*- # # source://rubocop//lib/rubocop/cop/style/encoding.rb#12 class RuboCop::Cop::Style::Encoding < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/encoding.rb#20 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/encoding.rb#44 def encoding_line_number(processed_source); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/encoding.rb#40 def encoding_omitable?(line); end # source://rubocop//lib/rubocop/cop/style/encoding.rb#34 def offense(processed_source, line_number); end end # source://rubocop//lib/rubocop/cop/style/encoding.rb#17 RuboCop::Cop::Style::Encoding::ENCODING_PATTERN = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/encoding.rb#16 RuboCop::Cop::Style::Encoding::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/encoding.rb#18 RuboCop::Cop::Style::Encoding::SHEBANG = T.let(T.unsafe(nil), String) # This cop checks for END blocks. # # @example # # bad # END { puts 'Goodbye!' } # # # good # at_exit { puts 'Goodbye!' } # # source://rubocop//lib/rubocop/cop/style/end_block.rb#15 class RuboCop::Cop::Style::EndBlock < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/end_block.rb#21 def on_postexe(node); end end # source://rubocop//lib/rubocop/cop/style/end_block.rb#18 RuboCop::Cop::Style::EndBlock::MSG = T.let(T.unsafe(nil), String) # This cop checks `eval` method usage. `eval` can receive source location # metadata, that are filename and line number. The metadata is used by # backtraces. This cop recommends to pass the metadata to `eval` method. # # @example # # bad # eval <<-RUBY # def do_something # end # RUBY # # # bad # C.class_eval <<-RUBY # def do_something # end # RUBY # # # good # eval <<-RUBY, binding, __FILE__, __LINE__ + 1 # def do_something # end # RUBY # # # good # C.class_eval <<-RUBY, __FILE__, __LINE__ + 1 # def do_something # end # RUBY # # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#34 class RuboCop::Cop::Style::EvalWithLocation < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#42 def eval_without_location?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#58 def line_with_offset?(param0 = T.unsafe(nil), param1, param2); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#65 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#136 def add_offense_for_different_line(_node, line_node, line_diff); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#127 def add_offense_for_same_line(_node, line_node); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#98 def message_incorrect_line(actual, sign, line_diff); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#108 def on_with_lineno(node, code); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#77 def special_file_keyword?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#82 def special_line_keyword?(node); end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#119 def string_first_line(str_node); end # FIXME: It's a Style/ConditionalAssignment's false positive. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#89 def with_lineno?(node); end end # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#35 RuboCop::Cop::Style::EvalWithLocation::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#37 RuboCop::Cop::Style::EvalWithLocation::MSG_INCORRECT_LINE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/eval_with_location.rb#40 RuboCop::Cop::Style::EvalWithLocation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for places where `Integer#even?` or `Integer#odd?` # can be used. # # @example # # # bad # if x % 2 == 0 # end # # # good # if x.even? # end # # source://rubocop//lib/rubocop/cop/style/even_odd.rb#18 class RuboCop::Cop::Style::EvenOdd < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/even_odd.rb#24 def even_odd_candidate?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/even_odd.rb#32 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/even_odd.rb#44 def replacement_method(arg, method); end end # source://rubocop//lib/rubocop/cop/style/even_odd.rb#21 RuboCop::Cop::Style::EvenOdd::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/even_odd.rb#22 RuboCop::Cop::Style::EvenOdd::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for use of the `File.expand_path` arguments. # Likewise, it also checks for the `Pathname.new` argument. # # Contrastive bad case and good case are alternately shown in # the following examples. # # @example # # bad # File.expand_path('..', __FILE__) # # # good # File.expand_path(__dir__) # # # bad # File.expand_path('../..', __FILE__) # # # good # File.expand_path('..', __dir__) # # # bad # File.expand_path('.', __FILE__) # # # good # File.expand_path(__FILE__) # # # bad # Pathname(__FILE__).parent.expand_path # # # good # Pathname(__dir__).expand_path # # # bad # Pathname.new(__FILE__).parent.expand_path # # # good # Pathname.new(__dir__).expand_path # # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#43 class RuboCop::Cop::Style::ExpandPathArguments < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#57 def file_expand_path(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#79 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#71 def pathname_new_parent_expand_path(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#64 def pathname_parent_expand_path(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#188 def arguments_range(node); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#99 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#134 def autocorrect_expand_path(corrector, current_path, default_dir); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#161 def depth(current_path); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#112 def inspect_offense_for_expand_path(node, current_path, default_dir); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#167 def parent_path(current_path); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#181 def remove_parent_method(corrector, default_dir); end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#154 def strip_surrounded_quotes!(path_string); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#108 def unrecommended_argument?(default_dir); end end # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#47 RuboCop::Cop::Style::ExpandPathArguments::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#49 RuboCop::Cop::Style::ExpandPathArguments::PATHNAME_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#51 RuboCop::Cop::Style::ExpandPathArguments::PATHNAME_NEW_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/expand_path_arguments.rb#55 RuboCop::Cop::Style::ExpandPathArguments::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop enforces the use of explicit block argument to avoid writing # block literal that just passes its arguments to another block. # # @example # # bad # def with_tmp_dir # Dir.mktmpdir do |tmp_dir| # Dir.chdir(tmp_dir) { |dir| yield dir } # block just passes arguments # end # end # # # bad # def nine_times # 9.times { yield } # end # # # good # def with_tmp_dir(&block) # Dir.mktmpdir do |tmp_dir| # Dir.chdir(tmp_dir, &block) # end # end # # with_tmp_dir do |dir| # puts "dir is accessible as a parameter and pwd is set: #{dir}" # end # # # good # def nine_times(&block) # 9.times(&block) # end # # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#38 class RuboCop::Cop::Style::ExplicitBlockArgument < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # @return [ExplicitBlockArgument] a new instance of ExplicitBlockArgument # # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#49 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#54 def on_yield(node); end # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#45 def yielding_block?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#83 def add_block_argument(node, corrector); end # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#97 def block_body_range(block_node, send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#77 def yielding_arguments?(block_args, yield_args); end end # source://rubocop//lib/rubocop/cop/style/explicit_block_argument.rb#42 RuboCop::Cop::Style::ExplicitBlockArgument::MSG = T.let(T.unsafe(nil), String) # This cop enforces consistency when using exponential notation # for numbers in the code (eg 1.2e4). Different styles are supported: # * `scientific` which enforces a mantissa between 1 (inclusive) # and 10 (exclusive). # * `engineering` which enforces the exponent to be a multiple of 3 # and the mantissa to be between 0.1 (inclusive) # and 10 (exclusive). # * `integral` which enforces the mantissa to always be a whole number # without trailing zeroes. # # @example EnforcedStyle: scientific (default) # # Enforces a mantissa between 1 (inclusive) and 10 (exclusive). # # # bad # 10e6 # 0.3e4 # 11.7e5 # 3.14e0 # # # good # 1e7 # 3e3 # 1.17e6 # 3.14 # @example EnforcedStyle: engineering # # Enforces using multiple of 3 exponents, # # mantissa should be between 0.1 (inclusive) and 1000 (exclusive) # # # bad # 3.2e7 # 0.1e5 # 12e5 # 1232e6 # # # good # 32e6 # 10e3 # 1.2e6 # 1.232e9 # @example EnforcedStyle: integral # # Enforces the mantissa to have no decimal part and no # # trailing zeroes. # # # bad # 3.2e7 # 0.1e5 # 120e4 # # # good # 32e6 # 1e4 # 12e5 # # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#61 class RuboCop::Cop::Style::ExponentialNotation < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#69 def on_float(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#80 def engineering?(node); end # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#91 def integral(node); end # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#111 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#96 def offense?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#75 def scientific?(node); end end # source://rubocop//lib/rubocop/cop/style/exponential_notation.rb#63 RuboCop::Cop::Style::ExponentialNotation::MESSAGES = T.let(T.unsafe(nil), Hash) # This cop checks for division with integers coerced to floats. # It is recommended to either always use `fdiv` or coerce one side only. # This cop also provides other options for code consistency. # # @example EnforcedStyle: single_coerce (default) # # bad # a.to_f / b.to_f # # # good # a.to_f / b # a / b.to_f # @example EnforcedStyle: left_coerce # # bad # a / b.to_f # a.to_f / b.to_f # # # good # a.to_f / b # @example EnforcedStyle: right_coerce # # bad # a.to_f / b # a.to_f / b.to_f # # # good # a / b.to_f # @example EnforcedStyle: fdiv # # bad # a / b.to_f # a.to_f / b # a.to_f / b.to_f # # # good # a.fdiv(b) # # source://rubocop//lib/rubocop/cop/style/float_division.rb#42 class RuboCop::Cop::Style::FloatDivision < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/style/float_division.rb#62 def any_coerce?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/float_division.rb#59 def both_coerce?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/float_division.rb#56 def left_coerce?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/float_division.rb#66 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/float_division.rb#53 def right_coerce?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/float_division.rb#87 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/float_division.rb#72 def offense_condition?(node); end end # source://rubocop//lib/rubocop/cop/style/float_division.rb#44 RuboCop::Cop::Style::FloatDivision::MESSAGES = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/style/float_division.rb#51 RuboCop::Cop::Style::FloatDivision::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop looks for uses of the `for` keyword or `each` method. The # preferred alternative is set in the EnforcedStyle configuration # parameter. An `each` call with a block on a single line is always # allowed. # # @example EnforcedStyle: each (default) # # bad # def foo # for n in [1, 2, 3] do # puts n # end # end # # # good # def foo # [1, 2, 3].each do |n| # puts n # end # end # @example EnforcedStyle: for # # bad # def foo # [1, 2, 3].each do |n| # puts n # end # end # # # good # def foo # for n in [1, 2, 3] do # puts n # end # end # # source://rubocop//lib/rubocop/cop/style/for.rb#41 class RuboCop::Cop::Style::For < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/for.rb#60 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/for.rb#50 def on_for(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/for.rb#74 def suspect_enumerable?(node); end end # source://rubocop//lib/rubocop/cop/style/for.rb#46 RuboCop::Cop::Style::For::EACH_LENGTH = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cop/style/for.rb#47 RuboCop::Cop::Style::For::PREFER_EACH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/for.rb#48 RuboCop::Cop::Style::For::PREFER_FOR = T.let(T.unsafe(nil), String) # This cop enforces the use of a single string formatting utility. # Valid options include Kernel#format, Kernel#sprintf and String#%. # # The detection of String#% cannot be implemented in a reliable # manner for all cases, so only two scenarios are considered - # if the first argument is a string literal and if the second # argument is an array literal. # # @example EnforcedStyle: format (default) # # bad # puts sprintf('%10s', 'hoge') # puts '%10s' % 'hoge' # # # good # puts format('%10s', 'hoge') # @example EnforcedStyle: sprintf # # bad # puts format('%10s', 'hoge') # puts '%10s' % 'hoge' # # # good # puts sprintf('%10s', 'hoge') # @example EnforcedStyle: percent # # bad # puts format('%10s', 'hoge') # puts sprintf('%10s', 'hoge') # # # good # puts '%10s' % 'hoge' # # source://rubocop//lib/rubocop/cop/style/format_string.rb#38 class RuboCop::Cop::Style::FormatString < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/format_string.rb#45 def formatter(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/format_string.rb#57 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/format_string.rb#53 def variable_argument?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/format_string.rb#79 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/format_string.rb#95 def autocorrect_from_percent(corrector, node); end # source://rubocop//lib/rubocop/cop/style/format_string.rb#109 def autocorrect_to_percent(corrector, node); end # source://rubocop//lib/rubocop/cop/style/format_string.rb#71 def message(detected_style); end # source://rubocop//lib/rubocop/cop/style/format_string.rb#75 def method_name(style_name); end end # source://rubocop//lib/rubocop/cop/style/format_string.rb#42 RuboCop::Cop::Style::FormatString::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/format_string.rb#43 RuboCop::Cop::Style::FormatString::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Use a consistent style for named format string tokens. # # NOTE: `unannotated` style cop only works for strings # which are passed as arguments to those methods: # `printf`, `sprintf`, `format`, `%`. # The reason is that _unannotated_ format is very similar # to encoded URLs or Date/Time formatting strings. # # @example EnforcedStyle: annotated (default) # # # bad # format('%{greeting}', greeting: 'Hello') # format('%s', 'Hello') # # # good # format('%s', greeting: 'Hello') # @example EnforcedStyle: template # # # bad # format('%s', greeting: 'Hello') # format('%s', 'Hello') # # # good # format('%{greeting}', greeting: 'Hello') # @example EnforcedStyle: unannotated # # # bad # format('%s', greeting: 'Hello') # format('%{greeting}', greeting: 'Hello') # # # good # format('%s', 'Hello') # # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#40 class RuboCop::Cop::Style::FormatStringToken < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#59 def format_string_in_typical_context?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#43 def on_str(node); end private # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#70 def message(detected_style); end # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#75 def message_text(style); end # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#90 def str_contents(source_map); end # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#100 def token_ranges(contents); end # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#84 def tokens(str_node, &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/format_string_token.rb#66 def unannotated_format?(node, detected_style); end end # This cop is designed to help you transition from mutable string literals # to frozen string literals. # files to enable frozen string literals. Frozen string literals may be # default in future Ruby. The comment will be added below a shebang and # encoding comment. # # Note that the cop will ignore files where the comment exists but is set # to `false` instead of `true`. # # @example EnforcedStyle: always (default) # # The `always` style will always add the frozen string literal comment # # to a file, regardless of the Ruby version or if `freeze` or `<<` are # # called on a string literal. # # bad # module Bar # # ... # end # # # good # # frozen_string_literal: true # # module Bar # # ... # end # # # good # # frozen_string_literal: false # # module Bar # # ... # end # @example EnforcedStyle: never # # The `never` will enforce that the frozen string literal comment does # # not exist in a file. # # bad # # frozen_string_literal: true # # module Baz # # ... # end # # # good # module Baz # # ... # end # @example EnforcedStyle: always_true # # The `always_true` style enforces that the frozen string literal # # comment is set to `true`. This is a stricter option than `always` # # and forces projects to use frozen string literals. # # bad # # frozen_string_literal: false # # module Baz # # ... # end # # # bad # module Baz # # ... # end # # # good # # frozen_string_literal: true # # module Bar # # ... # end # # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#76 class RuboCop::Cop::Style::FrozenStringLiteralComment < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#89 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#170 def disabled_offense(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#182 def enable_comment(corrector); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#110 def ensure_comment(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#116 def ensure_enabled_comment(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#104 def ensure_no_comment(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#206 def following_comment; end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#140 def frozen_string_literal_comment(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#188 def insert_comment(corrector); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#127 def last_special_comment(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#198 def line_range(line); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#146 def missing_offense(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#154 def missing_true_offense(processed_source); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#202 def preceding_comment; end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#178 def remove_comment(corrector, node); end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#162 def unnecessary_comment_offense(processed_source); end end # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#86 RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_DISABLED = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#84 RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_MISSING = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#82 RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_MISSING_TRUE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#85 RuboCop::Cop::Style::FrozenStringLiteralComment::MSG_UNNECESSARY = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/frozen_string_literal_comment.rb#87 RuboCop::Cop::Style::FrozenStringLiteralComment::SHEBANG = T.let(T.unsafe(nil), String) # This cop enforces the use of `$stdout/$stderr/$stdin` instead of `STDOUT/STDERR/STDIN`. # `STDOUT/STDERR/STDIN` are constants, and while you can actually # reassign (possibly to redirect some stream) constants in Ruby, you'll get # an interpreter warning if you do so. # # @example # # bad # STDOUT.puts('hello') # # hash = { out: STDOUT, key: value } # # def m(out = STDOUT) # out.puts('hello') # end # # # good # $stdout.puts('hello') # # hash = { out: $stdout, key: value } # # def m(out = $stdout) # out.puts('hello') # end # # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#30 class RuboCop::Cop::Style::GlobalStdStream < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#37 def const_to_gvar_assignment?(param0 = T.unsafe(nil), param1); end # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#41 def on_const(node); end private # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#59 def gvar_name(const_name); end # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#55 def message(const_name); end end # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#33 RuboCop::Cop::Style::GlobalStdStream::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/global_std_stream.rb#35 RuboCop::Cop::Style::GlobalStdStream::STD_STREAMS = T.let(T.unsafe(nil), Set) # This cop looks for uses of global variables. # It does not report offenses for built-in global variables. # Built-in global variables are allowed by default. Additionally # users can allow additional variables via the AllowedVariables option. # # Note that backreferences like $1, $2, etc are not global variables. # # @example # # bad # $foo = 2 # bar = $foo + 5 # # # good # FOO = 2 # foo = 2 # $stdin.read # # source://rubocop//lib/rubocop/cop/style/global_vars.rb#22 class RuboCop::Cop::Style::GlobalVars < ::RuboCop::Cop::Base # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/global_vars.rb#60 def allowed_var?(global_var); end # source://rubocop//lib/rubocop/cop/style/global_vars.rb#72 def check(node); end # source://rubocop//lib/rubocop/cop/style/global_vars.rb#64 def on_gvar(node); end # source://rubocop//lib/rubocop/cop/style/global_vars.rb#68 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/style/global_vars.rb#56 def user_vars; end end # built-in global variables and their English aliases # https://www.zenspider.com/ruby/quickref.html # # source://rubocop//lib/rubocop/cop/style/global_vars.rb#27 RuboCop::Cop::Style::GlobalVars::BUILT_IN_VARS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/global_vars.rb#23 RuboCop::Cop::Style::GlobalVars::MSG = T.let(T.unsafe(nil), String) # Use a guard clause instead of wrapping the code inside a conditional # expression # # @example # # bad # def test # if something # work # end # end # # # good # def test # return unless something # # work # end # # # also good # def test # work if something # end # # # bad # if something # raise 'exception' # else # ok # end # # # good # raise 'exception' if something # ok # # # bad # if something # foo || raise('exception') # else # ok # end # # # good # foo || raise('exception') if something # ok # # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#50 class RuboCop::Cop::Style::GuardClause < ::RuboCop::Cop::Base include ::RuboCop::Cop::MinBodyLength include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#57 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#57 def on_defs(node); end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#71 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#128 def accepted_form?(node, ending: T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#133 def accepted_if?(node, ending); end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#90 def check_ending_if(node); end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#113 def guard_clause_source(guard_clause); end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#96 def opposite_keyword(node); end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#100 def register_offense(node, scope_exiting_keyword, conditional_keyword); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#123 def too_long_for_single_line?(node, example); end end # source://rubocop//lib/rubocop/cop/style/guard_clause.rb#54 RuboCop::Cop::Style::GuardClause::MSG = T.let(T.unsafe(nil), String) # Checks for presence or absence of braces around hash literal as a last # array item depending on configuration. # # NOTE: This cop will ignore arrays where all items are hashes, regardless of # EnforcedStyle. # # @example EnforcedStyle: braces (default) # # bad # [1, 2, one: 1, two: 2] # # # good # [1, 2, { one: 1, two: 2 }] # # # good # [{ one: 1 }, { two: 2 }] # @example EnforcedStyle: no_braces # # bad # [1, 2, { one: 1, two: 2 }] # # # good # [1, 2, one: 1, two: 2] # # # good # [{ one: 1 }, { two: 2 }] # # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#31 class RuboCop::Cop::Style::HashAsLastArrayItem < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#35 def on_hash(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#82 def braces_style?; end # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#64 def check_braces(node); end # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#72 def check_no_braces(node); end # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#48 def containing_array(hash_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#59 def explicit_array?(array); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_as_last_array_item.rb#53 def last_array_item?(array, node); end end # This cop checks for uses of `each_key` and `each_value` Hash methods. # # NOTE: If you have an array of two-element arrays, you can put # parentheses around the block arguments to indicate that you're not # working with a hash, and suppress RuboCop offenses. # # @example # # bad # hash.keys.each { |k| p k } # hash.values.each { |v| p v } # # # good # hash.each_key { |k| p k } # hash.each_value { |v| p v } # # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#20 class RuboCop::Cop::Style::HashEachMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::Lint::UnusedArgument extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#26 def kv_each(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#30 def on_block(node); end private # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#49 def check_argument(variable); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#73 def correct_args(node, corrector); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#59 def correct_implicit(node, corrector, method_name); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#64 def correct_key_value_each(node, corrector); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#80 def kv_range(outer_node); end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#36 def register_kv_offense(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#55 def used?(arg); end end # source://rubocop//lib/rubocop/cop/style/hash_each_methods.rb#24 RuboCop::Cop::Style::HashEachMethods::MSG = T.let(T.unsafe(nil), String) # This cop checks for places where `case-when` represents a simple 1:1 # mapping and can be replaced with a hash lookup. # # @example MinBranchesCount: 3 (default) # # bad # case country # when 'europe' # 'http://eu.example.com' # when 'america' # 'http://us.example.com' # when 'australia' # 'http://au.example.com' # end # # # good # SITES = { # 'europe' => 'http://eu.example.com', # 'america' => 'http://us.example.com', # 'australia' => 'http://au.example.com' # } # SITES[country] # @example MinBranchesCount: 4 # # good # case country # when 'europe' # 'http://eu.example.com' # when 'america' # 'http://us.example.com' # when 'australia' # 'http://au.example.com' # end # # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#39 class RuboCop::Cop::Style::HashLikeCase < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#42 def hash_like_case?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#50 def on_case(node); end private # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#67 def min_branches_count; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#63 def nodes_of_same_type?(nodes); end end # source://rubocop//lib/rubocop/cop/style/hash_like_case.rb#40 RuboCop::Cop::Style::HashLikeCase::MSG = T.let(T.unsafe(nil), String) # This cop checks hash literal syntax. # # It can enforce either the use of the class hash rocket syntax or # the use of the newer Ruby 1.9 syntax (when applicable). # # A separate offense is registered for each problematic pair. # # The supported styles are: # # * ruby19 - forces use of the 1.9 syntax (e.g. `{a: 1}`) when hashes have # all symbols for keys # * hash_rockets - forces use of hash rockets for all hashes # * no_mixed_keys - simply checks for hashes with mixed syntaxes # * ruby19_no_mixed_keys - forces use of ruby 1.9 syntax and forbids mixed # syntax hashes # # @example EnforcedStyle: ruby19 (default) # # bad # {:a => 2} # {b: 1, :c => 2} # # # good # {a: 2, b: 1} # {:c => 2, 'd' => 2} # acceptable since 'd' isn't a symbol # {d: 1, 'e' => 2} # technically not forbidden # @example EnforcedStyle: hash_rockets # # bad # {a: 1, b: 2} # {c: 1, 'd' => 5} # # # good # {:a => 1, :b => 2} # @example EnforcedStyle: no_mixed_keys # # bad # {:a => 1, b: 2} # {c: 1, 'd' => 2} # # # good # {:a => 1, :b => 2} # {c: 1, d: 2} # @example EnforcedStyle: ruby19_no_mixed_keys # # bad # {:a => 1, :b => 2} # {c: 2, 'd' => 3} # should just use hash rockets # # # good # {a: 1, b: 2} # {:c => 3, 'd' => 4} # # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#57 class RuboCop::Cop::Style::HashSyntax < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#119 def alternative_style; end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#107 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#85 def hash_rockets_check(pairs); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#99 def no_mixed_keys_check(pairs); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#65 def on_hash(node); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#81 def ruby19_check(pairs); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#89 def ruby19_no_mixed_keys_check(pairs); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#140 def acceptable_19_syntax_symbol?(sym_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#195 def argument_without_space?(node); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#200 def autocorrect_hash_rockets(corrector, pair_node); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#208 def autocorrect_no_mixed_keys(corrector, pair_node); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#171 def autocorrect_ruby19(corrector, pair_node); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#158 def check(pairs, delim, msg); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#216 def force_hash_rockets?(pairs); end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#187 def range_for_autocorrect_ruby19(pair_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#130 def sym_indices?(pairs); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#134 def word_symbol_pair?(pair); end end # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#61 RuboCop::Cop::Style::HashSyntax::MSG_19 = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#63 RuboCop::Cop::Style::HashSyntax::MSG_HASH_ROCKETS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/hash_syntax.rb#62 RuboCop::Cop::Style::HashSyntax::MSG_NO_MIXED_KEYS = T.let(T.unsafe(nil), String) # This cop looks for uses of `_.each_with_object({}) {...}`, # `_.map {...}.to_h`, and `Hash[_.map {...}]` that are actually just # transforming the keys of a hash, and tries to use a simpler & faster # call to `transform_keys` instead. # # This can produce false positives if we are transforming an enumerable # of key-value-like pairs that isn't actually a hash, e.g.: # `[[k1, v1], [k2, v2], ...]` # # This cop should only be enabled on Ruby version 2.5 or newer # (`transform_keys` was added in Ruby 2.5.) # # @example # # bad # {a: 1, b: 2}.each_with_object({}) { |(k, v), h| h[foo(k)] = v } # Hash[{a: 1, b: 2}.collect { |k, v| [foo(k), v] }] # {a: 1, b: 2}.map { |k, v| [k.to_s, v] }.to_h # {a: 1, b: 2}.to_h { |k, v| [k.to_s, v] } # # # good # {a: 1, b: 2}.transform_keys { |k| foo(k) } # {a: 1, b: 2}.transform_keys { |k| k.to_s } # # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#28 class RuboCop::Cop::Style::HashTransformKeys < ::RuboCop::Cop::Base include ::RuboCop::Cop::HashTransformMethod extend ::RuboCop::Cop::TargetRubyVersion extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#35 def on_bad_each_with_object(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#46 def on_bad_hash_brackets_map(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#58 def on_bad_map_to_h(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#69 def on_bad_to_h(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#80 def extract_captures(match); end # source://rubocop//lib/rubocop/cop/style/hash_transform_keys.rb#85 def new_method_name; end end # This cop looks for uses of `_.each_with_object({}) {...}`, # `_.map {...}.to_h`, and `Hash[_.map {...}]` that are actually just # transforming the values of a hash, and tries to use a simpler & faster # call to `transform_values` instead. # # This can produce false positives if we are transforming an enumerable # of key-value-like pairs that isn't actually a hash, e.g.: # `[[k1, v1], [k2, v2], ...]` # # This cop should only be enabled on Ruby version 2.4 or newer # (`transform_values` was added in Ruby 2.4.) # # @example # # bad # {a: 1, b: 2}.each_with_object({}) { |(k, v), h| h[k] = foo(v) } # Hash[{a: 1, b: 2}.collect { |k, v| [k, foo(v)] }] # {a: 1, b: 2}.map { |k, v| [k, v * v] }.to_h # {a: 1, b: 2}.to_h { |k, v| [k, v * v] } # # # good # {a: 1, b: 2}.transform_values { |v| foo(v) } # {a: 1, b: 2}.transform_values { |v| v * v } # # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#28 class RuboCop::Cop::Style::HashTransformValues < ::RuboCop::Cop::Base include ::RuboCop::Cop::HashTransformMethod extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#32 def on_bad_each_with_object(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#43 def on_bad_hash_brackets_map(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#55 def on_bad_map_to_h(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#66 def on_bad_to_h(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#77 def extract_captures(match); end # source://rubocop//lib/rubocop/cop/style/hash_transform_values.rb#82 def new_method_name; end end # This cop checks for identical lines at the beginning or end of # each branch of a conditional statement. # # @example # # bad # if condition # do_x # do_z # else # do_y # do_z # end # # # good # if condition # do_x # else # do_y # end # do_z # # # bad # if condition # do_z # do_x # else # do_z # do_y # end # # # good # do_z # if condition # do_x # else # do_y # end # # # bad # case foo # when 1 # do_x # when 2 # do_x # else # do_x # end # # # good # case foo # when 1 # do_x # do_y # when 2 # # nothing # else # do_x # do_z # end # # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#65 class RuboCop::Cop::Style::IdenticalConditionalBranches < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#75 def on_case(node); end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#68 def on_if(node); end private # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#84 def check_branches(branches); end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#95 def check_expressions(expressions); end # `elsif` branches show up in the if node as nested `else` branches. We # need to recursively iterate over all `else` branches. # # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#109 def expand_elses(branch); end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#124 def head(node); end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#103 def message(node); end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#120 def tail(node); end end # source://rubocop//lib/rubocop/cop/style/identical_conditional_branches.rb#66 RuboCop::Cop::Style::IdenticalConditionalBranches::MSG = T.let(T.unsafe(nil), String) # Corrector to correct conditional assignment in `if` statements. # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#564 class RuboCop::Cop::Style::IfCorrector extend ::RuboCop::Cop::Style::ConditionalAssignmentHelper extend ::RuboCop::Cop::Style::ConditionalCorrectorHelper class << self # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#569 def correct(corrector, cop, node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#573 def move_assignment_inside_condition(corrector, node); end private # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#587 def extract_tail_branches(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#594 def move_branch_inside_condition(corrector, branch, condition, assignment, column); end end end # If the `else` branch of a conditional consists solely of an `if` node, # it can be combined with the `else` to become an `elsif`. # This helps to keep the nesting level from getting too deep. # # @example # # bad # if condition_a # action_a # else # if condition_b # action_b # else # action_c # end # end # # # good # if condition_a # action_a # elsif condition_b # action_b # else # action_c # end # @example AllowIfModifier: false (default) # # bad # if condition_a # action_a # else # action_b if condition_b # end # # # good # if condition_a # action_a # elsif condition_b # action_b # end # @example AllowIfModifier: true # # good # if condition_a # action_a # else # action_b if condition_b # end # # # good # if condition_a # action_a # elsif condition_b # action_b # end # # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#61 class RuboCop::Cop::Style::IfInsideElse < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#64 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#81 def allow_if_modifier?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#77 def allow_if_modifier_in_else_branch?(else_branch); end end # source://rubocop//lib/rubocop/cop/style/if_inside_else.rb#62 RuboCop::Cop::Style::IfInsideElse::MSG = T.let(T.unsafe(nil), String) # Checks for `if` and `unless` statements that would fit on one line if # written as modifier `if`/`unless`. The cop also checks for modifier # `if`/`unless` lines that exceed the maximum line length. # # The maximum line length is configured in the `Layout/LineLength` # cop. The tab size is configured in the `IndentationWidth` of the # `Layout/IndentationStyle` cop. # # @example # # bad # if condition # do_stuff(bar) # end # # unless qux.empty? # Foo.do_something # end # # do_something_in_a_method_with_a_long_name(arg) if long_condition # # # good # do_stuff(bar) if condition # Foo.do_something unless qux.empty? # # if long_condition # do_something_in_a_method_with_a_long_name(arg) # end # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#33 class RuboCop::Cop::Style::IfUnlessModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier include ::RuboCop::Cop::IgnoredPattern extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#45 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#137 def another_statement_on_same_line?(node); end # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#60 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#74 def ignored_patterns; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#117 def line_length_enabled_at_line?(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#122 def named_capture_in_condition?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#126 def non_eligible_node?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#133 def non_simple_if_unless?(node); end # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#152 def to_normal_form(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#69 def too_long_due_to_modifier?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#108 def too_long_line_based_on_allow_uri?(line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#91 def too_long_line_based_on_config?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#100 def too_long_line_based_on_ignore_cop_directives?(range, line); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#78 def too_long_single_line?(node); end end # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#39 RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_MODIFIER = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/if_unless_modifier.rb#42 RuboCop::Cop::Style::IfUnlessModifier::MSG_USE_NORMAL = T.let(T.unsafe(nil), String) # Checks for if and unless statements used as modifiers of other if or # unless statements. # # @example # # # bad # tired? ? 'stop' : 'go faster' if running? # # # bad # if tired? # "please stop" # else # "keep going" # end if running? # # # good # if running? # tired? ? 'stop' : 'go faster' # end # # source://rubocop//lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb#25 class RuboCop::Cop::Style::IfUnlessModifierOfIfUnless < ::RuboCop::Cop::Base include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb#31 def on_if(node); end end # source://rubocop//lib/rubocop/cop/style/if_unless_modifier_of_if_unless.rb#29 RuboCop::Cop::Style::IfUnlessModifierOfIfUnless::MSG = T.let(T.unsafe(nil), String) # Checks for uses of semicolon in if statements. # # @example # # # bad # result = if some_condition; something else another_thing end # # # good # result = some_condition ? something : another_thing # # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#16 class RuboCop::Cop::Style::IfWithSemicolon < ::RuboCop::Cop::Base include ::RuboCop::Cop::OnNormalIfUnless extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#22 def on_normal_if_unless(node); end private # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#35 def correct_to_ternary(node); end end # source://rubocop//lib/rubocop/cop/style/if_with_semicolon.rb#20 RuboCop::Cop::Style::IfWithSemicolon::MSG = T.let(T.unsafe(nil), String) # This cop checks for `raise` or `fail` statements which do not specify an # explicit exception class. (This raises a `RuntimeError`. Some projects # might prefer to use exception classes which more precisely identify the # nature of the error.) # # @example # # bad # raise 'Error message here' # # # good # raise ArgumentError, 'Error message here' # # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#17 class RuboCop::Cop::Style::ImplicitRuntimeError < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#22 def implicit_runtime_error_raise_or_fail(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#25 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#18 RuboCop::Cop::Style::ImplicitRuntimeError::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/implicit_runtime_error.rb#20 RuboCop::Cop::Style::ImplicitRuntimeError::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Use `Kernel#loop` for infinite loops. # # @example # # bad # while true # work # end # # # good # loop do # work # end # # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#18 class RuboCop::Cop::Style::InfiniteLoop < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#29 def after_leaving_scope(scope, _variable_table); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#38 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#38 def on_until_post(node); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#34 def on_while(node); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#34 def on_while_post(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#80 def assigned_before_loop?(var, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#76 def assigned_inside_loop?(var, range); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#66 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#122 def configured_indent; end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#99 def modifier_replacement(node); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#111 def non_modifier_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#85 def referenced_after_loop?(var, range); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#90 def replace_begin_end_with_modifier(corrector, node); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#95 def replace_source(corrector, range, replacement); end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#47 def while_or_until(node); end class << self # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#25 def joining_forces; end end end # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#21 RuboCop::Cop::Style::InfiniteLoop::LEADING_SPACE = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/infinite_loop.rb#23 RuboCop::Cop::Style::InfiniteLoop::MSG = T.let(T.unsafe(nil), String) # This cop checks for trailing inline comments. # # @example # # # good # foo.each do |f| # # Standalone comment # f.bar # end # # # bad # foo.each do |f| # f.bar # Trailing inline comment # end # # source://rubocop//lib/rubocop/cop/style/inline_comment.rb#20 class RuboCop::Cop::Style::InlineComment < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/inline_comment.rb#23 def on_new_investigation; end end # source://rubocop//lib/rubocop/cop/style/inline_comment.rb#21 RuboCop::Cop::Style::InlineComment::MSG = T.let(T.unsafe(nil), String) # This cop check for usages of not (`not` or `!`) called on a method # when an inverse of that method can be used instead. # Methods that can be inverted by a not (`not` or `!`) should be defined # in `InverseMethods` # Methods that are inverted by inverting the return # of the block that is passed to the method should be defined in # `InverseBlocks` # # @example # # bad # !foo.none? # !foo.any? { |f| f.even? } # !foo.blank? # !(foo == bar) # foo.select { |f| !f.even? } # foo.reject { |f| f != 7 } # # # good # foo.none? # foo.blank? # foo.any? { |f| f.even? } # foo != bar # foo == bar # !!('foo' =~ /^\w+$/) # !(foo.class < Numeric) # Checking class hierarchy is allowed # # Blocks with guard clauses are ignored: # foo.select do |f| # next if f.zero? # f != 1 # end # # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#36 class RuboCop::Cop::Style::InverseMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#59 def inverse_block?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#51 def inverse_candidate?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#80 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#67 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#166 def camel_case_constant?(node); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#107 def correct_inverse_block(corrector, node); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#98 def correct_inverse_method(corrector, node); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#114 def correct_inverse_selector(block, corrector); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#170 def dot_range(loc); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#151 def end_parentheses(node, method_call); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#136 def inverse_blocks; end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#131 def inverse_methods; end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#181 def message(method, inverse); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#141 def negated?(node); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#145 def not_to_receiver(node, method_call); end # When comparing classes, `!(Integer < Numeric)` is not the same as # `Integer > Numeric`. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#159 def possible_class_hierarchy_check?(lhs, rhs, method); end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#174 def remove_end_parenthesis(corrector, node, method, method_call); end class << self # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#47 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#45 RuboCop::Cop::Style::InverseMethods::CAMEL_CASE = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#42 RuboCop::Cop::Style::InverseMethods::CLASS_COMPARISON_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#43 RuboCop::Cop::Style::InverseMethods::EQUALITY_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#41 RuboCop::Cop::Style::InverseMethods::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/inverse_methods.rb#44 RuboCop::Cop::Style::InverseMethods::NEGATED_EQUALITY_METHODS = T.let(T.unsafe(nil), Array) # This cop checks for hardcoded IP addresses, which can make code # brittle. IP addresses are likely to need to be changed when code # is deployed to a different server or environment, which may break # a deployment if forgotten. Prefer setting IP addresses in ENV or # other configuration. # # @example # # # bad # ip_address = '127.59.241.29' # # # good # ip_address = ENV['DEPLOYMENT_IP_ADDRESS'] # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#21 class RuboCop::Cop::Style::IpAddresses < ::RuboCop::Cop::Cop include ::RuboCop::Cop::StringHelp # Dummy implementation of method in ConfigurableEnforcedStyle that is # called from StringHelp. # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#46 def correct_style_detected; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#27 def offense?(node); end # Dummy implementation of method in ConfigurableEnforcedStyle that is # called from StringHelp. # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#42 def opposite_style_detected; end private # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#50 def allowed_addresses; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#55 def could_be_ip?(str); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#68 def starts_with_hex_or_colon?(str); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#64 def too_long?(str); end end # IPv4-mapped IPv6 is the longest # # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#24 RuboCop::Cop::Style::IpAddresses::IPV6_MAX_SIZE = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/cop/style/ip_addresses.rb#25 RuboCop::Cop::Style::IpAddresses::MSG = T.let(T.unsafe(nil), String) # This cop enforces that optional keyword parameters are placed at the # end of the parameters list. # # This improves readability, because when looking through the source, # it is expected to find required parameters at the beginning of parameters list # and optional parameters at the end. # # @example # # bad # def some_method(first: false, second:, third: 10) # # body omitted # end # # # good # def some_method(second:, first: false, third: 10) # # body omitted # end # # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#24 class RuboCop::Cop::Style::KeywordParametersOrder < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#30 def on_kwoptarg(node); end private # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#44 def remove_kwargs(kwarg_nodes, corrector); end end # source://rubocop//lib/rubocop/cop/style/keyword_parameters_order.rb#28 RuboCop::Cop::Style::KeywordParametersOrder::MSG = T.let(T.unsafe(nil), String) # This cop (by default) checks for uses of the lambda literal syntax for # single line lambdas, and the method call syntax for multiline lambdas. # It is configurable to enforce one of the styles for both single line # and multiline lambdas as well. # # @example EnforcedStyle: line_count_dependent (default) # # bad # f = lambda { |x| x } # f = ->(x) do # x # end # # # good # f = ->(x) { x } # f = lambda do |x| # x # end # @example EnforcedStyle: lambda # # bad # f = ->(x) { x } # f = ->(x) do # x # end # # # good # f = lambda { |x| x } # f = lambda do |x| # x # end # @example EnforcedStyle: literal # # bad # f = lambda { |x| x } # f = lambda do |x| # x # end # # # good # f = ->(x) { x } # f = ->(x) do # x # end # # source://rubocop//lib/rubocop/cop/style/lambda.rb#49 class RuboCop::Cop::Style::Lambda < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/lambda.rb#66 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/lambda.rb#66 def on_numblock(node); end private # source://rubocop//lib/rubocop/cop/style/lambda.rb#117 def arguments_with_whitespace(node); end # source://rubocop//lib/rubocop/cop/style/lambda.rb#106 def autocorrect_method_to_literal(corrector, node); end # source://rubocop//lib/rubocop/cop/style/lambda.rb#121 def lambda_arg_string(args); end # source://rubocop//lib/rubocop/cop/style/lambda.rb#91 def message(node, selector); end # source://rubocop//lib/rubocop/cop/style/lambda.rb#97 def message_line_modifier(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/lambda.rb#85 def offending_selector?(node, selector); end end # source://rubocop//lib/rubocop/cop/style/lambda.rb#53 RuboCop::Cop::Style::Lambda::LITERAL_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/lambda.rb#55 RuboCop::Cop::Style::Lambda::METHOD_MESSAGE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/lambda.rb#58 RuboCop::Cop::Style::Lambda::OFFENDING_SELECTORS = T.let(T.unsafe(nil), Hash) # This cop checks for use of the lambda.(args) syntax. # # @example EnforcedStyle: call (default) # # bad # lambda.(x, y) # # # good # lambda.call(x, y) # @example EnforcedStyle: braces # # bad # lambda.call(x, y) # # # good # lambda.(x, y) # # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#21 class RuboCop::Cop::Style::LambdaCall < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#39 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#27 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#70 def explicit_style?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#66 def implicit_style?; end # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#58 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#53 def offense?(node); end end # source://rubocop//lib/rubocop/cop/style/lambda_call.rb#25 RuboCop::Cop::Style::LambdaCall::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for string literal concatenation at # the end of a line. # # @example # # # bad # some_str = 'ala' + # 'bala' # # some_str = 'ala' << # 'bala' # # # good # some_str = 'ala' \ # 'bala' # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#22 class RuboCop::Cop::Style::LineEndConcatenation < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#40 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#64 def autocorrect(corrector, operator_range); end # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#48 def check_token_set(index); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#91 def eligible_next_successor?(next_successor); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#87 def eligible_operator?(operator); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#96 def eligible_predecessor?(predecessor); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#83 def eligible_successor?(successor); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#77 def eligible_token_set?(predecessor, operator, successor); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#115 def standard_string_literal?(token); end # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#100 def token_after_last_string(successor, base_index); end class << self # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#36 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#30 RuboCop::Cop::Style::LineEndConcatenation::COMPLEX_STRING_BEGIN_TOKEN = T.let(T.unsafe(nil), Symbol) # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#31 RuboCop::Cop::Style::LineEndConcatenation::COMPLEX_STRING_END_TOKEN = T.let(T.unsafe(nil), Symbol) # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#28 RuboCop::Cop::Style::LineEndConcatenation::CONCAT_TOKEN_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#32 RuboCop::Cop::Style::LineEndConcatenation::HIGH_PRECEDENCE_OP_TOKEN_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#26 RuboCop::Cop::Style::LineEndConcatenation::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#34 RuboCop::Cop::Style::LineEndConcatenation::QUOTE_DELIMITERS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/line_end_concatenation.rb#29 RuboCop::Cop::Style::LineEndConcatenation::SIMPLE_STRING_TOKEN_TYPE = T.let(T.unsafe(nil), Symbol) # This cop enforces the presence (default) or absence of parentheses in # method calls containing parameters. # # In the default style (require_parentheses), macro methods are ignored. # Additional methods can be added to the `IgnoredMethods` # or `IgnoredPatterns` list. These options are # valid only in the default style. Macros can be included by # either setting `IgnoreMacros` to false or adding specific macros to # the `IncludedMacros` list. # # Precedence of options is all follows: # # 1. `IgnoredMethods` # 2. `IgnoredPatterns` # 3. `IncludedMacros` # # eg. If a method is listed in both # `IncludedMacros` and `IgnoredMethods`, then the latter takes # precedence (that is, the method is ignored). # # In the alternative style (omit_parentheses), there are three additional # options. # # 1. `AllowParenthesesInChaining` is `false` by default. Setting it to # `true` allows the presence of parentheses in the last call during # method chaining. # # 2. `AllowParenthesesInMultilineCall` is `false` by default. Setting it # to `true` allows the presence of parentheses in multi-line method # calls. # # 3. `AllowParenthesesInCamelCaseMethod` is `false` by default. This # allows the presence of parentheses when calling a method whose name # begins with a capital letter and which has no arguments. Setting it # to `true` allows the presence of parentheses in such a method call # even with arguments. # # @example EnforcedStyle: require_parentheses (default) # # # bad # array.delete e # # # good # array.delete(e) # # # good # # Operators don't need parens # foo == bar # # # good # # Setter methods don't need parens # foo.bar = baz # # # okay with `puts` listed in `IgnoredMethods` # puts 'test' # # # okay with `^assert` listed in `IgnoredPatterns` # assert_equal 'test', x # @example EnforcedStyle: omit_parentheses # # # bad # array.delete(e) # # # good # array.delete e # # # bad # foo.enforce(strict: true) # # # good # foo.enforce strict: true # @example IgnoreMacros: true (default) # # # good # class Foo # bar :baz # end # @example IgnoreMacros: false # # # bad # class Foo # bar :baz # end # @example AllowParenthesesInMultilineCall: false (default) # # # bad # foo.enforce( # strict: true # ) # # # good # foo.enforce \ # strict: true # @example AllowParenthesesInMultilineCall: true # # # good # foo.enforce( # strict: true # ) # # # good # foo.enforce \ # strict: true # @example AllowParenthesesInChaining: false (default) # # # bad # foo().bar(1) # # # good # foo().bar 1 # @example AllowParenthesesInChaining: true # # # good # foo().bar(1) # # # good # foo().bar 1 # @example AllowParenthesesInCamelCaseMethod: false (default) # # # bad # Array(1) # # # good # Array 1 # @example AllowParenthesesInCamelCaseMethod: true # # # good # Array(1) # # # good # Array 1 # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#146 class RuboCop::Cop::Style::MethodCallWithArgsParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::IgnoredMethods include ::RuboCop::Cop::IgnoredPattern extend ::RuboCop::Cop::AutoCorrector # @return [MethodCallWithArgsParentheses] a new instance of MethodCallWithArgsParentheses # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#152 def initialize(*_arg0); end # @abstract Overridden in style modules # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#165 def autocorrect(_node); end private # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#169 def args_begin(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#178 def args_end(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses.rb#182 def args_parenthesized?(node); end end # Style omit_parentheses # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#8 module RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#11 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#11 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#11 def on_super(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#11 def on_yield(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#45 def allowed_camel_case_method_call?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#126 def allowed_chained_call_with_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#122 def allowed_multiline_call_with_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#136 def ambigious_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#166 def assigned_before?(node, target); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#109 def call_as_argument_or_chain?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#68 def call_in_literals?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#77 def call_in_logical_operators?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#85 def call_in_optional_arguments?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#90 def call_in_single_line_inheritance?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#94 def call_with_ambiguous_arguments?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#104 def call_with_braced_block?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#153 def hash_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#115 def hash_literal_in_arguments?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#58 def legitimate_call_with_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#149 def logical_operator?(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#37 def message(_range = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#33 def offense_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#51 def parentheses_at_the_end_of_multiline_call?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#157 def regexp_slash_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#141 def splat?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#41 def super_call_without_arguments?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#145 def ternary_if?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#161 def unary_literal?(node); end end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/omit_parentheses.rb#9 RuboCop::Cop::Style::MethodCallWithArgsParentheses::OmitParentheses::TRAILING_WHITESPACE_REGEX = T.let(T.unsafe(nil), Regexp) # Style require_parentheses # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#8 module RuboCop::Cop::Style::MethodCallWithArgsParentheses::RequireParentheses # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#25 def message(_node = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#9 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#9 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#9 def on_super(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#9 def on_yield(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#31 def eligible_for_parentheses_omission?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#39 def ignored_macro?(node); end # source://rubocop//lib/rubocop/cop/style/method_call_with_args_parentheses/require_parentheses.rb#35 def included_macros_list; end end # This cop checks for unwanted parentheses in parameterless method calls. # # @example # # bad # object.some_method() # # # good # object.some_method # # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#14 class RuboCop::Cop::Style::MethodCallWithoutArgsParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::IgnoredMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#21 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#47 def any_assignment?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#35 def ineligible_node?(node); end # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#70 def offense_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#39 def same_name_assignment?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#63 def variable_in_mass_assignment?(variable_name, node); end end # source://rubocop//lib/rubocop/cop/style/method_call_without_args_parentheses.rb#18 RuboCop::Cop::Style::MethodCallWithoutArgsParentheses::MSG = T.let(T.unsafe(nil), String) # This cop checks for methods called on a do...end block. The point of # this check is that it's easy to miss the call tacked on to the block # when reading code. # # @example # # bad # a do # b # end.c # # # good # a { b }.c # # # good # foo = a do # b # end # foo.c # # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#24 class RuboCop::Cop::Style::MethodCalledOnDoEndBlock < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#29 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#38 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#38 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/method_called_on_do_end_block.rb#27 RuboCop::Cop::Style::MethodCalledOnDoEndBlock::MSG = T.let(T.unsafe(nil), String) # This cop checks for parentheses around the arguments in method # definitions. Both instance and class/singleton methods are checked. # # @example EnforcedStyle: require_parentheses (default) # # The `require_parentheses` style requires method definitions # # to always use parentheses # # # bad # def bar num1, num2 # num1 + num2 # end # # def foo descriptive_var_name, # another_descriptive_var_name, # last_descriptive_var_name # do_something # end # # # good # def bar(num1, num2) # num1 + num2 # end # # def foo(descriptive_var_name, # another_descriptive_var_name, # last_descriptive_var_name) # do_something # end # @example EnforcedStyle: require_no_parentheses # # The `require_no_parentheses` style requires method definitions # # to never use parentheses # # # bad # def bar(num1, num2) # num1 + num2 # end # # def foo(descriptive_var_name, # another_descriptive_var_name, # last_descriptive_var_name) # do_something # end # # # good # def bar num1, num2 # num1 + num2 # end # # def foo descriptive_var_name, # another_descriptive_var_name, # last_descriptive_var_name # do_something # end # @example EnforcedStyle: require_no_parentheses_except_multiline # # The `require_no_parentheses_except_multiline` style prefers no # # parentheses when method definition arguments fit on single line, # # but prefers parentheses when arguments span multiple lines. # # # bad # def bar(num1, num2) # num1 + num2 # end # # def foo descriptive_var_name, # another_descriptive_var_name, # last_descriptive_var_name # do_something # end # # # good # def bar num1, num2 # num1 + num2 # end # # def foo(descriptive_var_name, # another_descriptive_var_name, # last_descriptive_var_name) # do_something # end # # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#87 class RuboCop::Cop::Style::MethodDefParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#96 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#96 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#136 def arguments_without_parentheses?(node); end # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#115 def correct_arguments(arg_node, corrector); end # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#120 def correct_definition(def_node, corrector); end # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#140 def missing_parentheses(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#130 def require_parentheses?(args); end # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#148 def unwanted_parentheses(args); end end # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#93 RuboCop::Cop::Style::MethodDefParentheses::MSG_MISSING = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/method_def_parentheses.rb#92 RuboCop::Cop::Style::MethodDefParentheses::MSG_PRESENT = T.let(T.unsafe(nil), String) # This cop checks for potential uses of `Enumerable#minmax`. # # @example # # # bad # bar = [foo.min, foo.max] # return foo.min, foo.max # # # good # bar = foo.minmax # return foo.minmax # # source://rubocop//lib/rubocop/cop/style/min_max.rb#17 class RuboCop::Cop::Style::MinMax < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/min_max.rb#37 def min_max_candidate(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/min_max.rb#22 def on_array(node); end # source://rubocop//lib/rubocop/cop/style/min_max.rb#22 def on_return(node); end private # source://rubocop//lib/rubocop/cop/style/min_max.rb#55 def argument_range(node); end # source://rubocop//lib/rubocop/cop/style/min_max.rb#41 def message(offender, receiver); end # source://rubocop//lib/rubocop/cop/style/min_max.rb#46 def offending_range(node); end end # source://rubocop//lib/rubocop/cop/style/min_max.rb#20 RuboCop::Cop::Style::MinMax::MSG = T.let(T.unsafe(nil), String) # Checks for `if` expressions that do not have an `else` branch. # # Supported styles are: if, case, both. # # @example EnforcedStyle: if # # warn when an `if` expression is missing an `else` branch. # # # bad # if condition # statement # end # # # good # if condition # statement # else # # the content of `else` branch will be determined by Style/EmptyElse # end # # # good # case var # when condition # statement # end # # # good # case var # when condition # statement # else # # the content of `else` branch will be determined by Style/EmptyElse # end # @example EnforcedStyle: case # # warn when a `case` expression is missing an `else` branch. # # # bad # case var # when condition # statement # end # # # good # case var # when condition # statement # else # # the content of `else` branch will be determined by Style/EmptyElse # end # # # good # if condition # statement # end # # # good # if condition # statement # else # # the content of `else` branch will be determined by Style/EmptyElse # end # @example EnforcedStyle: both (default) # # warn when an `if` or `case` expression is missing an `else` branch. # # # bad # if condition # statement # end # # # bad # case var # when condition # statement # end # # # good # if condition # statement # else # # the content of `else` branch will be determined by Style/EmptyElse # end # # # good # case var # when condition # statement # else # # the content of `else` branch will be determined by Style/EmptyElse # end # # source://rubocop//lib/rubocop/cop/style/missing_else.rb#96 class RuboCop::Cop::Style::MissingElse < ::RuboCop::Cop::Base include ::RuboCop::Cop::OnNormalIfUnless include ::RuboCop::Cop::ConfigurableEnforcedStyle # source://rubocop//lib/rubocop/cop/style/missing_else.rb#113 def on_case(node); end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#106 def on_normal_if_unless(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/missing_else.rb#142 def case_style?; end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#121 def check(node); end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#164 def empty_else_config; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/missing_else.rb#154 def empty_else_cop_enabled?; end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#158 def empty_else_style; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/missing_else.rb#138 def if_style?; end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#127 def message_template; end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#150 def unless_else_config; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/missing_else.rb#146 def unless_else_cop_enabled?; end end # source://rubocop//lib/rubocop/cop/style/missing_else.rb#100 RuboCop::Cop::Style::MissingElse::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/missing_else.rb#103 RuboCop::Cop::Style::MissingElse::MSG_EMPTY = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/missing_else.rb#101 RuboCop::Cop::Style::MissingElse::MSG_NIL = T.let(T.unsafe(nil), String) # This cop checks for the presence of `method_missing` without also # defining `respond_to_missing?`. # # @example # #bad # def method_missing(name, *args) # # ... # end # # #good # def respond_to_missing?(name, include_private) # # ... # end # # def method_missing(name, *args) # # ... # end # # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#24 class RuboCop::Cop::Style::MissingRespondToMissing < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#28 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#28 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#38 def implements_respond_to_missing?(node); end end # source://rubocop//lib/rubocop/cop/style/missing_respond_to_missing.rb#25 RuboCop::Cop::Style::MissingRespondToMissing::MSG = T.let(T.unsafe(nil), String) # This cop checks for grouping of mixins in `class` and `module` bodies. # By default it enforces mixins to be placed in separate declarations, # but it can be configured to enforce grouping them in one declaration. # # @example EnforcedStyle: separated (default) # # bad # class Foo # include Bar, Qox # end # # # good # class Foo # include Qox # include Bar # end # @example EnforcedStyle: grouped # # bad # class Foo # extend Bar # extend Qox # end # # # good # class Foo # extend Qox, Bar # end # # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#33 class RuboCop::Cop::Style::MixinGrouping < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#40 def on_class(node); end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#40 def on_module(node); end private # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#65 def check(send_node); end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#73 def check_grouped_style(send_node); end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#92 def check_separated_style(send_node); end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#131 def group_mixins(node, mixins); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#114 def grouped_style?; end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#139 def indent(node); end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#53 def range_to_remove_for_subsequent_mixin(mixins, node); end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#122 def separate_mixins(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#118 def separated_style?; end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#105 def sibling_mixins(send_node); end end # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#37 RuboCop::Cop::Style::MixinGrouping::MIXIN_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/mixin_grouping.rb#38 RuboCop::Cop::Style::MixinGrouping::MSG = T.let(T.unsafe(nil), String) # This cop checks that `include`, `extend` and `prepend` statements appear # inside classes and modules, not at the top level, so as to not affect # the behavior of `Object`. # # @example # # bad # include M # # class C # end # # # bad # extend M # # class C # end # # # bad # prepend M # # class C # end # # # good # class C # include M # end # # # good # class C # extend M # end # # # good # class C # prepend M # end # # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#43 class RuboCop::Cop::Style::MixinUsage < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#53 def in_top_level_scope?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#48 def include_statement(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#61 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#44 RuboCop::Cop::Style::MixinUsage::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/mixin_usage.rb#46 RuboCop::Cop::Style::MixinUsage::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for use of `extend self` or `module_function` in a # module. # # Supported styles are: module_function, extend_self, forbidden. # # In case there are private methods, the cop won't be activated. # Otherwise, it forces to change the flow of the default code. # # The option `forbidden` prohibits the usage of both styles. # # These offenses are not safe to auto-correct since there are different # implications to each approach. # # @example EnforcedStyle: module_function (default) # # bad # module Test # extend self # # ... # end # # # good # module Test # module_function # # ... # end # @example EnforcedStyle: module_function (default) # # good # module Test # extend self # # ... # private # # ... # end # @example EnforcedStyle: extend_self # # bad # module Test # module_function # # ... # end # # # good # module Test # extend self # # ... # end # @example EnforcedStyle: forbidden # # bad # module Test # module_function # # ... # end # # # bad # module Test # extend self # # ... # end # # # bad # module Test # extend self # # ... # private # # ... # end # # source://rubocop//lib/rubocop/cop/style/module_function.rb#74 class RuboCop::Cop::Style::ModuleFunction < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/module_function.rb#86 def extend_self_node?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#85 def module_function_node?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#89 def on_module(node); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#87 def private_directive?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/module_function.rb#126 def check_extend_self(nodes); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#132 def check_forbidden(nodes); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#118 def check_module_function(nodes); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#107 def each_wrong_style(nodes, &block); end # source://rubocop//lib/rubocop/cop/style/module_function.rb#139 def message(_range); end end # source://rubocop//lib/rubocop/cop/style/module_function.rb#80 RuboCop::Cop::Style::ModuleFunction::EXTEND_SELF_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/module_function.rb#82 RuboCop::Cop::Style::ModuleFunction::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/module_function.rb#78 RuboCop::Cop::Style::ModuleFunction::MODULE_FUNCTION_MSG = T.let(T.unsafe(nil), String) # This cop checks for chaining of a block after another block that spans # multiple lines. # # @example # # # bad # Thread.list.select do |t| # t.alive? # end.map do |t| # t.object_id # end # # # good # alive_threads = Thread.list.select do |t| # t.alive? # end # alive_threads.map do |t| # t.object_id # end # # source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#25 class RuboCop::Cop::Style::MultilineBlockChain < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp # source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#30 def on_block(node); end end # source://rubocop//lib/rubocop/cop/style/multiline_block_chain.rb#28 RuboCop::Cop::Style::MultilineBlockChain::MSG = T.let(T.unsafe(nil), String) # Checks for uses of if/unless modifiers with multiple-lines bodies. # # @example # # # bad # { # result: 'this should not happen' # } unless cond # # # good # { result: 'ok' } if cond # # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#17 class RuboCop::Cop::Style::MultilineIfModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier include ::RuboCop::Cop::Alignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#25 def on_if(node); end private # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#43 def configured_indentation_width; end # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#47 def indented_body(body, node); end # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#35 def to_normal_if(node); end end # source://rubocop//lib/rubocop/cop/style/multiline_if_modifier.rb#22 RuboCop::Cop::Style::MultilineIfModifier::MSG = T.let(T.unsafe(nil), String) # Checks for uses of the `then` keyword in multi-line if statements. # # @example # # bad # # This is considered bad practice. # if cond then # end # # # good # # If statements can contain `then` on the same line. # if cond then a # elsif cond then b # end # # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#19 class RuboCop::Cop::Style::MultilineIfThen < ::RuboCop::Cop::Base include ::RuboCop::Cop::OnNormalIfUnless include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#28 def on_normal_if_unless(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#38 def non_modifier_then?(node); end end # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#26 RuboCop::Cop::Style::MultilineIfThen::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/multiline_if_then.rb#24 RuboCop::Cop::Style::MultilineIfThen::NON_MODIFIER_THEN = T.let(T.unsafe(nil), Regexp) # This cop checks expressions wrapping styles for multiline memoization. # # @example EnforcedStyle: keyword (default) # # bad # foo ||= ( # bar # baz # ) # # # good # foo ||= begin # bar # baz # end # @example EnforcedStyle: braces # # bad # foo ||= begin # bar # baz # end # # # good # foo ||= ( # bar # baz # ) # # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#33 class RuboCop::Cop::Style::MultilineMemoization < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#55 def message(_node); end # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#40 def on_or_asgn(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#61 def bad_rhs?(rhs); end # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#71 def keyword_autocorrect(node, corrector); end # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#77 def keyword_begin_str(node, node_buf); end # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#86 def keyword_end_str(node, node_buf); end end # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#38 RuboCop::Cop::Style::MultilineMemoization::BRACES_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/multiline_memoization.rb#37 RuboCop::Cop::Style::MultilineMemoization::KEYWORD_MSG = T.let(T.unsafe(nil), String) # This cop checks for method signatures that span multiple lines. # # @example # # # good # # def foo(bar, baz) # end # # # bad # # def foo(bar, # baz) # end # # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#21 class RuboCop::Cop::Style::MultilineMethodSignature < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#24 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#24 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#39 def closing_line(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#43 def correction_exceeds_max_line_length?(node); end # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#51 def definition_width(node); end # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#47 def indentation_width(node); end # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#55 def max_line_length; end # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#35 def opening_line(node); end end # source://rubocop//lib/rubocop/cop/style/multiline_method_signature.rb#22 RuboCop::Cop::Style::MultilineMethodSignature::MSG = T.let(T.unsafe(nil), String) # This cop checks for multi-line ternary op expressions. # # NOTE: `return if ... else ... end` is syntax error. If `return` is used before # multiline ternary operator expression, it cannot be auto-corrected. # # @example # # bad # a = cond ? # b : c # a = cond ? b : # c # a = cond ? # b : # c # # # good # a = cond ? b : c # a = if cond # b # else # c # end # # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#28 class RuboCop::Cop::Style::MultilineTernaryOperator < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#34 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#54 def offense?(node); end end # source://rubocop//lib/rubocop/cop/style/multiline_ternary_operator.rb#31 RuboCop::Cop::Style::MultilineTernaryOperator::MSG = T.let(T.unsafe(nil), String) # This cop checks uses of the `then` keyword # in multi-line when statements. # # @example # # bad # case foo # when bar then # end # # # good # case foo # when bar # end # # # good # case foo # when bar then do_something # end # # # good # case foo # when bar then do_something(arg1, # arg2) # end # # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#31 class RuboCop::Cop::Style::MultilineWhenThen < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#37 def on_when(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#67 def accept_node_type?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#60 def require_then?(when_node); end end # source://rubocop//lib/rubocop/cop/style/multiline_when_then.rb#35 RuboCop::Cop::Style::MultilineWhenThen::MSG = T.let(T.unsafe(nil), String) # This cop checks against comparing a variable with multiple items, where # `Array#include?` could be used instead to avoid code repetition. # # @example # # bad # a = 'a' # foo if a == 'a' || a == 'b' || a == 'c' # # # good # a = 'a' # foo if ['a', 'b', 'c'].include?(a) # # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#17 class RuboCop::Cop::Style::MultipleComparison < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#21 def on_or(node); end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#33 def simple_comparison?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#32 def simple_double_comparison?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#76 def comparison?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#68 def nested_comparison?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#38 def nested_variable_comparison?(node); end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#80 def root_of_or_node(or_node); end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#64 def variable_name(node); end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#44 def variables_in_node(node); end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#54 def variables_in_simple_node(node); end end # source://rubocop//lib/rubocop/cop/style/multiple_comparison.rb#18 RuboCop::Cop::Style::MultipleComparison::MSG = T.let(T.unsafe(nil), String) # This cop checks whether some constant value isn't a # mutable literal (e.g. array or hash). # # Strict mode can be used to freeze all constants, rather than # just literals. # Strict mode is considered an experimental feature. It has not been # updated with an exhaustive list of all methods that will produce # frozen objects so there is a decent chance of getting some false # positives. Luckily, there is no harm in freezing an already # frozen object. # # @example EnforcedStyle: literals (default) # # bad # CONST = [1, 2, 3] # # # good # CONST = [1, 2, 3].freeze # # # good # CONST = <<~TESTING.freeze # This is a heredoc # TESTING # # # good # CONST = Something.new # @example EnforcedStyle: strict # # bad # CONST = Something.new # # # bad # CONST = Struct.new do # def foo # puts 1 # end # end # # # good # CONST = Something.new.freeze # # # good # CONST = Struct.new do # def foo # puts 1 # end # end.freeze # # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#53 class RuboCop::Cop::Style::MutableConstant < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#60 def on_casgn(node); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#65 def on_or_asgn(node); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#153 def operation_produces_immutable_object?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#169 def range_enclosed_in_parentheses?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#147 def splat_value(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#106 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#93 def check(value); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#139 def correct_splat_expansion(corrector, expr, splat_value); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#129 def frozen_string_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#125 def immutable_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#121 def mutable_literal?(value); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#75 def on_assignment(value); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#134 def requires_parentheses?(node); end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#83 def strict_check(value); end end # source://rubocop//lib/rubocop/cop/style/mutable_constant.rb#58 RuboCop::Cop::Style::MutableConstant::MSG = T.let(T.unsafe(nil), String) # Checks for uses of if with a negated condition. Only ifs # without else are considered. There are three different styles: # # * both # * prefix # * postfix # # @example EnforcedStyle: both (default) # # enforces `unless` for `prefix` and `postfix` conditionals # # # bad # # if !foo # bar # end # # # good # # unless foo # bar # end # # # bad # # bar if !foo # # # good # # bar unless foo # @example EnforcedStyle: prefix # # enforces `unless` for just `prefix` conditionals # # # bad # # if !foo # bar # end # # # good # # unless foo # bar # end # # # good # # bar if !foo # @example EnforcedStyle: postfix # # enforces `unless` for just `postfix` conditionals # # # bad # # bar if !foo # # # good # # bar unless foo # # # good # # if !foo # bar # end # # source://rubocop//lib/rubocop/cop/style/negated_if.rb#71 class RuboCop::Cop::Style::NegatedIf < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::NegativeConditional extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/negated_if.rb#76 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/negated_if.rb#92 def correct_style?(node); end # source://rubocop//lib/rubocop/cop/style/negated_if.rb#88 def message(node); end end # Checks for uses of unless with a negated condition. Only unless # without else are considered. There are three different styles: # # * both # * prefix # * postfix # # @example EnforcedStyle: both (default) # # enforces `if` for `prefix` and `postfix` conditionals # # # bad # unless !foo # bar # end # # # good # if foo # bar # end # # # bad # bar unless !foo # # # good # bar if foo # @example EnforcedStyle: prefix # # enforces `if` for just `prefix` conditionals # # # bad # unless !foo # bar # end # # # good # if foo # bar # end # # # good # bar unless !foo # @example EnforcedStyle: postfix # # enforces `if` for just `postfix` conditionals # # # bad # bar unless !foo # # # good # bar if foo # # # good # unless !foo # bar # end # # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#61 class RuboCop::Cop::Style::NegatedUnless < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::NegativeConditional extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#66 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#82 def correct_style?(node); end # source://rubocop//lib/rubocop/cop/style/negated_unless.rb#78 def message(node); end end # Checks for uses of while with a negated condition. # # @example # # bad # while !foo # bar # end # # # good # until foo # bar # end # # # bad # bar until !foo # # # good # bar while foo # bar while !foo && baz # # source://rubocop//lib/rubocop/cop/style/negated_while.rb#25 class RuboCop::Cop::Style::NegatedWhile < ::RuboCop::Cop::Base include ::RuboCop::Cop::NegativeConditional extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/negated_while.rb#29 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/negated_while.rb#29 def on_while(node); end end # This cop checks for nested use of if, unless, while and until in their # modifier form. # # @example # # # bad # something if a if b # # # good # something if b && a # # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#16 class RuboCop::Cop::Style::NestedModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#22 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#22 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#22 def on_while(node); end private # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#88 def add_parentheses_to_method_arguments(send_node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#44 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#30 def check(node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#67 def left_hand_operand(node, operator); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#40 def modifier?(node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#53 def new_expression(inner_node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#63 def replacement_operator(keyword); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#97 def requires_parens?(node); end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#74 def right_hand_operand(node, left_hand_keyword); end end # source://rubocop//lib/rubocop/cop/style/nested_modifier.rb#20 RuboCop::Cop::Style::NestedModifier::MSG = T.let(T.unsafe(nil), String) # This cop checks for unparenthesized method calls in the argument list # of a parenthesized method call. # # @example # # good # method1(method2(arg)) # # # bad # method1(method2 arg) # # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#15 class RuboCop::Cop::Style::NestedParenthesizedCalls < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::AllowedMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#22 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#22 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#58 def allowed?(send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#52 def allowed_omission?(send_node); end # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#38 def autocorrect(corrector, nested); end end # source://rubocop//lib/rubocop/cop/style/nested_parenthesized_calls.rb#20 RuboCop::Cop::Style::NestedParenthesizedCalls::MSG = T.let(T.unsafe(nil), String) # This cop checks for nested ternary op expressions. # # @example # # bad # a ? (b ? b1 : b2) : a2 # # # good # if a # b ? b1 : b2 # else # a2 # end # # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#18 class RuboCop::Cop::Style::NestedTernaryOperator < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#24 def on_if(node); end private # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#44 def if_node(node); end # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#51 def remove_parentheses(source); end end # source://rubocop//lib/rubocop/cop/style/nested_ternary_operator.rb#21 RuboCop::Cop::Style::NestedTernaryOperator::MSG = T.let(T.unsafe(nil), String) # Use `next` to skip iteration instead of a condition at the end. # # @example EnforcedStyle: skip_modifier_ifs (default) # # bad # [1, 2].each do |a| # if a == 1 # puts a # end # end # # # good # [1, 2].each do |a| # next unless a == 1 # puts a # end # # # good # [1, 2].each do |a| # puts a if a == 1 # end # @example EnforcedStyle: always # # With `always` all conditions at the end of an iteration needs to be # # replaced by next - with `skip_modifier_ifs` the modifier if like # # this one are ignored: `[1, 2].each { |a| puts a if a == 1 }` # # # bad # [1, 2].each do |a| # puts a if a == 1 # end # # # bad # [1, 2].each do |a| # if a == 1 # puts a # end # end # # # good # [1, 2].each do |a| # next unless a == 1 # puts a # end # # source://rubocop//lib/rubocop/cop/style/next.rb#49 class RuboCop::Cop::Style::Next < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::MinBodyLength include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/next.rb#68 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#75 def on_for(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#62 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/style/next.rb#75 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#75 def on_while(node); end private # source://rubocop//lib/rubocop/cop/style/next.rb#215 def actual_indent(lines, buffer); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#111 def allowed_modifier_if?(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#154 def autocorrect_block(corrector, node); end # source://rubocop//lib/rubocop/cop/style/next.rb#144 def autocorrect_modifier(corrector, node); end # source://rubocop//lib/rubocop/cop/style/next.rb#83 def check(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#169 def cond_range(node, cond); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#189 def end_followed_by_whitespace_only?(source_buffer, end_pos); end # source://rubocop//lib/rubocop/cop/style/next.rb#179 def end_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#97 def ends_with_condition?(body); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#127 def exit_body_type?(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#219 def heredoc_lines(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#119 def if_else_children?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#123 def if_without_else?(node); end # source://rubocop//lib/rubocop/cop/style/next.rb#139 def offense_location(offense_node); end # source://rubocop//lib/rubocop/cop/style/next.rb#133 def offense_node(body); end # Adjust indentation of `lines` to match `node` # # source://rubocop//lib/rubocop/cop/style/next.rb#204 def reindent(lines, node, corrector); end # source://rubocop//lib/rubocop/cop/style/next.rb#226 def reindent_line(corrector, lineno, delta, buffer); end # source://rubocop//lib/rubocop/cop/style/next.rb#193 def reindentable_lines(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/next.rb#103 def simple_if_without_break?(node); end class << self # source://rubocop//lib/rubocop/cop/style/next.rb#58 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/next.rb#56 RuboCop::Cop::Style::Next::EXIT_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/next.rb#55 RuboCop::Cop::Style::Next::MSG = T.let(T.unsafe(nil), String) # This cop checks for comparison of something with nil using `==` and # `nil?`. # # Supported styles are: predicate, comparison. # # @example EnforcedStyle: predicate (default) # # # bad # if x == nil # end # # # good # if x.nil? # end # @example EnforcedStyle: comparison # # # bad # if x.nil? # end # # # good # if x == nil # end # # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#31 class RuboCop::Cop::Style::NilComparison < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#41 def nil_check?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#40 def nil_comparison?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#43 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#59 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#71 def prefer_comparison?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#63 def style_check?(node, &block); end end # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#36 RuboCop::Cop::Style::NilComparison::EXPLICIT_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#35 RuboCop::Cop::Style::NilComparison::PREDICATE_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/nil_comparison.rb#38 RuboCop::Cop::Style::NilComparison::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for non-nil checks, which are usually redundant. # # With `IncludeSemanticChanges` set to `false` by default, this cop # does not report offenses for `!x.nil?` and does no changes that might # change behavior. # # With `IncludeSemanticChanges` set to `true`, this cop reports offenses # for `!x.nil?` and autocorrects that and `x != nil` to solely `x`, which # is *usually* OK, but might change behavior. # # @example # # bad # if x != nil # end # # # good # if x # end # # # Non-nil checks are allowed if they are the final nodes of predicate. # # good # def signed_in? # !current_user.nil? # end # @example IncludeSemanticChanges: false (default) # # good # if !x.nil? # end # @example IncludeSemanticChanges: true # # bad # if !x.nil? # end # # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#41 class RuboCop::Cop::Style::NonNilCheck < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#48 def nil_check?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#49 def not_and_nil_check?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#46 def not_equal_to_nil?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#61 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#61 def on_defs(node); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#51 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#47 def unless_check?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#85 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#115 def autocorrect_comparison(corrector, node); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#129 def autocorrect_non_nil(corrector, node, inner_node); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#137 def autocorrect_unless_nil(corrector, node, receiver); end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#76 def find_offense_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#111 def include_semantic_changes?; end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#103 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#96 def unless_and_nil_check?(send_node); end end # source://rubocop//lib/rubocop/cop/style/non_nil_check.rb#44 RuboCop::Cop::Style::NonNilCheck::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for uses of the keyword `not` instead of `!`. # # @example # # # bad - parentheses are required because of op precedence # x = (not something) # # # good # x = !something # # source://rubocop//lib/rubocop/cop/style/not.rb#16 class RuboCop::Cop::Style::Not < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/not.rb#32 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/not.rb#60 def correct_opposite_method(corrector, range, child); end # source://rubocop//lib/rubocop/cop/style/not.rb#65 def correct_with_parens(corrector, range, node); end # source://rubocop//lib/rubocop/cop/style/not.rb#70 def correct_without_parens(corrector, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/not.rb#50 def opposite_method?(child); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/not.rb#54 def requires_parens?(child); end end # source://rubocop//lib/rubocop/cop/style/not.rb#20 RuboCop::Cop::Style::Not::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/not.rb#23 RuboCop::Cop::Style::Not::OPPOSITE_METHODS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/style/not.rb#21 RuboCop::Cop::Style::Not::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for octal, hex, binary, and decimal literals using # uppercase prefixes and corrects them to lowercase prefix # or no prefix (in case of decimals). # # @example EnforcedOctalStyle: zero_with_o (default) # # bad - missing octal prefix # num = 01234 # # # bad - uppercase prefix # num = 0O1234 # num = 0X12AB # num = 0B10101 # # # bad - redundant decimal prefix # num = 0D1234 # num = 0d1234 # # # good # num = 0o1234 # num = 0x12AB # num = 0b10101 # num = 1234 # @example EnforcedOctalStyle: zero_only # # bad # num = 0o1234 # num = 0O1234 # # # good # num = 01234 # # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#36 class RuboCop::Cop::Style::NumericLiteralPrefix < ::RuboCop::Cop::Base include ::RuboCop::Cop::IntegerNode extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#52 def on_int(node); end private # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#109 def format_binary(source); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#113 def format_decimal(source); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#105 def format_hex(source); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#97 def format_octal(source); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#101 def format_octal_zero_only(source); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#82 def hex_bin_dec_literal_type(literal); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#68 def literal_type(node); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#64 def message(node); end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#74 def octal_literal_type(literal); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#93 def octal_zero_only?; end end # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#49 RuboCop::Cop::Style::NumericLiteralPrefix::BINARY_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#43 RuboCop::Cop::Style::NumericLiteralPrefix::BINARY_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#50 RuboCop::Cop::Style::NumericLiteralPrefix::DECIMAL_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#44 RuboCop::Cop::Style::NumericLiteralPrefix::DECIMAL_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#48 RuboCop::Cop::Style::NumericLiteralPrefix::HEX_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#42 RuboCop::Cop::Style::NumericLiteralPrefix::HEX_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#47 RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#41 RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#46 RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_ZERO_ONLY_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/numeric_literal_prefix.rb#40 RuboCop::Cop::Style::NumericLiteralPrefix::OCTAL_ZERO_ONLY_REGEX = T.let(T.unsafe(nil), Regexp) # This cop checks for big numeric literals without _ between groups # of digits in them. # # @example # # # bad # 1000000 # 1_00_000 # 1_0000 # # # good # 1_000_000 # 1000 # @example Strict: false (default) # # # good # 10_000_00 # typical representation of $10,000 in cents # @example Strict: true # # # bad # 10_000_00 # typical representation of $10,000 in cents # # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#33 class RuboCop::Cop::Style::NumericLiterals < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableMax include ::RuboCop::Cop::IntegerNode # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#49 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#45 def on_float(node); end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#41 def on_int(node); end private # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#61 def check(node); end # @param int_part [String] # # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#96 def format_int_part(int_part); end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#82 def format_number(node); end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#57 def max_parameter_name; end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#108 def min_digits; end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#78 def short_group_regex; end end # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#39 RuboCop::Cop::Style::NumericLiterals::DELIMITER_REGEXP = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/numeric_literals.rb#37 RuboCop::Cop::Style::NumericLiterals::MSG = T.let(T.unsafe(nil), String) # This cop checks for usage of comparison operators (`==`, # `>`, `<`) to test numbers as zero, positive, or negative. # These can be replaced by their respective predicate methods. # The cop can also be configured to do the reverse. # # The cop disregards `#nonzero?` as it its value is truthy or falsey, # but not `true` and `false`, and thus not always interchangeable with # `!= 0`. # # The cop ignores comparisons to global variables, since they are often # populated with objects which can be compared with integers, but are # not themselves `Integer` polymorphic. # # @example EnforcedStyle: predicate (default) # # bad # # foo == 0 # 0 > foo # bar.baz > 0 # # # good # # foo.zero? # foo.negative? # bar.baz.positive? # @example EnforcedStyle: comparison # # bad # # foo.zero? # foo.negative? # bar.baz.positive? # # # good # # foo == 0 # 0 > foo # bar.baz > 0 # # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#44 class RuboCop::Cop::Style::NumericPredicate < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::IgnoredMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#122 def comparison(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#126 def inverted_comparison(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#59 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#118 def predicate(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#76 def check(node); end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#110 def invert; end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#98 def parenthesized_source(node); end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#89 def replacement(numeric, operation); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#106 def require_parentheses?(node); end end # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#49 RuboCop::Cop::Style::NumericPredicate::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#51 RuboCop::Cop::Style::NumericPredicate::REPLACEMENTS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/style/numeric_predicate.rb#57 RuboCop::Cop::Style::NumericPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Checks for uses of if/then/else/end constructs on a single line. # AlwaysCorrectToMultiline config option can be set to true to auto-convert all offenses to # multi-line constructs. When AlwaysCorrectToMultiline is false (default case) the # auto-correct will first try converting them to ternary operators. # # @example # # bad # if foo then bar else baz end # # # bad # unless foo then baz else bar end # # # good # foo ? bar : baz # # # good # bar if foo # # # good # if foo then bar end # # # good # if foo # bar # else # baz # end # # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#33 class RuboCop::Cop::Style::OneLineConditional < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::OnNormalIfUnless extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#41 def on_normal_if_unless(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#71 def always_multiline?; end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#105 def branch_body_indentation; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#75 def cannot_replace_to_ternary?(node); end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#91 def else_branch_to_multiline(else_branch, indentation); end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#117 def expr_replacement(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#138 def keyword_with_changed_precedence?(node); end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#54 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#131 def method_call_with_changed_precedence?(node); end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#79 def multiline_replacement(node, indentation = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#58 def replacement(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#123 def requires_parentheses?(node); end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#109 def ternary_replacement(node); end end # source://rubocop//lib/rubocop/cop/style/one_line_conditional.rb#38 RuboCop::Cop::Style::OneLineConditional::MSG = T.let(T.unsafe(nil), String) # This cop checks for options hashes and discourages them if the # current Ruby version supports keyword arguments. # # @example # # # bad # def fry(options = {}) # temperature = options.fetch(:temperature, 300) # # ... # end # # # good # def fry(temperature: 300) # # ... # end # # source://rubocop//lib/rubocop/cop/style/option_hash.rb#22 class RuboCop::Cop::Style::OptionHash < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/option_hash.rb#29 def on_args(node); end # source://rubocop//lib/rubocop/cop/style/option_hash.rb#25 def option_hash(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/option_hash.rb#40 def allowlist; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/option_hash.rb#49 def super_used?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/option_hash.rb#44 def suspicious_name?(arg_name); end end # source://rubocop//lib/rubocop/cop/style/option_hash.rb#23 RuboCop::Cop::Style::OptionHash::MSG = T.let(T.unsafe(nil), String) # This cop checks for optional arguments to methods # that do not come at the end of the argument list. # # @example # # bad # def foo(a = 1, b, c) # end # # # good # def baz(a, b, c = 1) # end # # def foobar(a = 1, b = 2, c = 3) # end # # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#20 class RuboCop::Cop::Style::OptionalArguments < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#24 def on_def(node); end private # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#44 def argument_positions(arguments); end # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#32 def each_misplaced_optional_arg(arguments); end end # source://rubocop//lib/rubocop/cop/style/optional_arguments.rb#21 RuboCop::Cop::Style::OptionalArguments::MSG = T.let(T.unsafe(nil), String) # This cop checks for places where keyword arguments can be used instead of # boolean arguments when defining methods. `respond_to_missing?` method is allowed by default. # These are customizable with `AllowedMethods` option. # # @example # # bad # def some_method(bar = false) # puts bar # end # # # bad - common hack before keyword args were introduced # def some_method(options = {}) # bar = options.fetch(:bar, false) # puts bar # end # # # good # def some_method(bar: false) # puts bar # end # @example AllowedMethods: ['some_method'] # # good # def some_method(bar = false) # puts bar # end # # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#33 class RuboCop::Cop::Style::OptionalBooleanParameter < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#39 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#39 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#37 RuboCop::Cop::Style::OptionalBooleanParameter::BOOLEAN_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/optional_boolean_parameter.rb#36 RuboCop::Cop::Style::OptionalBooleanParameter::MSG = T.let(T.unsafe(nil), String) # This cop checks for potential usage of the `||=` operator. # # @example # # bad # name = name ? name : 'Bozhidar' # # # bad # name = if name # name # else # 'Bozhidar' # end # # # bad # unless name # name = 'Bozhidar' # end # # # bad # name = 'Bozhidar' unless name # # # good - set name to 'Bozhidar', only if it's nil or false # name ||= 'Bozhidar' # # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#29 class RuboCop::Cop::Style::OrAssignment < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#49 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#57 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#34 def ternary_assignment?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#42 def unless_assignment?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#72 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#82 def take_variable_and_default_from_ternary(node); end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#87 def take_variable_and_default_from_unless(node); end end # source://rubocop//lib/rubocop/cop/style/or_assignment.rb#32 RuboCop::Cop::Style::OrAssignment::MSG = T.let(T.unsafe(nil), String) # Checks for simple usages of parallel assignment. # This will only complain when the number of variables # being assigned matched the number of assigning variables. # # @example # # bad # a, b, c = 1, 2, 3 # a, b, c = [1, 2, 3] # # # good # one, two = *foo # a, b = foo() # a, b = b, a # # a = 1 # b = 2 # c = 3 # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#25 class RuboCop::Cop::Style::ParallelAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RescueNode extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#118 def implicit_self_getter?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#31 def on_masgn(node); end private # Converts (send nil :something) nodes to (send (:self) :something). # This makes the sorting algorithm work for expressions such as # `self.a, self.b = b, a`. # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#112 def add_self_to_getters(right_elements); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#62 def allowed_lhs?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#56 def allowed_masign?(lhs_elements, rhs_elements); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#70 def allowed_rhs?(node); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#84 def assignment_corrector(node, order); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#46 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#95 def find_valid_order(left_elements, right_elements); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#171 def modifier_statement?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#80 def return_of_method_call?(node); end end # Helper class necessitated by silly design of TSort prior to Ruby 2.1 # Newer versions have a better API, but that doesn't help us # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#122 class RuboCop::Cop::Style::ParallelAssignment::AssignmentSorter include ::TSort extend ::RuboCop::AST::NodePattern::Macros # @return [AssignmentSorter] a new instance of AssignmentSorter # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#130 def initialize(assignments); end # `lhs` is an assignment method call like `obj.attr=` or `ary[idx]=`. # Does `rhs` access the same value which is assigned by `lhs`? # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#159 def accesses?(rhs, lhs); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#152 def dependency?(lhs, rhs); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#128 def matching_calls(param0, param1, param2); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#138 def tsort_each_child(assignment); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#134 def tsort_each_node(&block); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#127 def uses_var?(param0, param1); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#126 def var_name(param0 = T.unsafe(nil)); end end # An internal class for correcting parallel assignment # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#176 class RuboCop::Cop::Style::ParallelAssignment::GenericCorrector include ::RuboCop::Cop::Alignment # @return [GenericCorrector] a new instance of GenericCorrector # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#181 def initialize(node, config, new_elements); end # Returns the value of attribute config. # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#179 def config; end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#187 def correction; end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#191 def correction_range; end # Returns the value of attribute node. # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#179 def node; end protected # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#197 def assignment; end private # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#217 def cop_config; end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#213 def extract_sources(node); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#203 def source(node); end end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#29 RuboCop::Cop::Style::ParallelAssignment::MSG = T.let(T.unsafe(nil), String) # An internal class for correcting parallel assignment # guarded by if, unless, while, or until # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#262 class RuboCop::Cop::Style::ParallelAssignment::ModifierCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#263 def correction; end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#272 def correction_range; end private # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#278 def modifier_range(node); end end # An internal class for correcting parallel assignment # protected by rescue # # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#224 class RuboCop::Cop::Style::ParallelAssignment::RescueCorrector < ::RuboCop::Cop::Style::ParallelAssignment::GenericCorrector # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#225 def correction; end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#239 def correction_range; end private # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#250 def begin_correction(rescue_result); end # source://rubocop//lib/rubocop/cop/style/parallel_assignment.rb#245 def def_correction(rescue_result); end end # This cop checks for the presence of superfluous parentheses around the # condition of if/unless/while/until. # # `AllowSafeAssignment` option for safe assignment. # By safe assignment we mean putting parentheses around # an assignment to indicate "I know I'm using an assignment # as a condition. It's not a mistake." # # @example # # bad # x += 1 while (x < 10) # foo unless (bar || baz) # # if (x > 10) # elsif (x < 3) # end # # # good # x += 1 while x < 10 # foo unless bar || baz # # if x > 10 # elsif x < 3 # end # @example AllowSafeAssignment: true (default) # # good # foo unless (bar = baz) # @example AllowSafeAssignment: false # # bad # foo unless (bar = baz) # @example AllowInMultilineConditions: false (default) # # bad # if (x > 10 && # y > 10) # end # # # good # if x > 10 && # y > 10 # end # @example AllowInMultilineConditions: true # # good # if (x > 10 && # y > 10) # end # # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#56 class RuboCop::Cop::Style::ParenthesesAroundCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::SafeAssignment include ::RuboCop::Cop::Parentheses extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#74 def control_op_condition(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#61 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#67 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#67 def on_while(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#111 def allow_multiline_conditions?; end # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#99 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#92 def modifier_op?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#105 def parens_allowed?(node); end # source://rubocop//lib/rubocop/cop/style/parentheses_around_condition.rb#78 def process_control_op(node); end end # This cop enforces the consistent usage of `%`-literal delimiters. # # Specify the 'default' key to set all preferred delimiters at once. You # can continue to specify individual preferred delimiters to override the # default. # # @example # # Style/PercentLiteralDelimiters: # # PreferredDelimiters: # # default: '[]' # # '%i': '()' # # # good # %w[alpha beta] + %i(gamma delta) # # # bad # %W(alpha #{beta}) # # # bad # %I(alpha beta) # # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#26 class RuboCop::Cop::Style::PercentLiteralDelimiters < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#30 def on_array(node); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#38 def on_dstr(node); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#34 def on_regexp(node); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#38 def on_str(node); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#43 def on_sym(node); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#47 def on_xstr(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#95 def contains_delimiter?(node, delimiters); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#84 def contains_preferred_delimiter?(node, type); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#88 def include_same_character_as_used_for_delimiter?(node, type); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#110 def matchpairs(begin_delimiter); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#67 def message(type); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#53 def on_percent_literal(node); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#74 def preferred_delimiters_for(type); end # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#102 def string_source(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/percent_literal_delimiters.rb#80 def uses_preferred_delimiter?(node, type); end end # This cop checks for usage of the %Q() syntax when %q() would do. # # @example EnforcedStyle: lower_case_q (default) # # The `lower_case_q` style prefers `%q` unless # # interpolation is needed. # # bad # %Q[Mix the foo into the baz.] # %Q(They all said: 'Hooray!') # # # good # %q[Mix the foo into the baz] # %q(They all said: 'Hooray!') # @example EnforcedStyle: upper_case_q # # The `upper_case_q` style requires the sole use of `%Q`. # # bad # %q/Mix the foo into the baz./ # %q{They all said: 'Hooray!'} # # # good # %Q/Mix the foo into the baz./ # %Q{They all said: 'Hooray!'} # # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#28 class RuboCop::Cop::Style::PercentQLiterals < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#37 def on_str(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#56 def correct_literal_style?(node); end # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#65 def corrected(src); end # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#61 def message(_range); end # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#43 def on_percent_literal(node); end end # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#33 RuboCop::Cop::Style::PercentQLiterals::LOWER_CASE_Q_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/percent_q_literals.rb#35 RuboCop::Cop::Style::PercentQLiterals::UPPER_CASE_Q_MSG = T.let(T.unsafe(nil), String) # This cop looks for uses of Perl-style regexp match # backreferences like $1, $2, etc. # # @example # # bad # puts $1 # # # good # puts Regexp.last_match(1) # # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#15 class RuboCop::Cop::Style::PerlBackrefs < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#20 def on_nth_ref(node); end end # source://rubocop//lib/rubocop/cop/style/perl_backrefs.rb#18 RuboCop::Cop::Style::PerlBackrefs::MSG = T.let(T.unsafe(nil), String) # This cop (by default) checks for uses of methods Hash#has_key? and # Hash#has_value? where it enforces Hash#key? and Hash#value? # It is configurable to enforce the inverse, using `verbose` method # names also. # # @example EnforcedStyle: short (default) # # bad # Hash#has_key? # Hash#has_value? # # # good # Hash#key? # Hash#value? # @example EnforcedStyle: verbose # # bad # Hash#key? # Hash#value? # # # good # Hash#has_key? # Hash#has_value? # # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#28 class RuboCop::Cop::Style::PreferredHashMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#41 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#41 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#54 def message(method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#66 def offending_selector?(method_name); end # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#58 def proper_method_name(method_name); end end # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#32 RuboCop::Cop::Style::PreferredHashMethods::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#34 RuboCop::Cop::Style::PreferredHashMethods::OFFENDING_SELECTORS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/style/preferred_hash_methods.rb#39 RuboCop::Cop::Style::PreferredHashMethods::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for uses of Proc.new where Kernel#proc # would be more appropriate. # # @example # # bad # p = Proc.new { |n| puts n } # # # good # p = proc { |n| puts n } # # source://rubocop//lib/rubocop/cop/style/proc.rb#16 class RuboCop::Cop::Style::Proc < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/proc.rb#24 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/proc.rb#21 def proc_new?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/proc.rb#19 RuboCop::Cop::Style::Proc::MSG = T.let(T.unsafe(nil), String) # This cop checks the args passed to `fail` and `raise`. For exploded # style (default), it recommends passing the exception class and message # to `raise`, rather than construct an instance of the error. It will # still allow passing just a message, or the construction of an error # with more than one argument. # # The exploded style works identically, but with the addition that it # will also suggest constructing error objects when the exception is # passed multiple arguments. # # @example EnforcedStyle: exploded (default) # # bad # raise StandardError.new("message") # # # good # raise StandardError, "message" # fail "message" # raise MyCustomError.new(arg1, arg2, arg3) # raise MyKwArgError.new(key1: val1, key2: val2) # @example EnforcedStyle: compact # # bad # raise StandardError, "message" # raise RuntimeError, arg1, arg2, arg3 # # # good # raise StandardError.new("message") # raise MyCustomError.new(arg1, arg2, arg3) # fail "message" # # source://rubocop//lib/rubocop/cop/style/raise_args.rb#35 class RuboCop::Cop::Style::RaiseArgs < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/raise_args.rb#46 def on_send(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/raise_args.rb#112 def acceptable_exploded_args?(args); end # source://rubocop//lib/rubocop/cop/style/raise_args.rb#85 def check_compact(node); end # source://rubocop//lib/rubocop/cop/style/raise_args.rb#97 def check_exploded(node); end # source://rubocop//lib/rubocop/cop/style/raise_args.rb#59 def correction_compact_to_exploded(node); end # source://rubocop//lib/rubocop/cop/style/raise_args.rb#72 def correction_exploded_to_compact(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/raise_args.rb#126 def requires_parens?(parent); end end # source://rubocop//lib/rubocop/cop/style/raise_args.rb#41 RuboCop::Cop::Style::RaiseArgs::COMPACT_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/raise_args.rb#39 RuboCop::Cop::Style::RaiseArgs::EXPLODED_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/raise_args.rb#44 RuboCop::Cop::Style::RaiseArgs::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the use of randomly generated numbers, # added/subtracted with integer literals, as well as those with # Integer#succ and Integer#pred methods. Prefer using ranges instead, # as it clearly states the intentions. # # @example # # bad # rand(6) + 1 # 1 + rand(6) # rand(6) - 1 # 1 - rand(6) # rand(6).succ # rand(6).pred # Random.rand(6) + 1 # Kernel.rand(6) + 1 # rand(0..5) + 1 # # # good # rand(1..6) # rand(1...7) # # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#26 class RuboCop::Cop::Style::RandomWithOffset < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#33 def integer_op_rand?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#61 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#52 def rand_modified?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#42 def rand_op_integer?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#74 def random_call(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#147 def to_int(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#79 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#136 def boundaries_from_random_node(random_node); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#89 def corrected_integer_op_rand(node); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#119 def corrected_rand_modified(node); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#104 def corrected_rand_op_integer(node); end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#132 def prefix_from_prefix_node(node); end end # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#29 RuboCop::Cop::Style::RandomWithOffset::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/random_with_offset.rb#31 RuboCop::Cop::Style::RandomWithOffset::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for redundant assignment before returning. # # @example # # bad # def test # x = foo # x # end # # # bad # def test # if x # z = foo # z # elsif y # z = bar # z # end # end # # # good # def test # foo # end # # # good # def test # if x # foo # elsif y # bar # end # end # # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#40 class RuboCop::Cop::Style::RedundantAssignment < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#49 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#49 def on_defs(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#45 def redundant_assignment?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#92 def check_begin_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#56 def check_branch(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#70 def check_case_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#88 def check_ensure_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#75 def check_if_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#82 def check_rescue_node(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_assignment.rb#43 RuboCop::Cop::Style::RedundantAssignment::MSG = T.let(T.unsafe(nil), String) # This cop checks for redundant `begin` blocks. # # Currently it checks for code like this: # # @example # # # bad # def redundant # begin # ala # bala # rescue StandardError => e # something # end # end # # # good # def preferred # ala # bala # rescue StandardError => e # something # end # # # bad # begin # do_something # end # # # good # do_something # # # bad # # When using Ruby 2.5 or later. # do_something do # begin # something # rescue => ex # anything # end # end # # # good # # In Ruby 2.5 or later, you can omit `begin` in `do-end` block. # do_something do # something # rescue => ex # anything # end # # # good # # Stabby lambdas don't support implicit `begin` in `do-end` blocks. # -> do # begin # foo # rescue Bar # baz # end # end # # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#65 class RuboCop::Cop::Style::RedundantBegin < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#77 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#70 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#70 def on_defs(node); end # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#87 def on_kwbegin(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#102 def contain_rescue_or_ensure?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#95 def register_offense(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#108 def valid_context_using_only_begin?(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_begin.rb#68 RuboCop::Cop::Style::RedundantBegin::MSG = T.let(T.unsafe(nil), String) # This cop checks for usage of the %W() syntax when %w() would do. # # @example # # bad # %W(cat dog pig) # %W[door wall floor] # # # good # %w/swim run bike/ # %w[shirt pants shoes] # %W(apple #{fruit} grape) # # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#17 class RuboCop::Cop::Style::RedundantCapitalW < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#24 def on_array(node); end private # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#30 def on_percent_literal(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#39 def requires_interpolation?(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_capital_w.rb#21 RuboCop::Cop::Style::RedundantCapitalW::MSG = T.let(T.unsafe(nil), String) # This cop checks for unnecessary conditional expressions. # # @example # # bad # a = b ? b : c # # # good # a = b || c # @example # # bad # if b # b # else # c # end # # # good # b || c # # # good # if b # b # elsif cond # c # end # # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#33 class RuboCop::Cop::Style::RedundantCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#40 def on_if(node); end private # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#117 def correct_ternary(corrector, node); end # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#95 def else_source(else_branch); end # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#105 def make_ternary_form(node); end # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#61 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#75 def offense?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#69 def range_of_offense(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#125 def require_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#91 def use_hash_key_assignment?(else_branch); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#87 def use_if_branch?(else_branch); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#133 def without_argument_parentheses_method?(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#37 RuboCop::Cop::Style::RedundantCondition::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_condition.rb#38 RuboCop::Cop::Style::RedundantCondition::REDUNDANT_CONDITION = T.let(T.unsafe(nil), String) # This cop checks for redundant returning of true/false in conditionals. # # @example # # bad # x == y ? true : false # # # bad # if x == y # true # else # false # end # # # good # x == y # # # bad # x == y ? false : true # # # good # x != y # # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#27 class RuboCop::Cop::Style::RedundantConditional < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#37 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#56 def redundant_condition?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#60 def redundant_condition_inverted?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#91 def configured_indentation_width; end # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#87 def indented_else_node(expression, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#77 def invert_expression?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#49 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#64 def offense?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#70 def replacement_condition(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#32 RuboCop::Cop::Style::RedundantConditional::COMPARISON_OPERATOR_MATCHER = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_conditional.rb#34 RuboCop::Cop::Style::RedundantConditional::MSG = T.let(T.unsafe(nil), String) # This cop checks for RuntimeError as the argument of raise/fail. # # It checks for code like this: # # @example # # Bad # raise RuntimeError, 'message' # # # Bad # raise RuntimeError.new('message') # # # Good # raise 'message' # # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#19 class RuboCop::Cop::Style::RedundantException < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#60 def compact?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#56 def exploded?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#48 def fix_compact(node); end # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#34 def fix_exploded(node); end # Switch `raise RuntimeError, 'message'` to `raise 'message'`, and # `raise RuntimeError.new('message')` to `raise 'message'`. # # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#30 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#22 RuboCop::Cop::Style::RedundantException::MSG_1 = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#23 RuboCop::Cop::Style::RedundantException::MSG_2 = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_exception.rb#26 RuboCop::Cop::Style::RedundantException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop identifies places where `fetch(key) { value }` # can be replaced by `fetch(key, value)`. # # In such cases `fetch(key, value)` method is faster # than `fetch(key) { value }`. # # @example SafeForConstants: false (default) # # bad # hash.fetch(:key) { 5 } # hash.fetch(:key) { true } # hash.fetch(:key) { nil } # array.fetch(5) { :value } # ENV.fetch(:key) { 'value' } # # # good # hash.fetch(:key, 5) # hash.fetch(:key, true) # hash.fetch(:key, nil) # array.fetch(5, :value) # ENV.fetch(:key, 'value') # @example SafeForConstants: true # # bad # ENV.fetch(:key) { VALUE } # # # good # ENV.fetch(:key, VALUE) # # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#34 class RuboCop::Cop::Style::RedundantFetchBlock < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#48 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#81 def rails_cache?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#41 def redundant_fetch_block_candidate?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#67 def basic_literal?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#96 def build_bad_method(send, body); end # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#89 def build_good_method(send, body); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#103 def check_for_constant?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#107 def check_for_string?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#71 def const_type?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#85 def fetch_range(send, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#75 def should_not_check?(send, body); end end # source://rubocop//lib/rubocop/cop/style/redundant_fetch_block.rb#39 RuboCop::Cop::Style::RedundantFetchBlock::MSG = T.let(T.unsafe(nil), String) # This cop checks for the presence of superfluous `.rb` extension in # the filename provided to `require` and `require_relative`. # # Note: If the extension is omitted, Ruby tries adding '.rb', '.so', # and so on to the name until found. If the file named cannot be found, # a `LoadError` will be raised. # There is an edge case where `foo.so` file is loaded instead of a `LoadError` # if `foo.so` file exists when `require 'foo.rb'` will be changed to `require 'foo'`, # but that seems harmless. # # @example # # bad # require 'foo.rb' # require_relative '../foo.rb' # # # good # require 'foo' # require 'foo.so' # require_relative '../foo' # require_relative '../foo.so' # # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#27 class RuboCop::Cop::Style::RedundantFileExtensionInRequire < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#37 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#33 def require_call?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#30 RuboCop::Cop::Style::RedundantFileExtensionInRequire::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_file_extension_in_require.rb#31 RuboCop::Cop::Style::RedundantFileExtensionInRequire::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop check for uses of Object#freeze on immutable objects. # # @example # # bad # CONST = 1.freeze # # # good # CONST = 1 # # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#14 class RuboCop::Cop::Style::RedundantFreeze < ::RuboCop::Cop::Base include ::RuboCop::Cop::FrozenStringLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#22 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#52 def operation_produces_immutable_object?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#35 def immutable_literal?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#44 def strip_parenthesis(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#18 RuboCop::Cop::Style::RedundantFreeze::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_freeze.rb#20 RuboCop::Cop::Style::RedundantFreeze::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for strings that are just an interpolated expression. # # @example # # # bad # "#{@var}" # # # good # @var.to_s # # # good if @var is already a String # @var # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#18 class RuboCop::Cop::Style::RedundantInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::PercentLiteral extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#28 def on_dstr(node); end private # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#92 def autocorrect_other(corrector, embedded_node, node); end # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#85 def autocorrect_single_variable_interpolation(corrector, embedded_node, node); end # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#79 def autocorrect_variable_interpolation(corrector, embedded_node, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#74 def embedded_in_percent_array?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#70 def implicit_concatenation?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#62 def interpolation?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#46 def single_interpolation?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#53 def single_variable_interpolation?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#66 def variable_interpolation?(node); end class << self # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#24 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/redundant_interpolation.rb#22 RuboCop::Cop::Style::RedundantInterpolation::MSG = T.let(T.unsafe(nil), String) # This cop checks for redundant parentheses. # # @example # # # bad # (x) if ((y.z).nil?) # # # good # x if y.z.nil? # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#16 class RuboCop::Cop::Style::RedundantParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::Parentheses extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#25 def arg_in_call_with_block?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#219 def first_send_argument?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#223 def first_super_argument?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#227 def first_yield_argument?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#23 def method_node_and_args(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#28 def on_begin(node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#22 def range_end?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#24 def rescue?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#20 def square_brackets?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#57 def allowed_ancestor?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#144 def allowed_array_or_hash_element?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#50 def allowed_expression?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#62 def allowed_method_call?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#67 def allowed_multiple_expression?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#158 def array_element?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#231 def call_chain_starts_with_int?(begin_node, send_node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#100 def check(begin_node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#110 def check_send(begin_node, node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#119 def check_unary(begin_node, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#169 def disallowed_literal?(begin_node, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#80 def empty_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#85 def first_arg_begins_with_hash_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#213 def first_argument?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#154 def hash_element?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#43 def ignore_syntax?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#140 def keyword_ancestor?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#186 def keyword_with_redundant_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#76 def like_method_argument_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#199 def method_call_with_redundant_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#92 def method_chain_begins_with_hash_literal?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#130 def offense(node, msg); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#209 def only_begin_arg?(args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#162 def only_closing_paren_before_comma?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#36 def parens_allowed?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#175 def raised_to_power_negative_numeric?(begin_node, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_parentheses.rb#136 def suspect_unary?(node); end end # This cop checks for usage of the %q/%Q syntax when '' or "" would do. # # @example # # # bad # name = %q(Bruce Wayne) # time = %q(8 o'clock) # question = %q("What did you say?") # # # good # name = 'Bruce Wayne' # time = "8 o'clock" # question = '"What did you say?"' # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#20 class RuboCop::Cop::Style::RedundantPercentQ < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#35 def on_dstr(node); end # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#41 def on_str(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#101 def acceptable_capital_q?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#93 def acceptable_q?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#68 def allowed_percent_q?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#52 def check(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#64 def interpolated_quotes?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#74 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#89 def start_with_percent_q_variant?(string); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#84 def string_literal?(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#25 RuboCop::Cop::Style::RedundantPercentQ::DYNAMIC_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#29 RuboCop::Cop::Style::RedundantPercentQ::EMPTY = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#33 RuboCop::Cop::Style::RedundantPercentQ::ESCAPED_NON_BACKSLASH = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#23 RuboCop::Cop::Style::RedundantPercentQ::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#31 RuboCop::Cop::Style::RedundantPercentQ::PERCENT_CAPITAL_Q = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#30 RuboCop::Cop::Style::RedundantPercentQ::PERCENT_Q = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#28 RuboCop::Cop::Style::RedundantPercentQ::QUOTE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#27 RuboCop::Cop::Style::RedundantPercentQ::SINGLE_QUOTE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_percent_q.rb#32 RuboCop::Cop::Style::RedundantPercentQ::STRING_INTERPOLATION_REGEXP = T.let(T.unsafe(nil), Regexp) # This cop checks for unnecessary single-element Regexp character classes. # # @example # # # bad # r = /[x]/ # # # good # r = /x/ # # # bad # r = /[\s]/ # # # good # r = /\s/ # # # good # r = /[ab]/ # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#24 class RuboCop::Cop::Style::RedundantRegexpCharacterClass < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#31 def on_regexp(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#86 def backslash_b?(elem); end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#47 def each_redundant_character_class(node); end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#55 def each_single_element_character_class(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#65 def redundant_single_element_character_class?(node, char_class); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#92 def requires_escape_outside_char_class?(elem); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#80 def whitespace_in_free_space_mode?(node, elem); end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#76 def without_character_class(loc); end end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#28 RuboCop::Cop::Style::RedundantRegexpCharacterClass::MSG_REDUNDANT_CHARACTER_CLASS = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_regexp_character_class.rb#27 RuboCop::Cop::Style::RedundantRegexpCharacterClass::REQUIRES_ESCAPE_OUTSIDE_CHAR_CLASS_CHARS = T.let(T.unsafe(nil), Array) # This cop checks for redundant escapes inside Regexp literals. # # @example # # bad # %r{foo\/bar} # # # good # %r{foo/bar} # # # good # /foo\/bar/ # # # good # %r/foo\/bar/ # # # good # %r!foo\!bar! # # # bad # /a\-b/ # # # good # /a-b/ # # # bad # /[\+\-]\d/ # # # good # /[+\-]\d/ # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#35 class RuboCop::Cop::Style::RedundantRegexpEscape < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#45 def on_regexp(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#59 def allowed_escape?(node, char, within_character_class); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#74 def delimiter?(node, char); end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#83 def each_escape(node); end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#95 def escape_range_at_index(node, index); end end # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#41 RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_ALWAYS_ESCAPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#43 RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_OUTSIDE_CHAR_CLASS_METACHAR_ESCAPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#42 RuboCop::Cop::Style::RedundantRegexpEscape::ALLOWED_WITHIN_CHAR_CLASS_METACHAR_ESCAPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/redundant_regexp_escape.rb#39 RuboCop::Cop::Style::RedundantRegexpEscape::MSG_REDUNDANT_ESCAPE = T.let(T.unsafe(nil), String) # This cop checks for redundant `return` expressions. # # @example # # These bad cases should be extended to handle methods whose body is # # if/else or a case expression with a default branch. # # # bad # def test # return something # end # # # bad # def test # one # two # three # return something # end # # # good # def test # return something if something_else # end # # # good # def test # if x # elsif y # else # end # end # @example AllowMultipleReturnValues: false (default) # # bad # def test # return x, y # end # @example AllowMultipleReturnValues: true # # good # def test # return x, y # end # # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#50 class RuboCop::Cop::Style::RedundantReturn < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#57 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#57 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#89 def add_braces(corrector, node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#84 def add_brackets(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#155 def allow_multiple_return_values?; end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#150 def check_begin_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#95 def check_branch(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#124 def check_case_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#145 def check_ensure_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#129 def check_if_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#141 def check_resbody_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#136 def check_rescue_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#111 def check_return_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#68 def correct_with_arguments(return_node, corrector); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#64 def correct_without_arguments(return_node, corrector); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#80 def hash_without_braces?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#159 def message(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#54 RuboCop::Cop::Style::RedundantReturn::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_return.rb#55 RuboCop::Cop::Style::RedundantReturn::MULTI_RETURN_MSG = T.let(T.unsafe(nil), String) # This cop checks for redundant uses of `self`. # # The usage of `self` is only needed when: # # * Sending a message to same object with zero arguments in # presence of a method name clash with an argument or a local # variable. # # * Calling an attribute writer to prevent an local variable assignment. # # Note, with using explicit self you can only send messages with public or # protected scope, you cannot send private messages this way. # # Note we allow uses of `self` with operators because it would be awkward # otherwise. # # @example # # # bad # def foo(bar) # self.baz # end # # # good # def foo(bar) # self.bar # Resolves name clash with the argument. # end # # def foo # bar = 1 # self.bar # Resolves name clash with the local variable. # end # # def foo # %w[x y z].select do |bar| # self.bar == bar # Resolves name clash with argument of the block. # end # end # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#44 class RuboCop::Cop::Style::RedundantSelf < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # @return [RedundantSelf] a new instance of RedundantSelf # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#59 def initialize(config = T.unsafe(nil), options = T.unsafe(nil)); end # Assignment of self.x # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#67 def on_and_asgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#85 def on_args(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#117 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#89 def on_blockarg(node); end # Using self.x to distinguish from local variable x # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#80 def on_def(node); end # Using self.x to distinguish from local variable x # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#80 def on_defs(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#100 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#93 def on_masgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#73 def on_op_asgn(node); end # Assignment of self.x # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#67 def on_or_asgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#105 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#154 def add_lhs_to_local_variables_scopes(rhs, lhs); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#123 def add_scope(node, local_variables = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#148 def allow_self(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#129 def allowed_send_node?(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#143 def on_argument(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#135 def regular_method_call?(node); end class << self # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#55 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#48 RuboCop::Cop::Style::RedundantSelf::KERNEL_METHODS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#49 RuboCop::Cop::Style::RedundantSelf::KEYWORDS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/redundant_self.rb#47 RuboCop::Cop::Style::RedundantSelf::MSG = T.let(T.unsafe(nil), String) # This cop checks for places where redundant assignments are made for in place # modification methods. # # This cop is marked as unsafe, because it can produce false positives for # user defined methods having one of the expected names, but not modifying # its receiver in place. # # @example # # bad # args = args.concat(ary) # hash = hash.merge!(other) # # # good # args.concat(foo) # args += foo # hash.merge!(other) # # # bad # self.foo = foo.concat(ary) # # # good # foo.concat(ary) # self.foo += ary # # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#30 class RuboCop::Cop::Style::RedundantSelfAssignment < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#51 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#51 def on_gvasgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#51 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#51 def on_lvasgn(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#68 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#94 def redundant_nonself_assignment?(param0 = T.unsafe(nil), param1, param2); end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#85 def redundant_self_assignment?(param0 = T.unsafe(nil), param1); end private # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#110 def correction_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#81 def method_returning_self?(method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#103 def redundant_assignment?(node); end end # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#44 RuboCop::Cop::Style::RedundantSelfAssignment::ASSIGNMENT_TYPE_TO_RECEIVER_TYPE = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#37 RuboCop::Cop::Style::RedundantSelfAssignment::METHODS_RETURNING_SELF = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/style/redundant_self_assignment.rb#34 RuboCop::Cop::Style::RedundantSelfAssignment::MSG = T.let(T.unsafe(nil), String) # This cop is used to identify instances of sorting and then # taking only the first or last element. The same behavior can # be accomplished without a relatively expensive sort by using # `Enumerable#min` instead of sorting and taking the first # element and `Enumerable#max` instead of sorting and taking the # last element. Similarly, `Enumerable#min_by` and # `Enumerable#max_by` can replace `Enumerable#sort_by` calls # after which only the first or last element is used. # # @example # # bad # [2, 1, 3].sort.first # [2, 1, 3].sort[0] # [2, 1, 3].sort.at(0) # [2, 1, 3].sort.slice(0) # # # good # [2, 1, 3].min # # # bad # [2, 1, 3].sort.last # [2, 1, 3].sort[-1] # [2, 1, 3].sort.at(-1) # [2, 1, 3].sort.slice(-1) # # # good # [2, 1, 3].max # # # bad # arr.sort_by(&:foo).first # arr.sort_by(&:foo)[0] # arr.sort_by(&:foo).at(0) # arr.sort_by(&:foo).slice(0) # # # good # arr.min_by(&:foo) # # # bad # arr.sort_by(&:foo).last # arr.sort_by(&:foo)[-1] # arr.sort_by(&:foo).at(-1) # arr.sort_by(&:foo).slice(-1) # # # good # arr.max_by(&:foo) # # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#52 class RuboCop::Cop::Style::RedundantSort < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#77 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#61 def redundant_sort?(param0 = T.unsafe(nil)); end private # This gets the start of the accessor whether it has a dot # (e.g. `.first`) or doesn't (e.g. `[0]`) # # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#152 def accessor_start(node); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#142 def arg_node(node); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#146 def arg_value(node); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#95 def autocorrect(corrector, node, sort_node, sorter, accessor); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#125 def base(accessor, arg); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#107 def message(node, sorter, accessor); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#103 def offense_range(sort_node, ancestor); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#133 def suffix(sorter); end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#121 def suggestion(sorter, accessor, arg); end end # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#56 RuboCop::Cop::Style::RedundantSort::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/redundant_sort.rb#59 RuboCop::Cop::Style::RedundantSort::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop identifies places where `sort_by { ... }` can be replaced by # `sort`. # # @example # # bad # array.sort_by { |x| x } # array.sort_by do |var| # var # end # # # good # array.sort # # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#18 class RuboCop::Cop::Style::RedundantSortBy < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#28 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#24 def redundant_sort_by(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#40 def sort_by_range(send, node); end end # source://rubocop//lib/rubocop/cop/style/redundant_sort_by.rb#22 RuboCop::Cop::Style::RedundantSortBy::MSG = T.let(T.unsafe(nil), String) # This cop enforces using // or %r around regular expressions. # # @example EnforcedStyle: slashes (default) # # bad # snake_case = %r{^[\dA-Z_]+$} # # # bad # regex = %r{ # foo # (bar) # (baz) # }x # # # good # snake_case = /^[\dA-Z_]+$/ # # # good # regex = / # foo # (bar) # (baz) # /x # @example EnforcedStyle: percent_r # # bad # snake_case = /^[\dA-Z_]+$/ # # # bad # regex = / # foo # (bar) # (baz) # /x # # # good # snake_case = %r{^[\dA-Z_]+$} # # # good # regex = %r{ # foo # (bar) # (baz) # }x # @example EnforcedStyle: mixed # # bad # snake_case = %r{^[\dA-Z_]+$} # # # bad # regex = / # foo # (bar) # (baz) # /x # # # good # snake_case = /^[\dA-Z_]+$/ # # # good # regex = %r{ # foo # (bar) # (baz) # }x # @example AllowInnerSlashes: false (default) # # If `false`, the cop will always recommend using `%r` if one or more # # slashes are found in the regexp string. # # # bad # x =~ /home\// # # # good # x =~ %r{home/} # @example AllowInnerSlashes: true # # good # x =~ /home\// # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#84 class RuboCop::Cop::Style::RegexpLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#92 def on_regexp(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#138 def allow_inner_slashes?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#125 def allowed_mixed_percent_r?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#114 def allowed_mixed_slash?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#119 def allowed_percent_r_literal?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#109 def allowed_slash_literal?(node); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#207 def calculate_replacement(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#130 def contains_disallowed_slash?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#134 def contains_slash?(node); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#156 def correct_delimiters(node, corrector); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#162 def correct_inner_slashes(node, corrector); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#195 def inner_slash_after_correction(node); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#191 def inner_slash_before_correction(node); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#199 def inner_slash_for(opening_delimiter); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#178 def inner_slash_indices(node); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#142 def node_body(node, include_begin_nodes: T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#151 def preferred_delimiters; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#147 def slash_literal?(node); end end # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#90 RuboCop::Cop::Style::RegexpLiteral::MSG_USE_PERCENT_R = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/regexp_literal.rb#89 RuboCop::Cop::Style::RegexpLiteral::MSG_USE_SLASHES = T.let(T.unsafe(nil), String) # This cop checks for uses of rescue in its modifier form. # # The cop to check `rescue` in its modifier form is added for following # reasons: # # * The syntax of modifier form `rescue` can be misleading because it # might led us to believe that `rescue` handles the given exception # but it actually rescue all exceptions to return the given rescue # block. In this case, value returned by handle_error or # SomeException. # # * Modifier form `rescue` would rescue all the exceptions. It would # silently skip all exception or errors and handle the error. # Example: If `NoMethodError` is raised, modifier form rescue would # handle the exception. # # @example # # bad # some_method rescue handle_error # # # bad # some_method rescue SomeException # # # good # begin # some_method # rescue # handle_error # end # # # good # begin # some_method # rescue SomeException # handle_error # end # # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#42 class RuboCop::Cop::Style::RescueModifier < ::RuboCop::Cop::Cop include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::RescueNode # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#54 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#48 def on_resbody(node); end private # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#68 def corrected_block(node, parenthesized); end # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#81 def indentation_and_offset(node, parenthesized); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#64 def parenthesized?(node); end end # source://rubocop//lib/rubocop/cop/style/rescue_modifier.rb#46 RuboCop::Cop::Style::RescueModifier::MSG = T.let(T.unsafe(nil), String) # This cop checks for rescuing `StandardError`. There are two supported # styles `implicit` and `explicit`. This cop will not register an offense # if any error other than `StandardError` is specified. # # @example EnforcedStyle: implicit # # `implicit` will enforce using `rescue` instead of # # `rescue StandardError`. # # # bad # begin # foo # rescue StandardError # bar # end # # # good # begin # foo # rescue # bar # end # # # good # begin # foo # rescue OtherError # bar # end # # # good # begin # foo # rescue StandardError, SecurityError # bar # end # @example EnforcedStyle: explicit (default) # # `explicit` will enforce using `rescue StandardError` # # instead of `rescue`. # # # bad # begin # foo # rescue # bar # end # # # good # begin # foo # rescue StandardError # bar # end # # # good # begin # foo # rescue OtherError # bar # end # # # good # begin # foo # rescue StandardError, SecurityError # bar # end # # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#73 class RuboCop::Cop::Style::RescueStandardError < ::RuboCop::Cop::Base include ::RuboCop::Cop::RescueNode include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#92 def on_resbody(node); end # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#88 def rescue_standard_error?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#84 def rescue_without_error_class?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#120 def offense_for_exlicit_enforced_style(node); end # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#109 def offense_for_implicit_enforced_style(node, error); end end # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#81 RuboCop::Cop::Style::RescueStandardError::MSG_EXPLICIT = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/rescue_standard_error.rb#79 RuboCop::Cop::Style::RescueStandardError::MSG_IMPLICIT = T.let(T.unsafe(nil), String) # This cop enforces consistency between 'return nil' and 'return'. # # Supported styles are: return, return_nil. # # @example EnforcedStyle: return (default) # # bad # def foo(arg) # return nil if arg # end # # # good # def foo(arg) # return if arg # end # @example EnforcedStyle: return_nil # # bad # def foo(arg) # return if arg # end # # # good # def foo(arg) # return nil if arg # end # # source://rubocop//lib/rubocop/cop/style/return_nil.rb#31 class RuboCop::Cop::Style::ReturnNil < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/return_nil.rb#82 def chained_send?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/return_nil.rb#83 def define_method?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/return_nil.rb#41 def on_return(node); end # source://rubocop//lib/rubocop/cop/style/return_nil.rb#39 def return_nil_node?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/return_nil.rb#38 def return_node?(param0 = T.unsafe(nil)); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/return_nil.rb#73 def correct_style?(node); end # source://rubocop//lib/rubocop/cop/style/return_nil.rb#69 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/return_nil.rb#78 def scoped_node?(node); end end # source://rubocop//lib/rubocop/cop/style/return_nil.rb#35 RuboCop::Cop::Style::ReturnNil::RETURN_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/return_nil.rb#36 RuboCop::Cop::Style::ReturnNil::RETURN_NIL_MSG = T.let(T.unsafe(nil), String) # This cop transforms usages of a method call safeguarded by a non `nil` # check for the variable whose method is being called to # safe navigation (`&.`). If there is a method chain, all of the methods # in the chain need to be checked for safety, and all of the methods will # need to be changed to use safe navigation. We have limited the cop to # not register an offense for method chains that exceed 2 methods. # # Configuration option: ConvertCodeThatCanStartToReturnNil # The default for this is `false`. When configured to `true`, this will # check for code in the format `!foo.nil? && foo.bar`. As it is written, # the return of this code is limited to `false` and whatever the return # of the method is. If this is converted to safe navigation, # `foo&.bar` can start returning `nil` as well as what the method # returns. # # @example # # bad # foo.bar if foo # foo.bar.baz if foo # foo.bar(param1, param2) if foo # foo.bar { |e| e.something } if foo # foo.bar(param) { |e| e.something } if foo # # foo.bar if !foo.nil? # foo.bar unless !foo # foo.bar unless foo.nil? # # foo && foo.bar # foo && foo.bar.baz # foo && foo.bar(param1, param2) # foo && foo.bar { |e| e.something } # foo && foo.bar(param) { |e| e.something } # # # good # foo&.bar # foo&.bar&.baz # foo&.bar(param1, param2) # foo&.bar { |e| e.something } # foo&.bar(param) { |e| e.something } # foo && foo.bar.baz.qux # method chain with more than 2 methods # foo && foo.nil? # method that `nil` responds to # # # Method calls that do not use `.` # foo && foo < bar # foo < bar if foo # # # When checking `foo&.empty?` in a conditional, `foo` being `nil` will actually # # do the opposite of what the author intends. # foo && foo.empty? # # # This could start returning `nil` as well as the return of the method # foo.nil? || foo.bar # !foo || foo.bar # # # Methods that are used on assignment, arithmetic operation or # # comparison should not be converted to use safe navigation # foo.baz = bar if foo # foo.baz + bar if foo # foo.bar > 2 if foo # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#65 class RuboCop::Cop::Style::SafeNavigation < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods include ::RuboCop::Cop::NilMethods include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#103 def check_node(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#77 def modifier_if_safe_navigation_candidate(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#91 def not_nil_check?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#99 def on_and(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#93 def on_if(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#118 def use_var_only_in_unless_modifier?(node, variable); end private # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#262 def add_safe_nav_to_all_methods_in_chain(corrector, start_method, method_chain); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#151 def allowed_if_condition?(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#124 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#252 def begin_range(node, method_call); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#216 def chain_size(method_chain, method); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#144 def comments(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#257 def end_range(node, method_call); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#193 def extract_common_parts(method_chain, checked_variable); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#160 def extract_parts(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#181 def extract_parts_from_and(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#169 def extract_parts_from_if(node); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#202 def find_matching_receiver_invocation(method_chain, checked_variable); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#136 def handle_comments(corrector, node, method_call); end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#155 def method_call(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#248 def method_called?(send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#240 def negated?(send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#236 def unsafe_method?(send_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#224 def unsafe_method_used?(method_chain, method); end end # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#72 RuboCop::Cop::Style::SafeNavigation::LOGIC_JUMP_KEYWORDS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/safe_navigation.rb#70 RuboCop::Cop::Style::SafeNavigation::MSG = T.let(T.unsafe(nil), String) # This cop is used to identify usages of `shuffle.first`, # `shuffle.last`, and `shuffle[]` and change them to use # `sample` instead. # # @example # # bad # [1, 2, 3].shuffle.first # [1, 2, 3].shuffle.first(2) # [1, 2, 3].shuffle.last # [2, 1, 3].shuffle.at(0) # [2, 1, 3].shuffle.slice(0) # [1, 2, 3].shuffle[2] # [1, 2, 3].shuffle[0, 2] # sample(2) will do the same # [1, 2, 3].shuffle[0..2] # sample(3) will do the same # [1, 2, 3].shuffle(random: Random.new).first # # # good # [1, 2, 3].shuffle # [1, 2, 3].sample # [1, 2, 3].sample(3) # [1, 2, 3].shuffle[1, 3] # sample(3) might return a longer Array # [1, 2, 3].shuffle[1..3] # sample(3) might return a longer Array # [1, 2, 3].shuffle[foo, bar] # [1, 2, 3].shuffle(random: Random.new) # # source://rubocop//lib/rubocop/cop/style/sample.rb#30 class RuboCop::Cop::Style::Sample < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/sample.rb#40 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/sample.rb#36 def sample_candidate?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/sample.rb#120 def correction(shuffle_arg, method, method_args); end # source://rubocop//lib/rubocop/cop/style/sample.rb#136 def extract_source(args); end # source://rubocop//lib/rubocop/cop/style/sample.rb#114 def message(shuffle_arg, method, method_args, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/sample.rb#57 def offensive?(method, method_args); end # source://rubocop//lib/rubocop/cop/style/sample.rb#93 def range_size(range_node); end # source://rubocop//lib/rubocop/cop/style/sample.rb#127 def sample_arg(method, method_args); end # source://rubocop//lib/rubocop/cop/style/sample.rb#68 def sample_size(method_args); end # source://rubocop//lib/rubocop/cop/style/sample.rb#77 def sample_size_for_one_arg(arg); end # source://rubocop//lib/rubocop/cop/style/sample.rb#87 def sample_size_for_two_args(first, second); end # source://rubocop//lib/rubocop/cop/style/sample.rb#108 def source_range(shuffle_node, node); end end # source://rubocop//lib/rubocop/cop/style/sample.rb#33 RuboCop::Cop::Style::Sample::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/sample.rb#34 RuboCop::Cop::Style::Sample::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop enforces the use the shorthand for self-assignment. # # @example # # # bad # x = x + 1 # # # good # x += 1 # # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#15 class RuboCop::Cop::Style::SelfAssignment < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#33 def on_cvasgn(node); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#29 def on_ivasgn(node); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#25 def on_lvasgn(node); end private # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#94 def apply_autocorrect(corrector, node, rhs, operator, new_rhs); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#74 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#89 def autocorrect_boolean_node(corrector, node, rhs); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#84 def autocorrect_send_node(corrector, node, rhs); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#39 def check(node, var_type); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#62 def check_boolean_node(node, rhs, var_name, var_type); end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#50 def check_send_node(node, rhs, var_name, var_type); end class << self # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#21 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#18 RuboCop::Cop::Style::SelfAssignment::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/self_assignment.rb#19 RuboCop::Cop::Style::SelfAssignment::OPS = T.let(T.unsafe(nil), Array) # This cop checks for multiple expressions placed on the same line. # It also checks for lines terminated with a semicolon. # # This cop has `AllowAsExpressionSeparator` configuration option. # It allows `;` to separate several expressions on the same line. # # @example # # bad # foo = 1; bar = 2; # baz = 3; # # # good # foo = 1 # bar = 2 # baz = 3 # @example AllowAsExpressionSeparator: false (default) # # bad # foo = 1; bar = 2 # @example AllowAsExpressionSeparator: true # # good # foo = 1; bar = 2 # # source://rubocop//lib/rubocop/cop/style/semicolon.rb#29 class RuboCop::Cop::Style::Semicolon < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/semicolon.rb#43 def on_begin(node); end # source://rubocop//lib/rubocop/cop/style/semicolon.rb#35 def on_new_investigation; end private # source://rubocop//lib/rubocop/cop/style/semicolon.rb#72 def check_for_line_terminator_or_opener; end # source://rubocop//lib/rubocop/cop/style/semicolon.rb#87 def convention_on(line, column, autocorrect); end # source://rubocop//lib/rubocop/cop/style/semicolon.rb#76 def each_semicolon; end # source://rubocop//lib/rubocop/cop/style/semicolon.rb#83 def tokens_for_lines; end end # source://rubocop//lib/rubocop/cop/style/semicolon.rb#33 RuboCop::Cop::Style::Semicolon::MSG = T.let(T.unsafe(nil), String) # This cop checks for the use of the send method. # # @example # # bad # Foo.send(:bar) # quuz.send(:fred) # # # good # Foo.__send__(:bar) # quuz.public_send(:fred) # # source://rubocop//lib/rubocop/cop/style/send.rb#16 class RuboCop::Cop::Style::Send < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/send.rb#21 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/send.rb#21 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/send.rb#17 RuboCop::Cop::Style::Send::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/send.rb#19 RuboCop::Cop::Style::Send::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for uses of `fail` and `raise`. # # @example EnforcedStyle: only_raise (default) # # The `only_raise` style enforces the sole use of `raise`. # # bad # begin # fail # rescue Exception # # handle it # end # # def watch_out # fail # rescue Exception # # handle it # end # # Kernel.fail # # # good # begin # raise # rescue Exception # # handle it # end # # def watch_out # raise # rescue Exception # # handle it # end # # Kernel.raise # @example EnforcedStyle: only_fail # # The `only_fail` style enforces the sole use of `fail`. # # bad # begin # raise # rescue Exception # # handle it # end # # def watch_out # raise # rescue Exception # # handle it # end # # Kernel.raise # # # good # begin # fail # rescue Exception # # handle it # end # # def watch_out # fail # rescue Exception # # handle it # end # # Kernel.fail # @example EnforcedStyle: semantic # # The `semantic` style enforces the use of `fail` to signal an # # exception, then will use `raise` to trigger an offense after # # it has been rescued. # # bad # begin # raise # rescue Exception # # handle it # end # # def watch_out # # Error thrown # rescue Exception # fail # end # # Kernel.fail # Kernel.raise # # # good # begin # fail # rescue Exception # # handle it # end # # def watch_out # fail # rescue Exception # raise 'Preferably with descriptive message' # end # # explicit_receiver.fail # explicit_receiver.raise # # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#107 class RuboCop::Cop::Style::SignalException < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#118 def custom_fail_methods(param0); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#117 def kernel_call?(param0 = T.unsafe(nil), param1); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#121 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#126 def on_rescue(node); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#138 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#203 def allow(method_name, node); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#185 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#164 def check_scope(method_name, node); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#177 def check_send(method_name, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#197 def command_or_kernel_call?(name, node); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#209 def each_command_or_kernel_call(method_name, node); end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#153 def message(method_name); end end # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#111 RuboCop::Cop::Style::SignalException::FAIL_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#112 RuboCop::Cop::Style::SignalException::RAISE_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/signal_exception.rb#115 RuboCop::Cop::Style::SignalException::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # Sometimes using dig method ends up with just a single # argument. In such cases, dig should be replaced with []. # # @example # # bad # { key: 'value' }.dig(:key) # [1, 2, 3].dig(0) # # # good # { key: 'value' }[:key] # [1, 2, 3][0] # # # good # { key1: { key2: 'value' } }.dig(:key1, :key2) # [1, [2, [3]]].dig(1, 1) # # # good # keys = %i[key1 key2] # { key1: { key2: 'value' } }.dig(*keys) # # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#26 class RuboCop::Cop::Style::SingleArgumentDig < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#36 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#32 def single_argument_dig?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#29 RuboCop::Cop::Style::SingleArgumentDig::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/single_argument_dig.rb#30 RuboCop::Cop::Style::SingleArgumentDig::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks whether the block parameters of a single-line # method accepting a block match the names specified via configuration. # # For instance one can configure `reduce`(`inject`) to use |a, e| as # parameters. # # Configuration option: Methods # Should be set to use this cop. Array of hashes, where each key is the # method name and value - array of argument names. # # @example Methods: [{reduce: %w[a b]}] # # bad # foo.reduce { |c, d| c + d } # foo.reduce { |_, _d| 1 } # # # good # foo.reduce { |a, b| a + b } # foo.reduce { |a, _b| a } # foo.reduce { |a, (id, _)| a + id } # foo.reduce { true } # # # good # foo.reduce do |c, d| # c + d # end # # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#31 class RuboCop::Cop::Style::SingleLineBlockParams < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#34 def on_block(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#83 def args_match?(method_name, args); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#56 def eligible_arguments?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#60 def eligible_method?(node); end # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#49 def message(node); end # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#73 def method_name(method); end # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#69 def method_names; end # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#65 def methods; end # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#77 def target_args(method_name); end end # source://rubocop//lib/rubocop/cop/style/single_line_block_params.rb#32 RuboCop::Cop::Style::SingleLineBlockParams::MSG = T.let(T.unsafe(nil), String) # This cop checks for single-line method definitions that contain a body. # It will accept single-line methods with no body. # # @example # # bad # def some_method; body end # def link_to(url); {:name => url}; end # def @table.columns; super; end # # # good # def self.resource_class=(klass); end # def @table.columns; end # @example AllowIfMethodIsEmpty: true (default) # # good # def no_op; end # @example AllowIfMethodIsEmpty: false # # bad # def no_op; end # # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#27 class RuboCop::Cop::Style::SingleLineMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#33 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#33 def on_defs(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#61 def allow_empty?; end # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#45 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#65 def each_part(body); end # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#75 def move_comment(node, corrector); end end # source://rubocop//lib/rubocop/cop/style/single_line_methods.rb#31 RuboCop::Cop::Style::SingleLineMethods::MSG = T.let(T.unsafe(nil), String) # This cop checks that arrays are sliced with endless ranges instead of # `ary[start..-1]` on Ruby 2.6+. # # @example # # bad # items[1..-1] # # # good # items[1..] # # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#15 class RuboCop::Cop::Style::SlicingWithRange < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector extend ::RuboCop::Cop::TargetRubyVersion # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#26 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#24 def range_till_minus_one?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#21 RuboCop::Cop::Style::SlicingWithRange::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/slicing_with_range.rb#22 RuboCop::Cop::Style::SlicingWithRange::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # If the branch of a conditional consists solely of a conditional node, # its conditions can be combined with the conditions of the outer branch. # This helps to keep the nesting level from getting too deep. # # @example # # bad # if condition_a # if condition_b # do_something # end # end # # # good # if condition_a && condition_b # do_something # end # @example AllowModifier: false (default) # # bad # if condition_a # do_something if condition_b # end # @example AllowModifier: true # # good # if condition_a # do_something if condition_b # end # # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#35 class RuboCop::Cop::Style::SoleNestedConditional < ::RuboCop::Cop::Base # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#39 def on_if(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#60 def allow_modifier?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#51 def offending_branch?(branch); end end # source://rubocop//lib/rubocop/cop/style/sole_nested_conditional.rb#36 RuboCop::Cop::Style::SoleNestedConditional::MSG = T.let(T.unsafe(nil), String) # This cop looks for uses of Perl-style global variables. # # @example EnforcedStyle: use_english_names (default) # # good # puts $LOAD_PATH # puts $LOADED_FEATURES # puts $PROGRAM_NAME # puts $ERROR_INFO # puts $ERROR_POSITION # puts $FIELD_SEPARATOR # or $FS # puts $OUTPUT_FIELD_SEPARATOR # or $OFS # puts $INPUT_RECORD_SEPARATOR # or $RS # puts $OUTPUT_RECORD_SEPARATOR # or $ORS # puts $INPUT_LINE_NUMBER # or $NR # puts $LAST_READ_LINE # puts $DEFAULT_OUTPUT # puts $DEFAULT_INPUT # puts $PROCESS_ID # or $PID # puts $CHILD_STATUS # puts $LAST_MATCH_INFO # puts $IGNORECASE # puts $ARGV # or ARGV # puts $MATCH # puts $PREMATCH # puts $POSTMATCH # puts $LAST_PAREN_MATCH # @example EnforcedStyle: use_perl_names # # good # puts $: # puts $" # puts $0 # puts $! # puts $@ # puts $; # puts $, # puts $/ # puts $\ # puts $. # puts $_ # puts $> # puts $< # puts $$ # puts $? # puts $~ # puts $= # puts $* # puts $& # puts $` # puts $' # puts $+ # # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#59 class RuboCop::Cop::Style::SpecialGlobalVars < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#141 def autocorrect(corrector, node, global_var); end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#131 def message(global_var); end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#115 def on_gvar(node); end private # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#194 def english_name_replacement(preferred_name, node); end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#149 def format_english_message(global_var); end # For now, we assume that lists are 2 items or less. Easy grammar! # # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#171 def format_list(items); end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#157 def format_message(english, regular, global); end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#186 def preferred_names(global); end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#175 def replacement(node, global_var); end end # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#70 RuboCop::Cop::Style::SpecialGlobalVars::ENGLISH_VARS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#63 RuboCop::Cop::Style::SpecialGlobalVars::MSG_BOTH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#66 RuboCop::Cop::Style::SpecialGlobalVars::MSG_ENGLISH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#68 RuboCop::Cop::Style::SpecialGlobalVars::MSG_REGULAR = T.let(T.unsafe(nil), String) # Anything *not* in this set is provided by the English library. # # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#108 RuboCop::Cop::Style::SpecialGlobalVars::NON_ENGLISH_VARS = T.let(T.unsafe(nil), Set) # source://rubocop//lib/rubocop/cop/style/special_global_vars.rb#95 RuboCop::Cop::Style::SpecialGlobalVars::PERL_VARS = T.let(T.unsafe(nil), Hash) # Check for parentheses around stabby lambda arguments. # There are two different styles. Defaults to `require_parentheses`. # # @example EnforcedStyle: require_parentheses (default) # # bad # ->a,b,c { a + b + c } # # # good # ->(a,b,c) { a + b + c} # @example EnforcedStyle: require_no_parentheses # # bad # ->(a,b,c) { a + b + c } # # # good # ->a,b,c { a + b + c} # # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#22 class RuboCop::Cop::Style::StabbyLambdaParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#29 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#55 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#47 def missing_parentheses?(node); end # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#59 def missing_parentheses_corrector(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#74 def parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#51 def redundant_parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#70 def stabby_lambda_with_args?(node); end # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#63 def unwanted_parentheses_corrector(corrector, node); end end # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#27 RuboCop::Cop::Style::StabbyLambdaParentheses::MSG_NO_REQUIRE = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/stabby_lambda_parentheses.rb#26 RuboCop::Cop::Style::StabbyLambdaParentheses::MSG_REQUIRE = T.let(T.unsafe(nil), String) # This cop identifies places where `$stderr.puts` can be replaced by # `warn`. The latter has the advantage of easily being disabled by, # the `-W0` interpreter flag or setting `$VERBOSE` to `nil`. # # @example # # bad # $stderr.puts('hello') # # # good # warn('hello') # # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#17 class RuboCop::Cop::Style::StderrPuts < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#32 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#25 def stderr_puts?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#43 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#47 def stderr_gvar?(sym); end # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#51 def stderr_puts_range(send); end end # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#21 RuboCop::Cop::Style::StderrPuts::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/stderr_puts.rb#23 RuboCop::Cop::Style::StderrPuts::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for places where string concatenation # can be replaced with string interpolation. # # The cop can autocorrect simple cases but will skip autocorrecting # more complex cases where the resulting code would be harder to read. # In those cases, it might be useful to extract statements to local # variables or methods which you can then interpolate in a string. # # @example # # bad # email_with_name = user.name + ' <' + user.email + '>' # # # good # email_with_name = "#{user.name} <#{user.email}>" # email_with_name = format('%s <%s>', user.name, user.email) # # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#22 class RuboCop::Cop::Style::StringConcatenation < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#36 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#29 def string_concatenation?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#61 def collect_parts(node, parts); end # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#53 def find_topmost_plus_node(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#72 def plus_node?(node); end # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#83 def replacement(parts); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#100 def single_quoted?(str_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#76 def uncorrectable?(part); end end # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#26 RuboCop::Cop::Style::StringConcatenation::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/string_concatenation.rb#27 RuboCop::Cop::Style::StringConcatenation::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for the use of strings as keys in hashes. The use of # symbols is preferred instead. # # @example # # bad # { 'one' => 1, 'two' => 2, 'three' => 3 } # # # good # { one: 1, two: 2, three: 3 } # # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#15 class RuboCop::Cop::Style::StringHashKeys < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#36 def on_pair(node); end # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#24 def receive_environments_method?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#20 def string_hash_key?(param0 = T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/style/string_hash_keys.rb#18 RuboCop::Cop::Style::StringHashKeys::MSG = T.let(T.unsafe(nil), String) # Checks if uses of quotes match the configured preference. # # @example EnforcedStyle: single_quotes (default) # # bad # "No special symbols" # "No string interpolation" # "Just text" # # # good # 'No special symbols' # 'No string interpolation' # 'Just text' # "Wait! What's #{this}!" # @example EnforcedStyle: double_quotes # # bad # 'Just some text' # 'No special chars or interpolation' # # # good # "Just some text" # "No special chars or interpolation" # "Every string in #{project} uses double_quotes" # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#29 class RuboCop::Cop::Style::StringLiterals < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::StringHelp include ::RuboCop::Cop::StringLiteralsHelp # source://rubocop//lib/rubocop/cop/style/string_literals.rb#57 def autocorrect(node); end # source://rubocop//lib/rubocop/cop/style/string_literals.rb#35 def on_dstr(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#121 def accept_child_double_quotes?(nodes); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#63 def all_string_literals?(nodes); end # source://rubocop//lib/rubocop/cop/style/string_literals.rb#101 def check_multiline_quote_style(node, quote); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#97 def consistent_multiline?; end # source://rubocop//lib/rubocop/cop/style/string_literals.rb#67 def detect_quote_styles(node); end # source://rubocop//lib/rubocop/cop/style/string_literals.rb#79 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#89 def offense?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#117 def unexpected_double_quotes?(quote); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals.rb#113 def unexpected_single_quotes?(quote); end end # source://rubocop//lib/rubocop/cop/style/string_literals.rb#33 RuboCop::Cop::Style::StringLiterals::MSG_INCONSISTENT = T.let(T.unsafe(nil), String) # This cop checks that quotes inside the string interpolation # match the configured preference. # # @example EnforcedStyle: single_quotes (default) # # bad # result = "Tests #{success ? "PASS" : "FAIL"}" # # # good # result = "Tests #{success ? 'PASS' : 'FAIL'}" # @example EnforcedStyle: double_quotes # # bad # result = "Tests #{success ? 'PASS' : 'FAIL'}" # # # good # result = "Tests #{success ? "PASS" : "FAIL"}" # # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#22 class RuboCop::Cop::Style::StringLiteralsInInterpolation < ::RuboCop::Cop::Cop include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::StringHelp include ::RuboCop::Cop::StringLiteralsHelp # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#26 def autocorrect(node); end private # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#32 def message(_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/string_literals_in_interpolation.rb#39 def offense?(node); end end # This cop enforces the use of consistent method names # from the String class. # # @example # # bad # 'name'.intern # 'var'.unfavored_method # # # good # 'name'.to_sym # 'var'.preferred_method # # source://rubocop//lib/rubocop/cop/style/string_methods.rb#17 class RuboCop::Cop::Style::StringMethods < ::RuboCop::Cop::Base include ::RuboCop::Cop::MethodPreference extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/string_methods.rb#23 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/string_methods.rb#23 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/string_methods.rb#21 RuboCop::Cop::Style::StringMethods::MSG = T.let(T.unsafe(nil), String) # This cop identifies places where `lstrip.rstrip` can be replaced by # `strip`. # # @example # # bad # 'abc'.lstrip.rstrip # 'abc'.rstrip.lstrip # # # good # 'abc'.strip # # source://rubocop//lib/rubocop/cop/style/strip.rb#16 class RuboCop::Cop::Style::Strip < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/strip.rb#23 def lstrip_rstrip(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/strip.rb#28 def on_send(node); end end # source://rubocop//lib/rubocop/cop/style/strip.rb#20 RuboCop::Cop::Style::Strip::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/strip.rb#21 RuboCop::Cop::Style::Strip::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for inheritance from Struct.new. # # @example # # bad # class Person < Struct.new(:first_name, :last_name) # def age # 42 # end # end # # # good # Person = Struct.new(:first_name, :last_name) do # def age # 42 # end # end # # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#22 class RuboCop::Cop::Style::StructInheritance < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#29 def on_class(node); end # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#40 def struct_constructor?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#47 def correct_parent(parent, corrector); end end # source://rubocop//lib/rubocop/cop/style/struct_inheritance.rb#26 RuboCop::Cop::Style::StructInheritance::MSG = T.let(T.unsafe(nil), String) # This cop can check for array literals made up of symbols that are not # using the %i() syntax. # # Alternatively, it checks for symbol arrays using the %i() syntax on # projects which do not want to use that syntax. # # Configuration option: MinSize # If set, arrays with fewer elements than this value will not trigger the # cop. For example, a `MinSize` of `3` will not enforce a style on an # array of 2 or fewer elements. # # @example EnforcedStyle: percent (default) # # good # %i[foo bar baz] # # # bad # [:foo, :bar, :baz] # @example EnforcedStyle: brackets # # good # [:foo, :bar, :baz] # # # bad # %i[foo bar baz] # # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#30 class RuboCop::Cop::Style::SymbolArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::ArrayMinSize include ::RuboCop::Cop::ArraySyntax include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::PercentArray extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#44 def on_array(node); end private # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#63 def correct_bracketed(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#85 def symbol_without_quote?(string); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#56 def symbols_contain_spaces?(node); end # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#77 def to_symbol_literal(string); end class << self # Returns the value of attribute largest_brackets. # # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#41 def largest_brackets; end # Sets the attribute largest_brackets # # @param value the value to set the attribute largest_brackets to. # # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#41 def largest_brackets=(_arg0); end end end # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#38 RuboCop::Cop::Style::SymbolArray::ARRAY_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/symbol_array.rb#37 RuboCop::Cop::Style::SymbolArray::PERCENT_MSG = T.let(T.unsafe(nil), String) # This cop checks symbol literal syntax. # # @example # # # bad # :"symbol" # # # good # :symbol # # source://rubocop//lib/rubocop/cop/style/symbol_literal.rb#15 class RuboCop::Cop::Style::SymbolLiteral < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/symbol_literal.rb#20 def on_sym(node); end end # source://rubocop//lib/rubocop/cop/style/symbol_literal.rb#18 RuboCop::Cop::Style::SymbolLiteral::MSG = T.let(T.unsafe(nil), String) # Use symbols as procs when possible. # # @example # # bad # something.map { |s| s.upcase } # # # good # something.map(&:upcase) # # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#14 class RuboCop::Cop::Style::SymbolProc < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::IgnoredMethods extend ::RuboCop::Cop::AutoCorrector # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#49 def destructuring_block_argument?(argument_node); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#35 def on_block(node); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#23 def proc_node?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#24 def symbol_proc?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#66 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#79 def autocorrect_with_args(corrector, node, args, method_name); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#74 def autocorrect_without_args(corrector, node); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#94 def begin_pos_for_replacement(node); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#88 def block_range_with_space(node); end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#55 def register_offense(node, method_name, block_method_name); end class << self # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#31 def autocorrect_incompatible_with; end end end # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#19 RuboCop::Cop::Style::SymbolProc::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/symbol_proc.rb#21 RuboCop::Cop::Style::SymbolProc::SUPER_TYPES = T.let(T.unsafe(nil), Array) # Corrector to correct conditional assignment in ternary conditions. # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#502 class RuboCop::Cop::Style::TernaryCorrector extend ::RuboCop::Cop::Style::ConditionalAssignmentHelper extend ::RuboCop::Cop::Style::ConditionalCorrectorHelper class << self # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#507 def correct(corrector, node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#511 def move_assignment_inside_condition(corrector, node); end private # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#525 def correction(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#540 def element_assignment?(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#544 def extract_branches(node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#557 def move_branch_inside_condition(corrector, branch, assignment); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#552 def remove_parentheses(corrector, node); end # source://rubocop//lib/rubocop/cop/style/conditional_assignment.rb#529 def ternary(node); end end end # This cop checks for the presence of parentheses around ternary # conditions. It is configurable to enforce inclusion or omission of # parentheses using `EnforcedStyle`. Omission is only enforced when # removing the parentheses won't cause a different behavior. # # `AllowSafeAssignment` option for safe assignment. # By safe assignment we mean putting parentheses around # an assignment to indicate "I know I'm using an assignment # as a condition. It's not a mistake." # # @example EnforcedStyle: require_no_parentheses (default) # # bad # foo = (bar?) ? a : b # foo = (bar.baz?) ? a : b # foo = (bar && baz) ? a : b # # # good # foo = bar? ? a : b # foo = bar.baz? ? a : b # foo = bar && baz ? a : b # @example EnforcedStyle: require_parentheses # # bad # foo = bar? ? a : b # foo = bar.baz? ? a : b # foo = bar && baz ? a : b # # # good # foo = (bar?) ? a : b # foo = (bar.baz?) ? a : b # foo = (bar && baz) ? a : b # @example EnforcedStyle: require_parentheses_when_complex # # bad # foo = (bar?) ? a : b # foo = (bar.baz?) ? a : b # foo = bar && baz ? a : b # # # good # foo = bar? ? a : b # foo = bar.baz? ? a : b # foo = (bar && baz) ? a : b # @example AllowSafeAssignment: true (default) # # good # foo = (bar = baz) ? a : b # @example AllowSafeAssignment: false # # bad # foo = (bar = baz) ? a : b # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#57 class RuboCop::Cop::Style::TernaryParentheses < ::RuboCop::Cop::Base include ::RuboCop::Cop::SafeAssignment include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#194 def method_name(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#70 def on_if(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#81 def only_closing_parenthesis_is_last_line?(condition); end private # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#87 def autocorrect(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#185 def below_ternary_precedence?(child); end # If the condition is parenthesized we recurse and check for any # complex expressions within it. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#119 def complex_condition?(condition); end # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#199 def correct_parenthesized(corrector, condition); end # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#209 def correct_unparenthesized(corrector, condition); end # When this cop is configured to enforce parentheses and the # `RedundantParentheses` cop is enabled, it will cause an infinite loop # as they compete to add and remove the parentheses respectively. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#169 def infinite_loop?; end # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#140 def message(node); end # Anything that is not a variable, constant, or method/.method call # will be counted as a complex expression. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#129 def non_complex_expression?(condition); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#134 def non_complex_send?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#101 def offense?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#162 def parenthesized?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#158 def redundant_parentheses_enabled?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#150 def require_parentheses?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#154 def require_parentheses_when_complex?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#181 def unparenthesized_method_call?(child); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#174 def unsafe_autocorrect?(condition); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#213 def whitespace_after?(node); end end # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#66 RuboCop::Cop::Style::TernaryParentheses::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#67 RuboCop::Cop::Style::TernaryParentheses::MSG_COMPLEX = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#64 RuboCop::Cop::Style::TernaryParentheses::NON_COMPLEX_TYPES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/ternary_parentheses.rb#63 RuboCop::Cop::Style::TernaryParentheses::VARIABLE_TYPES = T.let(T.unsafe(nil), Set) # This cop checks for trailing code after the class definition. # # @example # # bad # class Foo; def foo; end # end # # # good # class Foo # def foo; end # end # # source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#18 class RuboCop::Cop::Style::TrailingBodyOnClass < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::TrailingBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#25 def on_class(node); end end # source://rubocop//lib/rubocop/cop/style/trailing_body_on_class.rb#23 RuboCop::Cop::Style::TrailingBodyOnClass::MSG = T.let(T.unsafe(nil), String) # This cop checks for trailing code after the method definition. # # @example # # bad # def some_method; do_stuff # end # # def f(x); b = foo # b[c: x] # end # # # good # def some_method # do_stuff # end # # def f(x) # b = foo # b[c: x] # end # # source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#27 class RuboCop::Cop::Style::TrailingBodyOnMethodDefinition < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::TrailingBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#35 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#35 def on_defs(node); end end # source://rubocop//lib/rubocop/cop/style/trailing_body_on_method_definition.rb#32 RuboCop::Cop::Style::TrailingBodyOnMethodDefinition::MSG = T.let(T.unsafe(nil), String) # This cop checks for trailing code after the module definition. # # @example # # bad # module Foo extend self # end # # # good # module Foo # extend self # end # # source://rubocop//lib/rubocop/cop/style/trailing_body_on_module.rb#18 class RuboCop::Cop::Style::TrailingBodyOnModule < ::RuboCop::Cop::Base include ::RuboCop::Cop::Alignment include ::RuboCop::Cop::TrailingBody extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_body_on_module.rb#25 def on_module(node); end end # source://rubocop//lib/rubocop/cop/style/trailing_body_on_module.rb#23 RuboCop::Cop::Style::TrailingBodyOnModule::MSG = T.let(T.unsafe(nil), String) # This cop checks for trailing comma in argument lists. # The supported styles are: # # * `consistent_comma`: Requires a comma after the last argument, # for all parenthesized method calls with arguments. # * `comma`: Requires a comma after the last argument, but only for # parenthesized method calls where each argument is on its own line. # * `no_comma`: Requires that there is no comma after the last # argument. # # @example EnforcedStyleForMultiline: consistent_comma # # bad # method(1, 2,) # # # good # method(1, 2) # # # good # method( # 1, 2, # 3, # ) # # # good # method( # 1, 2, 3, # ) # # # good # method( # 1, # 2, # ) # @example EnforcedStyleForMultiline: comma # # bad # method(1, 2,) # # # good # method(1, 2) # # # bad # method( # 1, 2, # 3, # ) # # # good # method( # 1, 2, # 3 # ) # # # bad # method( # 1, 2, 3, # ) # # # good # method( # 1, 2, 3 # ) # # # good # method( # 1, # 2, # ) # @example EnforcedStyleForMultiline: no_comma (default) # # bad # method(1, 2,) # # # good # method(1, 2) # # # good # method( # 1, # 2 # ) # # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#87 class RuboCop::Cop::Style::TrailingCommaInArguments < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::TrailingComma extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#91 def on_csend(node); end # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#91 def on_send(node); end class << self # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_arguments.rb#100 def autocorrect_incompatible_with; end end end # This cop checks for trailing comma in array literals. # The configuration options are: # # * `consistent_comma`: Requires a comma after the # last item of all non-empty, multiline array literals. # * `comma`: Requires a comma after last item in an array, # but only when each item is on its own line. # * `no_comma`: Does not requires a comma after the # last item in an array # # @example EnforcedStyleForMultiline: consistent_comma # # bad # a = [1, 2,] # # # good # a = [1, 2] # # # good # a = [ # 1, 2, # 3, # ] # # # good # a = [ # 1, 2, 3, # ] # # # good # a = [ # 1, # 2, # ] # @example EnforcedStyleForMultiline: comma # # bad # a = [1, 2,] # # # good # a = [1, 2] # # # bad # a = [ # 1, 2, # 3, # ] # # # good # a = [ # 1, 2, # 3 # ] # # # bad # a = [ # 1, 2, 3, # ] # # # good # a = [ # 1, 2, 3 # ] # # # good # a = [ # 1, # 2, # ] # @example EnforcedStyleForMultiline: no_comma (default) # # bad # a = [1, 2,] # # # good # a = [ # 1, # 2 # ] # # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_array_literal.rb#84 class RuboCop::Cop::Style::TrailingCommaInArrayLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::TrailingComma extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_array_literal.rb#88 def on_array(node); end end # This cop checks whether trailing commas in block arguments are # required. Blocks with only one argument and a trailing comma require # that comma to be present. Blocks with more than one argument never # require a trailing comma. # # @example # # bad # add { |foo, bar,| foo + bar } # # # good # add { |foo, bar| foo + bar } # # # good # add { |foo,| foo } # # # good # add { foo } # # # bad # add do |foo, bar,| # foo + bar # end # # # good # add do |foo, bar| # foo + bar # end # # # good # add do |foo,| # foo # end # # # good # add do # foo + bar # end # # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#43 class RuboCop::Cop::Style::TrailingCommaInBlockArgs < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#48 def on_block(node); end private # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#66 def arg_count(node); end # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#78 def argument_tokens(node); end # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#74 def last_comma(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#70 def trailing_comma?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#62 def useless_trailing_comma?(node); end end # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_block_args.rb#46 RuboCop::Cop::Style::TrailingCommaInBlockArgs::MSG = T.let(T.unsafe(nil), String) # This cop checks for trailing comma in hash literals. # The configuration options are: # # * `consistent_comma`: Requires a comma after the # last item of all non-empty, multiline hash literals. # * `comma`: Requires a comma after the last item in a hash, # but only when each item is on its own line. # * `no_comma`: Does not requires a comma after the # last item in a hash # # @example EnforcedStyleForMultiline: consistent_comma # # # bad # a = { foo: 1, bar: 2, } # # # good # a = { foo: 1, bar: 2 } # # # good # a = { # foo: 1, bar: 2, # qux: 3, # } # # # good # a = { # foo: 1, bar: 2, qux: 3, # } # # # good # a = { # foo: 1, # bar: 2, # } # @example EnforcedStyleForMultiline: comma # # # bad # a = { foo: 1, bar: 2, } # # # good # a = { foo: 1, bar: 2 } # # # bad # a = { # foo: 1, bar: 2, # qux: 3, # } # # # good # a = { # foo: 1, bar: 2, # qux: 3 # } # # # bad # a = { # foo: 1, bar: 2, qux: 3, # } # # # good # a = { # foo: 1, bar: 2, qux: 3 # } # # # good # a = { # foo: 1, # bar: 2, # } # @example EnforcedStyleForMultiline: no_comma (default) # # # bad # a = { foo: 1, bar: 2, } # # # good # a = { # foo: 1, # bar: 2 # } # # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb#87 class RuboCop::Cop::Style::TrailingCommaInHashLiteral < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::TrailingComma extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_comma_in_hash_literal.rb#91 def on_hash(node); end end # This cop checks for trailing code after the method definition. # # @example # # bad # def some_method # do_stuff; end # # def do_this(x) # baz.map { |b| b.this(x) } end # # def foo # block do # bar # end end # # # good # def some_method # do_stuff # end # # def do_this(x) # baz.map { |b| b.this(x) } # end # # def foo # block do # bar # end # end # # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#36 class RuboCop::Cop::Style::TrailingMethodEndStatement < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#42 def on_def(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#61 def body_and_end_on_same_line?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#55 def trailing_end?(node); end end # source://rubocop//lib/rubocop/cop/style/trailing_method_end_statement.rb#39 RuboCop::Cop::Style::TrailingMethodEndStatement::MSG = T.let(T.unsafe(nil), String) # This cop checks for extra underscores in variable assignment. # # @example # # bad # a, b, _ = foo() # a, b, _, = foo() # a, _, _ = foo() # a, _, _, = foo() # # # good # a, b, = foo() # a, = foo() # *a, b, _ = foo() # # => We need to know to not include 2 variables in a # a, *b, _ = foo() # # => The correction `a, *b, = foo()` is a syntax error # @example AllowNamedUnderscoreVariables: true (default) # # good # a, b, _something = foo() # @example AllowNamedUnderscoreVariables: false # # bad # a, b, _something = foo() # # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#31 class RuboCop::Cop::Style::TrailingUnderscoreVariable < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp include ::RuboCop::Cop::SurroundingSpace extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#40 def on_masgn(node); end private # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#91 def allow_named_underscore_variables; end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#126 def children_offenses(variables); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#56 def find_first_offense(variables); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#65 def find_first_possible_offense(variables); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#108 def main_node_offense(node); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#147 def range_for_parentheses(offense, left); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#87 def reverse_index(collection, item); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#79 def splat_variable_before?(first_offense, variables); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#96 def unneeded_ranges(node); end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#134 def unused_range(node_type, mlhs_node, right); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#130 def unused_variables_only?(offense, variables); end end # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#36 RuboCop::Cop::Style::TrailingUnderscoreVariable::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/trailing_underscore_variable.rb#38 RuboCop::Cop::Style::TrailingUnderscoreVariable::UNDERSCORE = T.let(T.unsafe(nil), String) # This cop looks for trivial reader/writer methods, that could # have been created with the attr_* family of functions automatically. # # @example # # bad # def foo # @foo # end # # def bar=(val) # @bar = val # end # # def self.baz # @baz # end # # # good # attr_reader :foo # attr_writer :bar # # class << self # attr_reader :baz # end # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#30 class RuboCop::Cop::Style::TrivialAccessors < ::RuboCop::Cop::Base include ::RuboCop::Cop::AllowedMethods extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#123 def looks_like_trivial_writer?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#36 def on_def(node); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#36 def on_defs(node); end private # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#156 def accessor(kind, method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#93 def allow_dsl_writers?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#89 def allow_predicates?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#128 def allowed_method_name?(node); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#101 def allowed_method_names; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#137 def allowed_reader?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#133 def allowed_writer?(method_name); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#74 def autocorrect(corrector, node); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#168 def autocorrect_class(corrector, node); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#160 def autocorrect_instance(corrector, node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#105 def dsl_writer?(method_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#85 def exact_name_match?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#97 def ignore_class_methods?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#47 def in_module_or_instance_eval?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#114 def looks_like_trivial_reader?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#141 def names_match?(node); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#61 def on_method_def(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#182 def top_level_node?(node); end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#147 def trivial_accessor_kind(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#109 def trivial_reader?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#118 def trivial_writer?(node); end end # source://rubocop//lib/rubocop/cop/style/trivial_accessors.rb#34 RuboCop::Cop::Style::TrivialAccessors::MSG = T.let(T.unsafe(nil), String) # This cop looks for `unless` expressions with `else` clauses. # # @example # # bad # unless foo_bar.nil? # # do something... # else # # do a different thing... # end # # # good # if foo_bar.present? # # do something... # else # # do a different thing... # end # # source://rubocop//lib/rubocop/cop/style/unless_else.rb#22 class RuboCop::Cop::Style::UnlessElse < ::RuboCop::Cop::Base include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/unless_else.rb#29 def on_if(node); end # source://rubocop//lib/rubocop/cop/style/unless_else.rb#42 def range_between_condition_and_else(node, condition); end # source://rubocop//lib/rubocop/cop/style/unless_else.rb#46 def range_between_else_and_end(node); end end # source://rubocop//lib/rubocop/cop/style/unless_else.rb#26 RuboCop::Cop::Style::UnlessElse::MSG = T.let(T.unsafe(nil), String) # This cop checks for accessing the first element of `String#unpack` # which can be replaced with the shorter method `unpack1`. # # @example # # # bad # 'foo'.unpack('h*').first # 'foo'.unpack('h*')[0] # 'foo'.unpack('h*').slice(0) # 'foo'.unpack('h*').at(0) # # # good # 'foo'.unpack1('h*') # # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#20 class RuboCop::Cop::Style::UnpackFirst < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#34 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#27 def unpack_and_first_element?(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#50 def first_element_range(node, unpack_call); end end # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#23 RuboCop::Cop::Style::UnpackFirst::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/unpack_first.rb#25 RuboCop::Cop::Style::UnpackFirst::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # This cop checks for variable interpolation (like "#@ivar"). # # @example # # bad # "His name is #$name" # /check #$pattern/ # "Let's go to the #@store" # # # good # "His name is #{$name}" # /check #{$pattern}/ # "Let's go to the #{@store}" # # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#18 class RuboCop::Cop::Style::VariableInterpolation < ::RuboCop::Cop::Base include ::RuboCop::Cop::Interpolation extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#25 def on_node_with_interpolations(node); end private # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#35 def message(range); end # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#39 def var_nodes(nodes); end end # source://rubocop//lib/rubocop/cop/style/variable_interpolation.rb#22 RuboCop::Cop::Style::VariableInterpolation::MSG = T.let(T.unsafe(nil), String) # This cop checks for `when;` uses in `case` expressions. # # @example # # bad # case foo # when 1; 'baz' # when 2; 'bar' # end # # # good # case foo # when 1 then 'baz' # when 2 then 'bar' # end # # source://rubocop//lib/rubocop/cop/style/when_then.rb#20 class RuboCop::Cop::Style::WhenThen < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/when_then.rb#25 def on_when(node); end end # source://rubocop//lib/rubocop/cop/style/when_then.rb#23 RuboCop::Cop::Style::WhenThen::MSG = T.let(T.unsafe(nil), String) # Checks for uses of `do` in multi-line `while/until` statements. # # @example # # # bad # while x.any? do # do_something(x.pop) # end # # # good # while x.any? # do_something(x.pop) # end # @example # # # bad # until x.empty? do # do_something(x.pop) # end # # # good # until x.empty? # do_something(x.pop) # end # # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#31 class RuboCop::Cop::Style::WhileUntilDo < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#36 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#36 def on_while(node); end end # source://rubocop//lib/rubocop/cop/style/while_until_do.rb#34 RuboCop::Cop::Style::WhileUntilDo::MSG = T.let(T.unsafe(nil), String) # Checks for while and until statements that would fit on one line # if written as a modifier while/until. The maximum line length is # configured in the `Layout/LineLength` cop. # # @example # # bad # while x < 10 # x += 1 # end # # # good # x += 1 while x < 10 # @example # # bad # until x > 10 # x += 1 # end # # # good # x += 1 until x > 10 # # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#27 class RuboCop::Cop::Style::WhileUntilModifier < ::RuboCop::Cop::Base include ::RuboCop::Cop::LineLengthHelp include ::RuboCop::Cop::StatementModifier extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#34 def on_until(node); end # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#34 def on_while(node); end end # source://rubocop//lib/rubocop/cop/style/while_until_modifier.rb#31 RuboCop::Cop::Style::WhileUntilModifier::MSG = T.let(T.unsafe(nil), String) # This cop can check for array literals made up of word-like # strings, that are not using the %w() syntax. # # Alternatively, it can check for uses of the %w() syntax, in projects # which do not want to include that syntax. # # Configuration option: MinSize # If set, arrays with fewer elements than this value will not trigger the # cop. For example, a `MinSize` of `3` will not enforce a style on an # array of 2 or fewer elements. # # @example EnforcedStyle: percent (default) # # good # %w[foo bar baz] # # # bad # ['foo', 'bar', 'baz'] # @example EnforcedStyle: brackets # # good # ['foo', 'bar', 'baz'] # # # bad # %w[foo bar baz] # # source://rubocop//lib/rubocop/cop/style/word_array.rb#30 class RuboCop::Cop::Style::WordArray < ::RuboCop::Cop::Base include ::RuboCop::Cop::ArrayMinSize include ::RuboCop::Cop::ArraySyntax include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::PercentArray extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/word_array.rb#44 def on_array(node); end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/word_array.rb#56 def complex_content?(strings); end # source://rubocop//lib/rubocop/cop/style/word_array.rb#68 def correct_bracketed(corrector, node); end # source://rubocop//lib/rubocop/cop/style/word_array.rb#64 def word_regex; end class << self # Returns the value of attribute largest_brackets. # # source://rubocop//lib/rubocop/cop/style/word_array.rb#41 def largest_brackets; end # Sets the attribute largest_brackets # # @param value the value to set the attribute largest_brackets to. # # source://rubocop//lib/rubocop/cop/style/word_array.rb#41 def largest_brackets=(_arg0); end end end # source://rubocop//lib/rubocop/cop/style/word_array.rb#38 RuboCop::Cop::Style::WordArray::ARRAY_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/word_array.rb#37 RuboCop::Cop::Style::WordArray::PERCENT_MSG = T.let(T.unsafe(nil), String) # This cop can either enforce or forbid Yoda conditions, # i.e. comparison operations where the order of expression is reversed. # eg. `5 == x` # # @example EnforcedStyle: forbid_for_all_comparison_operators (default) # # bad # 99 == foo # "bar" != foo # 42 >= foo # 10 < bar # # # good # foo == 99 # foo == "bar" # foo <= 42 # bar > 10 # "#{interpolation}" == foo # /#{interpolation}/ == foo # @example EnforcedStyle: forbid_for_equality_operators_only # # bad # 99 == foo # "bar" != foo # # # good # 99 >= foo # 3 < a && a < 5 # @example EnforcedStyle: require_for_all_comparison_operators # # bad # foo == 99 # foo == "bar" # foo <= 42 # bar > 10 # # # good # 99 == foo # "bar" != foo # 42 >= foo # 10 < bar # @example EnforcedStyle: require_for_equality_operators_only # # bad # 99 >= foo # 3 < a && a < 5 # # # good # 99 == foo # "bar" != foo # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#55 class RuboCop::Cop::Style::YodaCondition < ::RuboCop::Cop::Base include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#75 def file_constant_equal_program_name?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#79 def on_send(node); end private # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#128 def actual_code_range(node); end # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#121 def corrected_code(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#91 def enforce_yoda?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#96 def equality_only?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#154 def interpolation?(node); end # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#117 def message(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#138 def non_equality_operator?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#142 def noncommutative_operator?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#150 def program_name?(name); end # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#134 def reverse_comparison(operator); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#146 def source_file_path_constant?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#106 def valid_yoda?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#101 def yoda_compatible_condition?(node); end end # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#69 RuboCop::Cop::Style::YodaCondition::EQUALITY_OPERATORS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#60 RuboCop::Cop::Style::YodaCondition::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#71 RuboCop::Cop::Style::YodaCondition::NONCOMMUTATIVE_OPERATORS = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#73 RuboCop::Cop::Style::YodaCondition::PROGRAM_NAMES = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/yoda_condition.rb#62 RuboCop::Cop::Style::YodaCondition::REVERSE_COMPARISON = T.let(T.unsafe(nil), Hash) # This cop checks for numeric comparisons that can be replaced # by a predicate method, such as receiver.length == 0, # receiver.length > 0, receiver.length != 0, # receiver.length < 1 and receiver.size == 0 that can be # replaced by receiver.empty? and !receiver.empty?. # # @example # # bad # [1, 2, 3].length == 0 # 0 == "foobar".length # array.length < 1 # {a: 1, b: 2}.length != 0 # string.length > 0 # hash.size > 0 # # # good # [1, 2, 3].empty? # "foobar".empty? # array.empty? # !{a: 1, b: 2}.empty? # !string.empty? # !hash.empty? # # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#28 class RuboCop::Cop::Style::ZeroLengthPredicate < ::RuboCop::Cop::Base extend ::RuboCop::Cop::AutoCorrector # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#108 def non_polymorphic_collection?(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#81 def nonzero_length_predicate(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#37 def on_send(node); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#100 def other_receiver(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#74 def zero_length_predicate(param0 = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#93 def zero_length_receiver(param0 = T.unsafe(nil)); end private # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#59 def check_nonzero_length_predicate(node); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#44 def check_zero_length_predicate(node); end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#86 def replacement(node); end end # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#32 RuboCop::Cop::Style::ZeroLengthPredicate::NONZERO_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#35 RuboCop::Cop::Style::ZeroLengthPredicate::RESTRICT_ON_SEND = T.let(T.unsafe(nil), Array) # source://rubocop//lib/rubocop/cop/style/zero_length_predicate.rb#31 RuboCop::Cop::Style::ZeroLengthPredicate::ZERO_MSG = T.let(T.unsafe(nil), String) # Common functionality for checking and correcting surrounding whitespace. # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#6 module RuboCop::Cop::SurroundingSpace include ::RuboCop::Cop::RangeHelp private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#107 def empty_brackets?(left_bracket_token, right_bracket_token); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#101 def empty_offense(node, range, message, command); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#91 def empty_offenses(node, left, right, message); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#66 def extra_space?(token, side); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#125 def no_space_between?(left_bracket_token, right_bracket_token); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#38 def no_space_offenses(node, left_token, right_token, message, start_ok: T.unsafe(nil), end_ok: T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#117 def offending_empty_no_space?(config, left_token, right_token); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#113 def offending_empty_space?(config, left_token, right_token); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#33 def on_new_investigation; end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#76 def reposition(src, pos, step); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#16 def side_space_range(range:, side:); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#121 def space_between?(left_bracket_token, right_bracket_token); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#82 def space_offense(node, token, side, message, command); end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#52 def space_offenses(node, left_token, right_token, message, start_ok: T.unsafe(nil), end_ok: T.unsafe(nil)); end end # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#9 RuboCop::Cop::SurroundingSpace::NO_SPACE_COMMAND = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#12 RuboCop::Cop::SurroundingSpace::SINGLE_SPACE_REGEXP = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/mixin/surrounding_space.rb#10 RuboCop::Cop::SurroundingSpace::SPACE_COMMAND = T.let(T.unsafe(nil), String) # Common functionality for checking target ruby version. # # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#6 module RuboCop::Cop::TargetRubyVersion # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#11 def minimum_target_ruby_version(version); end # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#7 def required_minimum_ruby_version; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/target_ruby_version.rb#15 def support_target_ruby_version?(version); end end # A group of cops, ready to be called on duty to inspect files. # Team is responsible for selecting only relevant cops to be sent on duty, # as well as insuring that the needed forces are sent along with them. # # For performance reasons, Team will first dispatch cops & forces in two groups, # first the ones needed for autocorrection (if any), then the rest # (unless autocorrections happened). # # source://rubocop//lib/rubocop/cop/team.rb#12 class RuboCop::Cop::Team # @return [Team] a new instance of Team # # source://rubocop//lib/rubocop/cop/team.rb#17 def initialize(cops, config = T.unsafe(nil), options = T.unsafe(nil)); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/team.rb#51 def autocorrect?; end # Returns the value of attribute cops. # # source://rubocop//lib/rubocop/cop/team.rb#13 def cops; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/team.rb#55 def debug?; end # Returns the value of attribute errors. # # source://rubocop//lib/rubocop/cop/team.rb#13 def errors; end # source://rubocop//lib/rubocop/cop/team.rb#110 def external_dependency_checksum; end # @deprecated # # source://rubocop//lib/rubocop/cop/team.rb#94 def forces; end # source://rubocop//lib/rubocop/cop/team.rb#61 def inspect_file(processed_source); end # @return [Commissioner::InvestigationReport] # # source://rubocop//lib/rubocop/cop/team.rb#66 def investigate(processed_source); end # Returns the value of attribute updated_source_file. # # source://rubocop//lib/rubocop/cop/team.rb#13 def updated_source_file; end # Returns the value of attribute updated_source_file. # # source://rubocop//lib/rubocop/cop/team.rb#13 def updated_source_file?; end # Returns the value of attribute warnings. # # source://rubocop//lib/rubocop/cop/team.rb#13 def warnings; end private # source://rubocop//lib/rubocop/cop/team.rb#117 def autocorrect(processed_source, report); end # source://rubocop//lib/rubocop/cop/team.rb#176 def autocorrect_report(report); end # source://rubocop//lib/rubocop/cop/team.rb#136 def be_ready; end # source://rubocop//lib/rubocop/cop/team.rb#182 def collate_corrections(report); end # source://rubocop//lib/rubocop/cop/team.rb#194 def each_corrector(report); end # source://rubocop//lib/rubocop/cop/team.rb#244 def handle_error(error, location, cop); end # source://rubocop//lib/rubocop/cop/team.rb#236 def handle_warning(error, location); end # @return [Commissioner::InvestigationReport] # # source://rubocop//lib/rubocop/cop/team.rb#150 def investigate_partial(cops, processed_source); end # source://rubocop//lib/rubocop/cop/team.rb#221 def process_errors(file, errors); end # source://rubocop//lib/rubocop/cop/team.rb#144 def reset; end # @return [Array] # # source://rubocop//lib/rubocop/cop/team.rb#156 def roundup_relevant_cops(filename); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/team.rb#170 def support_target_rails_version?(cop); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/team.rb#164 def support_target_ruby_version?(cop); end # source://rubocop//lib/rubocop/cop/team.rb#209 def suppress_clobbering; end # source://rubocop//lib/rubocop/cop/team.rb#215 def validate_config; end class << self # @return [Array] needed for the given cops # # source://rubocop//lib/rubocop/cop/team.rb#99 def forces_for(cops); end # @return [Team] with cops assembled from the given `cop_classes` # # source://rubocop//lib/rubocop/cop/team.rb#36 def mobilize(cop_classes, config, options = T.unsafe(nil)); end # @return [Array] # # source://rubocop//lib/rubocop/cop/team.rb#42 def mobilize_cops(cop_classes, config, options = T.unsafe(nil)); end # @return [Team] # # source://rubocop//lib/rubocop/cop/team.rb#28 def new(cop_or_classes, config, options = T.unsafe(nil)); end end end # Common methods shared by TrailingBody cops # # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#6 module RuboCop::Cop::TrailingBody # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#13 def body_on_first_line?(node, body); end # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#17 def first_part_of(body); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_body.rb#7 def trailing_body?(node); end end # Common methods shared by Style/TrailingCommaInArguments and # Style/TrailingCommaInLiteral # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#7 module RuboCop::Cop::TrailingComma include ::RuboCop::Cop::ConfigurableEnforcedStyle include ::RuboCop::Cop::RangeHelp private # A single argument with the closing bracket on the same line as the end # of the argument is not considered multiline, even if the argument # itself might span multiple lines. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#105 def allowed_multiline_argument?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#168 def any_heredoc?(items); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#160 def autocorrect_range(item); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#134 def avoid_comma(kind, comma_begin_pos, extra_info); end # Returns true if the node has round/square/curly brackets. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#82 def brackets?(node); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#19 def check(node, items, kind, begin_pos, end_pos); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#37 def check_comma(node, kind, comma_pos); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#43 def check_literal(node, kind); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#30 def comma_offset(items, range); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#109 def elements(node); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#54 def extra_avoid_comma_info; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#172 def heredoc?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#190 def heredoc_send?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#76 def inside_comment?(range, comma_offset); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#93 def method_name_and_arguments_on_same_line?(node); end # Returns true if the round/square/curly brackets of the given node are # on different lines, each item within is on its own line, and the # closing bracket is on its own line. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#89 def multiline?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#124 def no_elements_on_same_line?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#130 def on_same_line?(range1, range2); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#148 def put_comma(items, kind); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#65 def should_have_comma?(style, node); end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#15 def style_parameter_name; end end # source://rubocop//lib/rubocop/cop/mixin/trailing_comma.rb#11 RuboCop::Cop::TrailingComma::MSG = T.let(T.unsafe(nil), String) # Common functionality shared by Uncommunicative cops # # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#6 module RuboCop::Cop::UncommunicativeName # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#14 def check(node, args); end private # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#97 def allow_nums; end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#89 def allowed_names; end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#78 def arg_range(arg, length); end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#43 def case_offense(node, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#64 def ends_with_num?(name); end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#93 def forbidden_names; end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#85 def forbidden_offense(node, range, name); end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#34 def issue_offenses(node, range, name); end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#68 def length_offense(node, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#74 def long_enough?(name); end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#101 def min_length; end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#51 def name_type(node); end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#60 def num_offense(node, range); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#47 def uppercase?(name); end end # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#7 RuboCop::Cop::UncommunicativeName::CASE_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#11 RuboCop::Cop::UncommunicativeName::FORBIDDEN_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#9 RuboCop::Cop::UncommunicativeName::LENGTH_MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/cop/mixin/uncommunicative_name.rb#8 RuboCop::Cop::UncommunicativeName::NUM_MSG = T.let(T.unsafe(nil), String) # This auto-corrects unused arguments. # # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#6 class RuboCop::Cop::UnusedArgCorrector extend ::RuboCop::Cop::RangeHelp class << self # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#12 def correct(corrector, processed_source, node); end # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#31 def correct_for_blockarg_type(corrector, node); end # Returns the value of attribute processed_source. # # source://rubocop//lib/rubocop/cop/correctors/unused_arg_corrector.rb#10 def processed_source; end end end # This module contains a collection of useful utility methods. # # source://rubocop//lib/rubocop/cop/util.rb#6 module RuboCop::Cop::Util include ::RuboCop::PathUtil private # source://rubocop//lib/rubocop/cop/util.rb#35 def add_parentheses(node, corrector); end # source://rubocop//lib/rubocop/cop/util.rb#44 def args_begin(node); end # source://rubocop//lib/rubocop/cop/util.rb#51 def args_end(node); end # source://rubocop//lib/rubocop/cop/util.rb#64 def begins_its_line?(range); end # This is a bad API # # source://rubocop//lib/rubocop/cop/util.rb#17 def comment_line?(line_source); end # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment?` or similar # # source://rubocop//lib/rubocop/cop/util.rb#22 def comment_lines?(node); end # source://rubocop//lib/rubocop/cop/util.rb#134 def compatible_external_encoding_for?(src); end # If converting a string to Ruby string literal source code, must # double quotes be used? # # source://rubocop//lib/rubocop/cop/util.rb#86 def double_quotes_required?(string); end # source://rubocop//lib/rubocop/cop/util.rb#100 def escape_string(string); end # Returns, for example, a bare `if` node if the given node is an `if` # with calls chained to the end of it. # # source://rubocop//lib/rubocop/cop/util.rb#70 def first_part_of_call_chain(node); end # source://rubocop//lib/rubocop/cop/util.rb#116 def interpret_string_escapes(string); end # source://rubocop//lib/rubocop/cop/util.rb#26 def line_range(node); end # source://rubocop//lib/rubocop/cop/util.rb#96 def needs_escaping?(string); end # source://rubocop//lib/rubocop/cop/util.rb#55 def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end # source://rubocop//lib/rubocop/cop/util.rb#30 def parentheses?(node); end # source://rubocop//lib/rubocop/cop/util.rb#120 def same_line?(node1, node2); end # source://rubocop//lib/rubocop/cop/util.rb#104 def to_string_literal(string); end # source://rubocop//lib/rubocop/cop/util.rb#126 def to_supported_styles(enforced_style); end # source://rubocop//lib/rubocop/cop/util.rb#112 def trim_string_interporation_escape_character(str); end class << self # source://rubocop//lib/rubocop/cop/util.rb#35 def add_parentheses(node, corrector); end # source://rubocop//lib/rubocop/cop/util.rb#44 def args_begin(node); end # source://rubocop//lib/rubocop/cop/util.rb#51 def args_end(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#64 def begins_its_line?(range); end # This is a bad API # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#17 def comment_line?(line_source); end # @deprecated Use `ProcessedSource#line_with_comment?`, `contains_comment?` or similar # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#22 def comment_lines?(node); end # If converting a string to Ruby string literal source code, must # double quotes be used? # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#86 def double_quotes_required?(string); end # source://rubocop//lib/rubocop/cop/util.rb#100 def escape_string(string); end # Returns, for example, a bare `if` node if the given node is an `if` # with calls chained to the end of it. # # source://rubocop//lib/rubocop/cop/util.rb#70 def first_part_of_call_chain(node); end # source://rubocop//lib/rubocop/cop/util.rb#116 def interpret_string_escapes(string); end # source://rubocop//lib/rubocop/cop/util.rb#26 def line_range(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#96 def needs_escaping?(string); end # @yield [sexp] # # source://rubocop//lib/rubocop/cop/util.rb#55 def on_node(syms, sexp, excludes = T.unsafe(nil), &block); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#30 def parentheses?(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/util.rb#120 def same_line?(node1, node2); end # source://rubocop//lib/rubocop/cop/util.rb#104 def to_string_literal(string); end # source://rubocop//lib/rubocop/cop/util.rb#126 def to_supported_styles(enforced_style); end # source://rubocop//lib/rubocop/cop/util.rb#112 def trim_string_interporation_escape_character(str); end end end # Match literal regex characters, not including anchors, character # classes, alternatives, groups, repetitions, references, etc # # source://rubocop//lib/rubocop/cop/util.rb#11 RuboCop::Cop::Util::LITERAL_REGEX = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#5 module RuboCop::Cop::Utils; end # Parses {Kernel#sprintf} format strings. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#7 class RuboCop::Cop::Utils::FormatString # @return [FormatString] a new instance of FormatString # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#91 def initialize(string); end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#95 def format_sequences; end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#107 def max_digit_dollar_num; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#103 def named_interpolation?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#99 def valid?; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#119 def mixed_formats?; end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#113 def parse; end end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#8 RuboCop::Cop::Utils::FormatString::DIGIT_DOLLAR = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#9 RuboCop::Cop::Utils::FormatString::FLAG = T.let(T.unsafe(nil), Regexp) # The syntax of a format sequence is as follows. # # ``` # %[flags][width][.precision]type # ``` # # A format sequence consists of a percent sign, followed by optional # flags, width, and precision indicators, then terminated with a field # type character. # # For more complex formatting, Ruby supports a reference by name. # # @see https://ruby-doc.org/core-2.6.3/Kernel.html#method-i-format # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#43 class RuboCop::Cop::Utils::FormatString::FormatSequence # @return [FormatSequence] a new instance of FormatSequence # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#46 def initialize(match); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#61 def annotated?; end # Number of arguments required for the format sequence # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#70 def arity; end # Returns the value of attribute begin_pos. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def begin_pos; end # Returns the value of attribute end_pos. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def end_pos; end # Returns the value of attribute flags. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def flags; end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#74 def max_digit_dollar_num; end # Returns the value of attribute name. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def name; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#57 def percent?; end # Returns the value of attribute precision. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def precision; end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#80 def style; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#65 def template?; end # Returns the value of attribute type. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def type; end # Returns the value of attribute width. # # source://rubocop//lib/rubocop/cop/utils/format_string.rb#44 def width; end end # source://rubocop//lib/rubocop/cop/utils/format_string.rb#15 RuboCop::Cop::Utils::FormatString::NAME = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#11 RuboCop::Cop::Utils::FormatString::NUMBER = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#10 RuboCop::Cop::Utils::FormatString::NUMBER_ARG = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#13 RuboCop::Cop::Utils::FormatString::PRECISION = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#18 RuboCop::Cop::Utils::FormatString::SEQUENCE = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#16 RuboCop::Cop::Utils::FormatString::TEMPLATE_NAME = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#14 RuboCop::Cop::Utils::FormatString::TYPE = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/cop/utils/format_string.rb#12 RuboCop::Cop::Utils::FormatString::WIDTH = T.let(T.unsafe(nil), Regexp) # This force provides a way to track local variables and scopes of Ruby. # Cops interact with this force need to override some of the hook methods. # # def before_entering_scope(scope, variable_table) # end # # def after_entering_scope(scope, variable_table) # end # # def before_leaving_scope(scope, variable_table) # end # # def after_leaving_scope(scope, variable_table) # end # # def before_declaring_variable(variable, variable_table) # end # # def after_declaring_variable(variable, variable_table) # end # # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#27 class RuboCop::Cop::VariableForce < ::RuboCop::Cop::Force # Starting point. # # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#77 def investigate(processed_source); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#86 def process_node(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#72 def variable_table; end private # source://rubocop//lib/rubocop/cop/variable_force.rb#392 def after_declaring_variable(arg); end # source://rubocop//lib/rubocop/cop/variable_force.rb#392 def after_entering_scope(arg); end # source://rubocop//lib/rubocop/cop/variable_force.rb#392 def after_leaving_scope(arg); end # source://rubocop//lib/rubocop/cop/variable_force.rb#392 def before_declaring_variable(arg); end # source://rubocop//lib/rubocop/cop/variable_force.rb#392 def before_entering_scope(arg); end # source://rubocop//lib/rubocop/cop/variable_force.rb#392 def before_leaving_scope(arg); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#360 def descendant_reference(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#350 def each_descendant_reference(loop_node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#335 def find_variables_in_loop(loop_node); end # This is called for each scope recursively. # # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#95 def inspect_variables_in_scope(scope_node); end # Mark all assignments which are referenced in the same loop # as referenced by ignoring AST order since they would be referenced # in next iteration. # # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#315 def mark_assignments_as_referenced_in_loop(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#114 def node_handler_method_name(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#101 def process_children(origin_node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#249 def process_loop(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#172 def process_regexp_named_captures(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#264 def process_rescue(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#283 def process_scope(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#302 def process_send(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#154 def process_variable_assignment(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#142 def process_variable_declaration(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#237 def process_variable_multiple_assignment(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#202 def process_variable_operator_assignment(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#244 def process_variable_referencing(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#275 def process_zero_arity_super(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#192 def regexp_captured_names(node); end # Use Node#equal? for accurate check. # # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force.rb#373 def scanned_node?(node); end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#379 def scanned_nodes; end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#109 def skip_children!; end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#296 def twisted_nodes(node); end end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#33 RuboCop::Cop::VariableForce::ARGUMENT_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) # This class represents each assignment of a variable. # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#7 class RuboCop::Cop::VariableForce::Assignment include ::RuboCop::Cop::VariableForce::Branchable # @return [Assignment] a new instance of Assignment # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#16 def initialize(node, variable); end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#67 def meta_assignment_node; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#56 def multiple_assignment?; end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#29 def name; end # Returns the value of attribute node. # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 def node; end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#62 def operator; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#50 def operator_assignment?; end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#37 def reference!(node); end # Returns the value of attribute referenced. # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 def referenced; end # Returns the value of attribute referenced. # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 def referenced?; end # Returns the value of attribute references. # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 def references; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#46 def regexp_named_capture?; end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#33 def scope; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#42 def used?; end # Returns the value of attribute variable. # # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#12 def variable; end private # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#86 def multiple_assignment_node; end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#78 def operator_assignment_node; end end # source://rubocop//lib/rubocop/cop/variable_force/assignment.rb#10 RuboCop::Cop::VariableForce::Assignment::MULTIPLE_LEFT_HAND_SIDE_TYPE = T.let(T.unsafe(nil), Symbol) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#66 class RuboCop::Cop::VariableForce::AssignmentReference < ::Struct # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force.rb#67 def assignment?; end # Returns the value of attribute node # # @return [Object] the current value of node def node; end # Sets the attribute node # # @param value [Object] the value to set the attribute node to. # @return [Object] the newly set value def node=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # Namespace for branch classes for each control structure. # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#7 module RuboCop::Cop::VariableForce::Branch class << self # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#8 def of(target_node, scope: T.unsafe(nil)); end end end # left_body && right_body # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#251 class RuboCop::Cop::VariableForce::Branch::And < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::LogicalOperator # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def left_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def right_body?; end end # Abstract base class for branch classes. # A branch represents a conditional branch in a scope. # # @example # def some_scope # do_something # no branch # # if foo # do_something # branch A # do_something # branch A # else # do_something # branch B # if bar # do_something # branch C (whose parent is branch B) # end # end # # do_something # no branch # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#42 class RuboCop::Cop::VariableForce::Branch::Base < ::Struct # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#121 def ==(other); end # @raise [NotImplementedError] # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#92 def always_run?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#88 def branched?; end # Returns the value of attribute child_node # # @return [Object] the current value of child_node def child_node; end # Sets the attribute child_node # # @param value [Object] the value to set the attribute child_node to. # @return [Object] the newly set value def child_node=(_); end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#70 def control_node; end # @yield [_self] # @yieldparam _self [RuboCop::Cop::VariableForce::Branch::Base] the object that the method was called on # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#80 def each_ancestor(include_self: T.unsafe(nil), &block); end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#121 def eql?(other); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#104 def exclusive_with?(other); end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#130 def hash; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#96 def may_jump_to_other_branch?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#100 def may_run_incompletely?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#74 def parent; end # Returns the value of attribute scope # # @return [Object] the current value of scope def scope; end # Sets the attribute scope # # @param value [Object] the value to set the attribute scope to. # @return [Object] the newly set value def scope=(_); end private # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#136 def scan_ancestors; end class << self def [](*_arg0); end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#43 def classes; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#56 def define_predicate(name, child_index: T.unsafe(nil)); end # @private # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#47 def inherited(subclass); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#52 def type; end end end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#311 RuboCop::Cop::VariableForce::Branch::CLASSES_BY_TYPE = T.let(T.unsafe(nil), Hash) # case target # when /pattern/ # when_clause # else # else_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#220 class RuboCop::Cop::VariableForce::Branch::Case < ::RuboCop::Cop::VariableForce::Branch::Base # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#225 def always_run?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def else_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def target?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def when_clause?; end end # begin # main_body # ensure # ensure_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#300 class RuboCop::Cop::VariableForce::Branch::Ensure < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::ExceptionHandler # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#306 def always_run?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def ensure_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def main_body?; end end # Mix-in module for exception handling control structures. # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#267 module RuboCop::Cop::VariableForce::Branch::ExceptionHandler # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#268 def may_jump_to_other_branch?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#272 def may_run_incompletely?; end end # for element in collection # loop_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#233 class RuboCop::Cop::VariableForce::Branch::For < ::RuboCop::Cop::VariableForce::Branch::Base # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#238 def always_run?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def collection?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def element?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def loop_body?; end end # if conditional_clause # truthy_body # else # falsey_body # end # # unless conditional_clause # falsey_body # else # truthy_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#167 class RuboCop::Cop::VariableForce::Branch::If < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def conditional_clause?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def falsey_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def truthy_body?; end end # Mix-in module for logical operator control structures. # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#244 module RuboCop::Cop::VariableForce::Branch::LogicalOperator # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#245 def always_run?; end end # left_body || right_body # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#259 class RuboCop::Cop::VariableForce::Branch::Or < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::LogicalOperator # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def left_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def right_body?; end end # begin # main_body # rescue StandardError => error # rescue_clause # else # else_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#283 class RuboCop::Cop::VariableForce::Branch::Rescue < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::ExceptionHandler # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#290 def always_run?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def else_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def main_body?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def rescue_clause?; end end # Mix-in module for simple conditional control structures. # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#146 module RuboCop::Cop::VariableForce::Branch::SimpleConditional # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#151 def always_run?; end # @raise [NotImplementedError] # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#147 def conditional_clause?; end end # until conditional_clause # loop_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#188 class RuboCop::Cop::VariableForce::Branch::Until < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def conditional_clause?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def loop_body?; end end # begin # loop_body # end until conditional_clause # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#208 class RuboCop::Cop::VariableForce::Branch::UntilPost < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def conditional_clause?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def loop_body?; end end # while conditional_clause # loop_body # end # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#178 class RuboCop::Cop::VariableForce::Branch::While < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def conditional_clause?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def loop_body?; end end # begin # loop_body # end while conditional_clause # # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#198 class RuboCop::Cop::VariableForce::Branch::WhilePost < ::RuboCop::Cop::VariableForce::Branch::Base include ::RuboCop::Cop::VariableForce::Branch::SimpleConditional # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def conditional_clause?; end # source://rubocop//lib/rubocop/cop/variable_force/branch.rb#57 def loop_body?; end end # Mix-in module for classes which own a node and need branch information # of the node. The user classes must implement #node and #scope. # # source://rubocop//lib/rubocop/cop/variable_force/branchable.rb#8 module RuboCop::Cop::VariableForce::Branchable # source://rubocop//lib/rubocop/cop/variable_force/branchable.rb#9 def branch; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/branchable.rb#15 def run_exclusively_with?(other); end end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#40 RuboCop::Cop::VariableForce::LOGICAL_OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#49 RuboCop::Cop::VariableForce::LOOP_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#44 RuboCop::Cop::VariableForce::MULTIPLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#41 RuboCop::Cop::VariableForce::OPERATOR_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#48 RuboCop::Cop::VariableForce::POST_CONDITION_LOOP_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#29 RuboCop::Cop::VariableForce::REGEXP_NAMED_CAPTURE_TYPE = T.let(T.unsafe(nil), Symbol) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#51 RuboCop::Cop::VariableForce::RESCUE_TYPE = T.let(T.unsafe(nil), Symbol) # This class represents each reference of a variable. # # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#7 class RuboCop::Cop::VariableForce::Reference include ::RuboCop::Cop::VariableForce::Branchable # @return [Reference] a new instance of Reference # # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#18 def initialize(node, scope); end # There's an implicit variable reference by the zero-arity `super`: # # def some_method(foo) # super # end # # Another case is `binding`: # # def some_method(foo) # do_something(binding) # end # # In these cases, the variable `foo` is not explicitly referenced, # but it can be considered used implicitly by the `super` or `binding`. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#43 def explicit?; end # Returns the value of attribute node. # # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#16 def node; end # Returns the value of attribute scope. # # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#16 def scope; end end # source://rubocop//lib/rubocop/cop/variable_force/reference.rb#10 RuboCop::Cop::VariableForce::Reference::VARIABLE_REFERENCE_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#56 RuboCop::Cop::VariableForce::SCOPE_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#58 RuboCop::Cop::VariableForce::SEND_TYPE = T.let(T.unsafe(nil), Symbol) # A Scope represents a context of local variable visibility. # This is a place where local variables belong to. # A scope instance holds a scope node and variable entries. # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#9 class RuboCop::Cop::VariableForce::Scope # @return [Scope] a new instance of Scope # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#22 def initialize(node); end # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#36 def ==(other); end # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#44 def body_node; end # @yield [node] # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#63 def each_node(&block); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#58 def include?(target_node); end # Returns the value of attribute naked_top_level. # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 def naked_top_level; end # Returns the value of attribute naked_top_level. # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 def naked_top_level?; end # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#40 def name; end # Returns the value of attribute node. # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 def node; end # Returns the value of attribute variables. # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#18 def variables; end private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#102 def ancestor_node?(target_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#92 def belong_to_inner_scope?(target_node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#81 def belong_to_outer_scope?(target_node); end # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#72 def scan_node(node, &block); end end # source://rubocop//lib/rubocop/cop/variable_force/scope.rb#10 RuboCop::Cop::VariableForce::Scope::OUTER_SCOPE_CHILD_INDICES = T.let(T.unsafe(nil), Hash) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#55 RuboCop::Cop::VariableForce::TWISTED_SCOPE_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#28 RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPE = T.let(T.unsafe(nil), Symbol) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#30 RuboCop::Cop::VariableForce::VARIABLE_ASSIGNMENT_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#46 RuboCop::Cop::VariableForce::VARIABLE_REFERENCE_TYPE = T.let(T.unsafe(nil), Symbol) # A Variable represents existence of a local variable. # This holds a variable declaration node and some states of the variable. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#8 class RuboCop::Cop::VariableForce::Variable # @return [Variable] a new instance of Variable # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#17 def initialize(name, declaration_node, scope); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#94 def argument?; end # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#33 def assign(node); end # Returns the value of attribute assignments. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def assignments; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#102 def block_argument?; end # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#74 def capture_with_block!; end # Returns the value of attribute captured_by_block. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def captured_by_block; end # Returns the value of attribute captured_by_block. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def captured_by_block?; end # Returns the value of attribute declaration_node. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def declaration_node; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#110 def explicit_block_local_variable?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#68 def in_modifier_if?(assignment); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#106 def keyword_argument?; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#98 def method_argument?; end # Returns the value of attribute name. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def name; end # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#42 def reference!(node); end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#37 def referenced?; end # Returns the value of attribute references. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def references; end # Returns the value of attribute scope. # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#12 def scope; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#90 def should_be_unused?; end # This is a convenient way to check whether the variable is used # in its entire variable lifetime. # For more precise usage check, refer Assignment#used?. # # Once the variable is captured by a block, we have no idea # when, where, and how many times the block would be invoked. # This means we cannot track the usage of the variable. # So we consider it's used to suppress false positive offenses. # # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#86 def used?; end end # source://rubocop//lib/rubocop/cop/variable_force/variable.rb#9 RuboCop::Cop::VariableForce::Variable::VARIABLE_DECLARATION_TYPES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#60 class RuboCop::Cop::VariableForce::VariableReference < ::Struct # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force.rb#61 def assignment?; end # Returns the value of attribute name # # @return [Object] the current value of name def name; end # Sets the attribute name # # @param value [Object] the value to set the attribute name to. # @return [Object] the newly set value def name=(_); end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # A VariableTable manages the lifetime of all scopes and local variables # in a program. # This holds scopes as stack structure, provides a way to add local # variables to current scope, and find local variables by considering # variable visibility of the current scope. # # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#11 class RuboCop::Cop::VariableForce::VariableTable # @return [VariableTable] a new instance of VariableTable # # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#12 def initialize(hook_receiver = T.unsafe(nil)); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#111 def accessible_variables; end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#56 def assign_to_variable(name, node); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#40 def current_scope; end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#44 def current_scope_level; end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#48 def declare_variable(name, node); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#94 def find_variable(name); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#16 def invoke_hook(hook_name, *args); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#32 def pop_scope; end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#24 def push_scope(scope_node); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#68 def reference_variable(name, node); end # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#20 def scope_stack; end # @return [Boolean] # # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#107 def variable_exist?(name); end private # source://rubocop//lib/rubocop/cop/variable_force/variable_table.rb#120 def mark_variable_as_captured_by_block_if_so(variable); end end # @api private # # source://rubocop//lib/rubocop/cop/variable_force.rb#53 RuboCop::Cop::VariableForce::ZERO_ARITY_SUPER_TYPE = T.let(T.unsafe(nil), Symbol) # Help methods for determining node visibility. # # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#6 module RuboCop::Cop::VisibilityHelp extend ::RuboCop::AST::NodePattern::Macros # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#33 def visibility_block?(param0 = T.unsafe(nil)); end private # Navigate to find the last protected method # # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#25 def find_visibility_end(node); end # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#18 def find_visibility_start(node); end # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#13 def node_visibility(node); end end # source://rubocop//lib/rubocop/cop/mixin/visibility_help.rb#9 RuboCop::Cop::VisibilityHelp::VISIBILITY_SCOPES = T.let(T.unsafe(nil), Array) # This class wraps the `Parser::Source::Comment` object that represents a # cops it contains. # # source://rubocop//lib/rubocop/directive_comment.rb#7 class RuboCop::DirectiveComment # @return [DirectiveComment] a new instance of DirectiveComment # # source://rubocop//lib/rubocop/directive_comment.rb#10 def initialize(comment); end # Returns the value of attribute comment. # # source://rubocop//lib/rubocop/directive_comment.rb#8 def comment; end # Return all the cops specified in the directive # # source://rubocop//lib/rubocop/directive_comment.rb#15 def cops; end # Checks if this directive contains all the given cop names # # @return [Boolean] # # source://rubocop//lib/rubocop/directive_comment.rb#24 def match?(cop_names); end # source://rubocop//lib/rubocop/directive_comment.rb#28 def range; end end # An Error exception is different from an Offense with severity 'error' # When this exception is raised, it means that RuboCop is unable to perform # a requested action (probably due to misconfiguration) and must stop # immediately, rather than carrying on # # source://rubocop//lib/rubocop/error.rb#8 class RuboCop::Error < ::StandardError; end # A wrapper to display errored location of analyzed file. # # source://rubocop//lib/rubocop/error.rb#13 class RuboCop::ErrorWithAnalyzedFileLocation < ::RuboCop::Error # @return [ErrorWithAnalyzedFileLocation] a new instance of ErrorWithAnalyzedFileLocation # # source://rubocop//lib/rubocop/error.rb#14 def initialize(cause:, node:, cop:); end # Returns the value of attribute cause. # # source://rubocop//lib/rubocop/error.rb#21 def cause; end # source://rubocop//lib/rubocop/error.rb#27 def column; end # Returns the value of attribute cop. # # source://rubocop//lib/rubocop/error.rb#21 def cop; end # source://rubocop//lib/rubocop/error.rb#23 def line; end # source://rubocop//lib/rubocop/error.rb#31 def message; end end # source://rubocop//lib/rubocop/ext/regexp_node.rb#4 module RuboCop::Ext; end # Extensions to AST::ProcessedSource for our cached comment_config # # source://rubocop//lib/rubocop/ext/processed_source.rb#6 module RuboCop::Ext::ProcessedSource # source://rubocop//lib/rubocop/ext/processed_source.rb#7 def comment_config; end # source://rubocop//lib/rubocop/ext/processed_source.rb#11 def disabled_line_ranges; end end # Extensions to AST::RegexpNode for our cached parsed regexp info # # source://rubocop//lib/rubocop/ext/regexp_node.rb#6 module RuboCop::Ext::RegexpNode # source://rubocop//lib/rubocop/ext/regexp_node.rb#28 def each_capture(named: T.unsafe(nil)); end # @return [Regexp::Expression::Root, nil] # # source://rubocop//lib/rubocop/ext/regexp_node.rb#19 def parsed_tree; end private # source://rubocop//lib/rubocop/ext/regexp_node.rb#43 def with_interpolations_blanked; end class << self # Returns the value of attribute parsed_cache. # # source://rubocop//lib/rubocop/ext/regexp_node.rb#14 def parsed_cache; end end end # source://rubocop//lib/rubocop/ext/regexp_node.rb#7 RuboCop::Ext::RegexpNode::ANY = T.let(T.unsafe(nil), Object) # Common methods for finding files. # # @api private # # source://rubocop//lib/rubocop/file_finder.rb#8 module RuboCop::FileFinder # @api private # # source://rubocop//lib/rubocop/file_finder.rb#17 def find_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/file_finder.rb#24 def find_last_file_upwards(filename, start_dir, stop_dir = T.unsafe(nil)); end private # @api private # # source://rubocop//lib/rubocop/file_finder.rb#34 def traverse_files_upwards(filename, start_dir, stop_dir); end class << self # @api private # # source://rubocop//lib/rubocop/file_finder.rb#9 def root_level=(level); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/file_finder.rb#13 def root_level?(path, stop_dir); end end end # source://rubocop//lib/rubocop/formatter/base_formatter.rb#4 module RuboCop::Formatter; end # Does not show individual offenses in the console. # # source://rubocop//lib/rubocop/formatter/auto_gen_config_formatter.rb#6 class RuboCop::Formatter::AutoGenConfigFormatter < ::RuboCop::Formatter::ProgressFormatter # source://rubocop//lib/rubocop/formatter/auto_gen_config_formatter.rb#7 def finished(inspected_files); end end # Abstract base class for formatter, implements all public API methods. # # ## Creating Custom Formatter # # You can create a custom formatter by subclassing # `RuboCop::Formatter::BaseFormatter` and overriding some methods # or by implementing all the methods by duck typing. # # ## Using Custom Formatter in Command Line # # You can tell RuboCop to use your custom formatter with a combination of # `--format` and `--require` option. # For example, when you have defined `MyCustomFormatter` in # `./path/to/my_custom_formatter.rb`, you would type this command: # # rubocop --require ./path/to/my_custom_formatter --format MyCustomFormatter # # Note: The path passed to `--require` is directly passed to # `Kernel.require`. # If your custom formatter file is not in `$LOAD_PATH`, # you need to specify the path as relative path prefixed with `./` # explicitly or absolute path. # # ## Method Invocation Order # # For example, when RuboCop inspects 2 files, # the invocation order should be like this: # # * `#initialize` # * `#started` # * `#file_started` # * `#file_finished` # * `#file_started` # * `#file_finished` # * `#finished` # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#41 class RuboCop::Formatter::BaseFormatter # @api public # @param output [IO] `$stdout` or opened file # @return [BaseFormatter] a new instance of BaseFormatter # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#63 def initialize(output, options = T.unsafe(nil)); end # Invoked at the end of inspecting each files. # # @api public # @param file [String] the file path # @param offenses [Array(RuboCop::Cop::Offense)] all detected offenses for the file # @return [void] # @see RuboCop::Cop::Offense # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#104 def file_finished(file, offenses); end # Invoked at the beginning of inspecting each files. # # @api public # @param file [String] the file path # @param options [Hash] file specific information, currently this is always empty. # @return [void] # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#89 def file_started(file, options); end # Invoked after all files are inspected or interrupted by user. # # @api public # @param inspected_files [Array(String)] the inspected file paths. # This would be same as `target_files` passed to `#started` # unless RuboCop is interrupted by user. # @return [void] # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#116 def finished(inspected_files); end # @api public # @return [Hash] # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#57 def options; end # @api public # @return [IO] the IO object passed to `#initialize` # @see #initialize # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#50 def output; end # Invoked once before any files are inspected. # # @api public # @param target_files [Array(String)] all target file paths to be inspected # @return [void] # # source://rubocop//lib/rubocop/formatter/base_formatter.rb#76 def started(target_files); end end # This formatter formats report data in clang style. # The precise location of the problem is shown together with the # relevant source code. # # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#8 class RuboCop::Formatter::ClangStyleFormatter < ::RuboCop::Formatter::SimpleTextFormatter # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#11 def report_file(file, offenses); end private # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#51 def report_highlighted_area(highlighted_area); end # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#41 def report_line(location); end # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#17 def report_offense(file, offense); end # @return [Boolean] # # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#37 def valid_line?(offense); end end # source://rubocop//lib/rubocop/formatter/clang_style_formatter.rb#9 RuboCop::Formatter::ClangStyleFormatter::ELLIPSES = T.let(T.unsafe(nil), String) # This mix-in module provides string coloring methods for terminals. # It automatically disables coloring if coloring is disabled in the process # globally or the formatter's output is not a terminal. # # source://rubocop//lib/rubocop/formatter/colorizable.rb#8 module RuboCop::Formatter::Colorizable # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def black(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def blue(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#21 def colorize(string, *args); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def cyan(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def green(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def magenta(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#9 def rainbow; end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def red(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def white(string); end # source://rubocop//lib/rubocop/formatter/colorizable.rb#35 def yellow(string); end end # This formatter displays a YAML configuration file where all cops that # detected any offenses are configured to not detect the offense. # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#7 class RuboCop::Formatter::DisabledConfigFormatter < ::RuboCop::Formatter::BaseFormatter # @return [DisabledConfigFormatter] a new instance of DisabledConfigFormatter # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#25 def initialize(output, options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#37 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#31 def file_started(_file, _file_info); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#45 def finished(_inspected_files); end private # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#66 def command; end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#136 def cop_config_params(default_cfg, cfg); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#158 def default_config(cop_name); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#197 def excludes(offending_files, cop_name, parent); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#93 def output_cop(cop_name, offense_count); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#121 def output_cop_comments(output_buffer, cfg, cop_name, offense_count); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#162 def output_cop_config(output_buffer, cfg, cop_name); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#143 def output_cop_param_comments(output_buffer, params, default_cfg); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#187 def output_exclude_list(output_buffer, offending_files, cop_name); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#209 def output_exclude_path(output_buffer, exclude_path, parent); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#176 def output_offending_files(output_buffer, cfg, cop_name); end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#87 def output_offenses; end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#107 def set_max(cfg, cop_name); end # @return [Boolean] # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#62 def show_offense_counts?; end # @return [Boolean] # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#58 def show_timestamp?; end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#83 def timestamp; end class << self # Returns the value of attribute config_to_allow_offenses. # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#22 def config_to_allow_offenses; end # Sets the attribute config_to_allow_offenses # # @param value the value to set the attribute config_to_allow_offenses to. # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#22 def config_to_allow_offenses=(_arg0); end # Returns the value of attribute detected_styles. # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#22 def detected_styles; end # Sets the attribute detected_styles # # @param value the value to set the attribute detected_styles to. # # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#22 def detected_styles=(_arg0); end end end # source://rubocop//lib/rubocop/formatter/disabled_config_formatter.rb#8 RuboCop::Formatter::DisabledConfigFormatter::HEADING = T.let(T.unsafe(nil), String) # This formatter displays the report data in format that's # easy to process in the Emacs text editor. # The output is machine-parsable. # # source://rubocop//lib/rubocop/formatter/emacs_style_formatter.rb#8 class RuboCop::Formatter::EmacsStyleFormatter < ::RuboCop::Formatter::BaseFormatter # source://rubocop//lib/rubocop/formatter/emacs_style_formatter.rb#9 def file_finished(file, offenses); end private # source://rubocop//lib/rubocop/formatter/emacs_style_formatter.rb#24 def message(offense); end end # This formatter displays just a list of the files with offenses in them, # separated by newlines. The output is machine-parsable. # # Here's the format: # # /some/file # /some/other/file # # source://rubocop//lib/rubocop/formatter/file_list_formatter.rb#12 class RuboCop::Formatter::FileListFormatter < ::RuboCop::Formatter::BaseFormatter # source://rubocop//lib/rubocop/formatter/file_list_formatter.rb#13 def file_finished(file, offenses); end end # This is a collection of formatters. A FormatterSet can hold multiple # formatter instances and provides transparent formatter API methods # which invoke same method of each formatters. # # source://rubocop//lib/rubocop/formatter/formatter_set.rb#10 class RuboCop::Formatter::FormatterSet < ::Array # @return [FormatterSet] a new instance of FormatterSet # # source://rubocop//lib/rubocop/formatter/formatter_set.rb#37 def initialize(options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#53 def add_formatter(formatter_type, output_path = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#65 def close_output_files; end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#48 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#42 def file_started(file, options); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#32 def finished(*args); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#32 def started(*args); end private # source://rubocop//lib/rubocop/formatter/formatter_set.rb#84 def builtin_formatter_class(specified_key); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#96 def custom_formatter_class(specified_class_name); end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#73 def formatter_class(formatter_type); end end # source://rubocop//lib/rubocop/formatter/formatter_set.rb#11 RuboCop::Formatter::FormatterSet::BUILTIN_FORMATTERS_FOR_KEYS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/formatter/formatter_set.rb#29 RuboCop::Formatter::FormatterSet::FORMATTER_APIS = T.let(T.unsafe(nil), Array) # This formatter displays a progress bar and shows details of offenses as # soon as they are detected. # This is inspired by the Fuubar formatter for RSpec by Jeff Kreeftmeijer. # https://github.com/jeffkreeftmeijer/fuubar # # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#11 class RuboCop::Formatter::FuubarStyleFormatter < ::RuboCop::Formatter::ClangStyleFormatter # @return [FuubarStyleFormatter] a new instance of FuubarStyleFormatter # # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#14 def initialize(*output); end # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#51 def count_stats(offenses); end # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#40 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#71 def progressbar_color; end # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#20 def started(target_files); end # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#61 def with_color; end end # source://rubocop//lib/rubocop/formatter/fuubar_style_formatter.rb#12 RuboCop::Formatter::FuubarStyleFormatter::RESET_SEQUENCE = T.let(T.unsafe(nil), String) # This formatter saves the output as an html file. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#12 class RuboCop::Formatter::HTMLFormatter < ::RuboCop::Formatter::BaseFormatter # @return [HTMLFormatter] a new instance of HTMLFormatter # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#31 def initialize(output, options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#41 def file_finished(file, offenses); end # Returns the value of attribute files. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#29 def files; end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#46 def finished(inspected_files); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#52 def render_html; end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#37 def started(target_files); end # Returns the value of attribute summary. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#29 def summary; end end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#17 class RuboCop::Formatter::HTMLFormatter::Color < ::Struct # Returns the value of attribute alpha # # @return [Object] the current value of alpha def alpha; end # Sets the attribute alpha # # @param value [Object] the value to set the attribute alpha to. # @return [Object] the newly set value def alpha=(_); end # Returns the value of attribute blue # # @return [Object] the current value of blue def blue; end # Sets the attribute blue # # @param value [Object] the value to set the attribute blue to. # @return [Object] the newly set value def blue=(_); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#22 def fade_out(amount); end # Returns the value of attribute green # # @return [Object] the current value of green def green; end # Sets the attribute green # # @param value [Object] the value to set the attribute green to. # @return [Object] the newly set value def green=(_); end # Returns the value of attribute red # # @return [Object] the current value of red def red; end # Sets the attribute red # # @param value [Object] the value to set the attribute red to. # @return [Object] the newly set value def red=(_); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#18 def to_s; end class << self def [](*_arg0); end def inspect; end def keyword_init?; end def members; end def new(*_arg0); end end end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#13 RuboCop::Formatter::HTMLFormatter::ELLIPSES = T.let(T.unsafe(nil), String) # This class provides helper methods used in the ERB template. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#70 class RuboCop::Formatter::HTMLFormatter::ERBContext include ::RuboCop::PathUtil include ::RuboCop::Formatter::TextUtil # @return [ERBContext] a new instance of ERBContext # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#87 def initialize(files, summary); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#136 def base64_encoded_logo_image; end # Make Kernel#binding public. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#94 def binding; end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#99 def decorated_message(offense); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#132 def escape(string); end # Returns the value of attribute files. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#85 def files; end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#105 def highlighted_source_line(offense); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#112 def hightlight_source_tag(offense); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#128 def possible_ellipses(location); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#123 def source_after_highlight(offense); end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#118 def source_before_highlight(offense); end # Returns the value of attribute summary. # # source://rubocop//lib/rubocop/formatter/html_formatter.rb#85 def summary; end end # source://rubocop//lib/rubocop/formatter/html_formatter.rb#82 RuboCop::Formatter::HTMLFormatter::ERBContext::LOGO_IMAGE_PATH = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/formatter/html_formatter.rb#74 RuboCop::Formatter::HTMLFormatter::ERBContext::SEVERITY_COLORS = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/formatter/html_formatter.rb#14 RuboCop::Formatter::HTMLFormatter::TEMPLATE_PATH = T.let(T.unsafe(nil), String) # This formatter formats the report data in JSON format. # # source://rubocop//lib/rubocop/formatter/json_formatter.rb#9 class RuboCop::Formatter::JSONFormatter < ::RuboCop::Formatter::BaseFormatter include ::RuboCop::PathUtil # @return [JSONFormatter] a new instance of JSONFormatter # # source://rubocop//lib/rubocop/formatter/json_formatter.rb#14 def initialize(output, options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/json_formatter.rb#27 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/json_formatter.rb#32 def finished(inspected_files); end # source://rubocop//lib/rubocop/formatter/json_formatter.rb#47 def hash_for_file(file, offenses); end # TODO: Consider better solution for Offense#real_column. # # source://rubocop//lib/rubocop/formatter/json_formatter.rb#66 def hash_for_location(offense); end # source://rubocop//lib/rubocop/formatter/json_formatter.rb#54 def hash_for_offense(offense); end # source://rubocop//lib/rubocop/formatter/json_formatter.rb#37 def metadata_hash; end # Returns the value of attribute output_hash. # # source://rubocop//lib/rubocop/formatter/json_formatter.rb#12 def output_hash; end # source://rubocop//lib/rubocop/formatter/json_formatter.rb#23 def started(target_files); end end # This formatter formats the report data in JUnit format. # # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#17 class RuboCop::Formatter::JUnitFormatter < ::RuboCop::Formatter::BaseFormatter # @return [JUnitFormatter] a new instance of JUnitFormatter # # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#18 def initialize(output, options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#61 def classname_attribute_value(file); end # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#31 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#65 def finished(_inspected_files); end # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#55 def offenses_for_cop(all_offenses, cop); end # @return [Boolean] # # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#51 def relevant_for_output?(options, target_offenses); end private # source://rubocop//lib/rubocop/formatter/junit_formatter.rb#71 def add_failure_to(testcase, offenses, cop_name); end end # This formatter displays the list of offended cops with a count of how # many offenses of their kind were found. Ordered by desc offense count # # Here's the format: # # 26 LineLength # 3 OneLineConditional # -- # 29 Total # # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#14 class RuboCop::Formatter::OffenseCountFormatter < ::RuboCop::Formatter::BaseFormatter # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#38 def file_finished(_file, offenses); end # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#43 def finished(_inspected_files); end # Returns the value of attribute offense_counts. # # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#15 def offense_counts; end # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#65 def ordered_offense_counts(offense_counts); end # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#48 def report_summary(offense_counts); end # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#17 def started(target_files); end # source://rubocop//lib/rubocop/formatter/offense_count_formatter.rb#69 def total_offense_count(offense_counts); end end # This formatter prints a PACDOT per every file to be analyzed. # Pacman will "eat" one PACDOT per file when no offense is detected. # Otherwise it will print a Ghost. # This is inspired by the Pacman formatter for RSpec by Carlos Rojas. # https://github.com/go-labs/rspec_pacman_formatter # # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#10 class RuboCop::Formatter::PacmanFormatter < ::RuboCop::Formatter::ClangStyleFormatter include ::RuboCop::Formatter::TextUtil # @return [PacmanFormatter] a new instance of PacmanFormatter # # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#19 def initialize(output, options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#50 def cols; end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#37 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#33 def file_started(_file, _options); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#43 def next_step(offenses); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#64 def pacdots(number); end # Returns the value of attribute progress_line. # # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#12 def progress_line; end # Sets the attribute progress_line # # @param value the value to set the attribute progress_line to. # # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#12 def progress_line=(_arg0); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#26 def started(target_files); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#68 def step(character); end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#57 def update_progress_line; end end # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#14 RuboCop::Formatter::PacmanFormatter::FALLBACK_TERMINAL_WIDTH = T.let(T.unsafe(nil), Integer) # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#15 RuboCop::Formatter::PacmanFormatter::GHOST = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#17 RuboCop::Formatter::PacmanFormatter::PACDOT = T.let(T.unsafe(nil), Rainbow::Presenter) # source://rubocop//lib/rubocop/formatter/pacman_formatter.rb#16 RuboCop::Formatter::PacmanFormatter::PACMAN = T.let(T.unsafe(nil), Rainbow::Presenter) # This formatter display dots for files with no offenses and # letters for files with problems in the them. In the end it # appends the regular report data in the clang style format. # # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#8 class RuboCop::Formatter::ProgressFormatter < ::RuboCop::Formatter::ClangStyleFormatter include ::RuboCop::Formatter::TextUtil # @return [ProgressFormatter] a new instance of ProgressFormatter # # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#13 def initialize(output, options = T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#24 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#33 def finished(inspected_files); end # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#52 def report_file_as_mark(offenses); end # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#18 def started(target_files); end end # source://rubocop//lib/rubocop/formatter/progress_formatter.rb#11 RuboCop::Formatter::ProgressFormatter::DOT = T.let(T.unsafe(nil), String) # If no offenses are found, no output is displayed. # Otherwise, SimpleTextFormatter's output is displayed. # # source://rubocop//lib/rubocop/formatter/quiet_formatter.rb#7 class RuboCop::Formatter::QuietFormatter < ::RuboCop::Formatter::SimpleTextFormatter # source://rubocop//lib/rubocop/formatter/quiet_formatter.rb#8 def report_summary(file_count, offense_count, correction_count, correctable_count); end end # A basic formatter that displays only files with offenses. # Offenses are displayed at compact form - just the # location of the problem and the associated message. # # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#11 class RuboCop::Formatter::SimpleTextFormatter < ::RuboCop::Formatter::BaseFormatter include ::RuboCop::Formatter::Colorizable include ::RuboCop::PathUtil # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#29 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#36 def finished(inspected_files); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#43 def report_file(file, offenses); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#57 def report_summary(file_count, offense_count, correction_count, correctable_count); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#23 def started(_target_files); end private # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#83 def annotate_message(msg); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#78 def colored_severity_code(offense); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#71 def count_stats(offenses); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#87 def message(offense); end end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#15 RuboCop::Formatter::SimpleTextFormatter::COLOR_FOR_SEVERITY = T.let(T.unsafe(nil), Hash) # A helper class for building the report summary text. # # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#101 class RuboCop::Formatter::SimpleTextFormatter::Report include ::RuboCop::Formatter::Colorizable include ::RuboCop::Formatter::TextUtil # @return [Report] a new instance of Report # # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#106 def initialize(file_count, offense_count, correction_count, correctable_count, rainbow, safe_auto_correct: T.unsafe(nil)); end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#119 def summary; end private # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#156 def correctable; end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#149 def corrections; end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#138 def files; end # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#142 def offenses; end # Returns the value of attribute rainbow. # # source://rubocop//lib/rubocop/formatter/simple_text_formatter.rb#136 def rainbow; end end # This formatter formats report data using the Test Anything Protocol. # TAP allows for to communicate tests results in a language agnostics way. # # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#7 class RuboCop::Formatter::TapFormatter < ::RuboCop::Formatter::ClangStyleFormatter # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#14 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#8 def started(target_files); end private # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#64 def annotate_message(msg); end # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#68 def message(offense); end # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#39 def report_highlighted_area(highlighted_area); end # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#29 def report_line(location); end # source://rubocop//lib/rubocop/formatter/tap_formatter.rb#44 def report_offense(file, offense); end end # Common logic for UI texts. # # source://rubocop//lib/rubocop/formatter/text_util.rb#6 module RuboCop::Formatter::TextUtil private # source://rubocop//lib/rubocop/formatter/text_util.rb#9 def pluralize(number, thing, options = T.unsafe(nil)); end class << self # source://rubocop//lib/rubocop/formatter/text_util.rb#9 def pluralize(number, thing, options = T.unsafe(nil)); end end end # This formatter displays the list of offensive files, sorted by number of # offenses with the worst offenders first. # # Here's the format: # # 26 this/file/is/really/bad.rb # 3 just/ok.rb # -- # 29 Total # # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#16 class RuboCop::Formatter::WorstOffendersFormatter < ::RuboCop::Formatter::BaseFormatter # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#24 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#31 def finished(_inspected_files); end # Returns the value of attribute offense_counts. # # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#17 def offense_counts; end # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#53 def ordered_offense_counts(offense_counts); end # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#36 def report_summary(offense_counts); end # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#19 def started(target_files); end # source://rubocop//lib/rubocop/formatter/worst_offenders_formatter.rb#57 def total_offense_count(offense_counts); end end # source://rubocop//lib/rubocop/options.rb#7 class RuboCop::IncorrectCopNameError < ::StandardError; end # Parse different formats of magic comments. # # @abstract parent of three different magic comment handlers # # source://rubocop//lib/rubocop/magic_comment.rb#7 class RuboCop::MagicComment # @return [MagicComment] a new instance of MagicComment # # source://rubocop//lib/rubocop/magic_comment.rb#25 def initialize(comment); end # @return [Boolean] # # source://rubocop//lib/rubocop/magic_comment.rb#29 def any?; end # @return [Boolean] # # source://rubocop//lib/rubocop/magic_comment.rb#72 def encoding_specified?; end # Expose the `frozen_string_literal` value coerced to a boolean if possible. # # @return [Boolean] if value is `true` or `false` # @return [nil] if frozen_string_literal comment isn't found # @return [String] if comment is found but isn't true or false # # source://rubocop//lib/rubocop/magic_comment.rb#61 def frozen_string_literal; end # Does the magic comment enable the frozen string literal feature. # # Test whether the frozen string literal value is `true`. Cannot # just return `frozen_string_literal` since an invalid magic comment # `'yes'` does not actually enable the feature # # @return [Boolean] # # source://rubocop//lib/rubocop/magic_comment.rb#41 def frozen_string_literal?; end # Was a magic comment for the frozen string literal found? # # @return [Boolean] # # source://rubocop//lib/rubocop/magic_comment.rb#52 def frozen_string_literal_specified?; end # @return [Boolean] # # source://rubocop//lib/rubocop/magic_comment.rb#45 def valid_literal_value?; end private # Match the entire comment string with a pattern and take the first capture. # # @param pattern [Regexp] # @return [String] if pattern matched # @return [nil] otherwise # # source://rubocop//lib/rubocop/magic_comment.rb#88 def extract(pattern); end # @return [Boolean] # # source://rubocop//lib/rubocop/magic_comment.rb#78 def specified?(value); end class << self # Detect magic comment format and pass it to the appropriate wrapper. # # @param comment [String] # @return [RuboCop::MagicComment] # # source://rubocop//lib/rubocop/magic_comment.rb#16 def parse(comment); end end end # Parent to Vim and Emacs magic comment handling. # # @abstract # # source://rubocop//lib/rubocop/magic_comment.rb#95 class RuboCop::MagicComment::EditorComment < ::RuboCop::MagicComment private # Find a token starting with the provided keyword and extract its value. # # @param keyword [String] # @return [String] extracted value if it is found # @return [nil] otherwise # # source://rubocop//lib/rubocop/magic_comment.rb#104 def match(keyword); end # Individual tokens composing an editor specific comment string. # # @return [Array] # # source://rubocop//lib/rubocop/magic_comment.rb#119 def tokens; end end # Wrapper for Emacs style magic comments. # # @example Emacs style comment # comment = RuboCop::MagicComment.parse( # '# -*- encoding: ASCII-8BIT -*-' # ) # # comment.encoding # => 'ascii-8bit' # @see https://www.gnu.org/software/emacs/manual/html_node/emacs/Specify-Coding.html # @see https://git.io/vMCXh Emacs handling in Ruby's parse.y # # source://rubocop//lib/rubocop/magic_comment.rb#135 class RuboCop::MagicComment::EmacsComment < ::RuboCop::MagicComment::EditorComment # source://rubocop//lib/rubocop/magic_comment.rb#140 def encoding; end private # source://rubocop//lib/rubocop/magic_comment.rb#146 def extract_frozen_string_literal; end end # source://rubocop//lib/rubocop/magic_comment.rb#136 RuboCop::MagicComment::EmacsComment::FORMAT = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/magic_comment.rb#138 RuboCop::MagicComment::EmacsComment::OPERATOR = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/magic_comment.rb#137 RuboCop::MagicComment::EmacsComment::SEPARATOR = T.let(T.unsafe(nil), String) # Wrapper for regular magic comments not bound to an editor. # # Simple comments can only specify one setting per comment. # # @example frozen string literal comments # comment1 = RuboCop::MagicComment.parse('# frozen_string_literal: true') # comment1.frozen_string_literal # => true # comment1.encoding # => nil # @example encoding comments # comment2 = RuboCop::MagicComment.parse('# encoding: utf-8') # comment2.frozen_string_literal # => nil # comment2.encoding # => 'utf-8' # # source://rubocop//lib/rubocop/magic_comment.rb#195 class RuboCop::MagicComment::SimpleComment < ::RuboCop::MagicComment # Match `encoding` or `coding` # # source://rubocop//lib/rubocop/magic_comment.rb#196 def encoding; end private # Extract `frozen_string_literal`. # # The `frozen_string_literal` magic comment only works if it # is the only text in the comment. # # Case-insensitive and dashes/underscores are acceptable. # # @see https://git.io/vM7Mg # # source://rubocop//lib/rubocop/magic_comment.rb#209 def extract_frozen_string_literal; end end # @see https://git.io/vMC1C IRB's pattern for matching magic comment tokens # # source://rubocop//lib/rubocop/magic_comment.rb#9 RuboCop::MagicComment::TOKEN = T.let(T.unsafe(nil), Regexp) # Wrapper for Vim style magic comments. # # @example Vim style comment # comment = RuboCop::MagicComment.parse( # '# vim: filetype=ruby, fileencoding=ascii-8bit' # ) # # comment.encoding # => 'ascii-8bit' # # source://rubocop//lib/rubocop/magic_comment.rb#159 class RuboCop::MagicComment::VimComment < ::RuboCop::MagicComment::EditorComment # For some reason the fileencoding keyword only works if there # is at least one other token included in the string. For example # # # works # # vim: foo=bar, fileencoding=ascii-8bit # # # does nothing # # vim: foo=bar, fileencoding=ascii-8bit # # source://rubocop//lib/rubocop/magic_comment.rb#173 def encoding; end # Vim comments cannot specify frozen string literal behavior. # # source://rubocop//lib/rubocop/magic_comment.rb#178 def frozen_string_literal; end end # source://rubocop//lib/rubocop/magic_comment.rb#160 RuboCop::MagicComment::VimComment::FORMAT = T.let(T.unsafe(nil), Regexp) # source://rubocop//lib/rubocop/magic_comment.rb#162 RuboCop::MagicComment::VimComment::OPERATOR = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/magic_comment.rb#161 RuboCop::MagicComment::VimComment::SEPARATOR = T.let(T.unsafe(nil), String) # Common functionality for finding names that are similar to a given name. # # @api private # # source://rubocop//lib/rubocop/name_similarity.rb#6 module RuboCop::NameSimilarity private # @api private # # source://rubocop//lib/rubocop/name_similarity.rb#9 def find_similar_name(target_name, names); end # @api private # # source://rubocop//lib/rubocop/name_similarity.rb#15 def find_similar_names(target_name, names); end class << self # @api private # # source://rubocop//lib/rubocop/name_similarity.rb#9 def find_similar_name(target_name, names); end # @api private # # source://rubocop//lib/rubocop/name_similarity.rb#15 def find_similar_names(target_name, names); end end end # source://rubocop//lib/rubocop/ast_aliases.rb#5 RuboCop::NodePattern = RuboCop::AST::NodePattern # source://rubocop//lib/rubocop/options.rb#8 class RuboCop::OptionArgumentError < ::StandardError; end # This class handles command line options. # # @api private # # source://rubocop//lib/rubocop/options.rb#12 class RuboCop::Options # @api private # @return [Options] a new instance of Options # # source://rubocop//lib/rubocop/options.rb#20 def initialize; end # @api private # # source://rubocop//lib/rubocop/options.rb#25 def parse(command_line_args); end private # @api private # # source://rubocop//lib/rubocop/options.rb#205 def add_aliases(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#114 def add_auto_gen_options(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#175 def add_boolean_flags(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#167 def add_cache_options(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#105 def add_configuration_options(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#86 def add_cop_selection_csv_option(option, opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#161 def add_flags_with_optional_args(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#134 def add_formatting_options(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#217 def add_list_options(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#80 def add_only_options(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#151 def add_severity_option(opts); end # @api private # # source://rubocop//lib/rubocop/options.rb#55 def args_from_env; end # @api private # # source://rubocop//lib/rubocop/options.rb#47 def args_from_file; end # @api private # # source://rubocop//lib/rubocop/options.rb#59 def define_options; end # Finds the option in `args` starting with -- and converts it to a symbol, # e.g. [..., '--auto-correct', ...] to :auto_correct. # # @api private # # source://rubocop//lib/rubocop/options.rb#234 def long_opt_symbol(args); end # Sets a value in the @options hash, based on the given long option and its # value, in addition to calling the block if a block is given. # # @api private # # source://rubocop//lib/rubocop/options.rb#223 def option(opts, *args); end end # @api private # # source://rubocop//lib/rubocop/options.rb#18 RuboCop::Options::DEFAULT_MAXIMUM_EXCLUSION_ITEMS = T.let(T.unsafe(nil), Integer) # @api private # # source://rubocop//lib/rubocop/options.rb#17 RuboCop::Options::EXITING_OPTIONS = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/options.rb#13 RuboCop::Options::E_STDIN_NO_PATH = T.let(T.unsafe(nil), String) # This module contains help texts for command line options. # # @api private # # source://rubocop//lib/rubocop/options.rb#412 module RuboCop::OptionsHelp; end # @api private # # source://rubocop//lib/rubocop/options.rb#414 RuboCop::OptionsHelp::FORMATTER_OPTION_LIST = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/options.rb#413 RuboCop::OptionsHelp::MAX_EXCL = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/options.rb#416 RuboCop::OptionsHelp::TEXT = T.let(T.unsafe(nil), Hash) # Validates option arguments and the options' compatibility with each other. # # @api private # # source://rubocop//lib/rubocop/options.rb#243 class RuboCop::OptionsValidator # @api private # @return [OptionsValidator] a new instance of OptionsValidator # # source://rubocop//lib/rubocop/options.rb#278 def initialize(options); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/options.rb#386 def boolean_or_empty_cache?; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/options.rb#377 def display_only_fail_level_offenses_with_autocorrect?; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/options.rb#381 def except_syntax?; end # @api private # # source://rubocop//lib/rubocop/options.rb#390 def incompatible_options; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/options.rb#371 def only_includes_redundant_disable?; end # @api private # @raise [OptionArgumentError] # # source://rubocop//lib/rubocop/options.rb#337 def validate_auto_correct; end # @api private # # source://rubocop//lib/rubocop/options.rb#315 def validate_auto_gen_config; end # @api private # @raise [OptionArgumentError] # # source://rubocop//lib/rubocop/options.rb#402 def validate_cache_enabled_for_cache_root; end # @api private # @raise [OptionArgumentError] # # source://rubocop//lib/rubocop/options.rb#289 def validate_compatibility; end # @api private # # source://rubocop//lib/rubocop/options.rb#282 def validate_cop_options; end # @api private # @raise [OptionArgumentError] # # source://rubocop//lib/rubocop/options.rb#329 def validate_display_only_failed; end # @api private # @raise [OptionParser::MissingArgument] # # source://rubocop//lib/rubocop/options.rb#394 def validate_exclude_limit_option; end # @api private # # source://rubocop//lib/rubocop/options.rb#345 def validate_parallel; end # @api private # # source://rubocop//lib/rubocop/options.rb#357 def validate_parallel_with_combo_option; end class << self # Cop name validation must be done later than option parsing, so it's not # called from within Options. # # @api private # # source://rubocop//lib/rubocop/options.rb#247 def validate_cop_list(names); end private # @api private # # source://rubocop//lib/rubocop/options.rb#264 def format_message_from(name, cop_names); end end end # Common methods and behaviors for dealing with paths. # # source://rubocop//lib/rubocop/path_util.rb#5 module RuboCop::PathUtil private # Returns true for an absolute Unix or Windows path. # # source://rubocop//lib/rubocop/path_util.rb#53 def absolute?(path); end # source://rubocop//lib/rubocop/path_util.rb#79 def hidden_dir?(path); end # source://rubocop//lib/rubocop/path_util.rb#66 def hidden_file?(path); end # source://rubocop//lib/rubocop/path_util.rb#57 def hidden_file_in_not_hidden_dir?(pattern, path); end # source://rubocop//lib/rubocop/path_util.rb#36 def match_path?(pattern, path); end # Loose check to reduce memory allocations # # source://rubocop//lib/rubocop/path_util.rb#71 def maybe_hidden_file?(path); end # source://rubocop//lib/rubocop/path_util.rb#8 def relative_path(path, base_dir = T.unsafe(nil)); end # source://rubocop//lib/rubocop/path_util.rb#25 def smart_path(path); end class << self # Returns true for an absolute Unix or Windows path. # # @return [Boolean] # # source://rubocop//lib/rubocop/path_util.rb#53 def absolute?(path); end # @return [Boolean] # # source://rubocop//lib/rubocop/path_util.rb#79 def hidden_dir?(path); end # @return [Boolean] # # source://rubocop//lib/rubocop/path_util.rb#66 def hidden_file?(path); end # @return [Boolean] # # source://rubocop//lib/rubocop/path_util.rb#57 def hidden_file_in_not_hidden_dir?(pattern, path); end # @return [Boolean] # # source://rubocop//lib/rubocop/path_util.rb#36 def match_path?(pattern, path); end # Loose check to reduce memory allocations # # @return [Boolean] # # source://rubocop//lib/rubocop/path_util.rb#71 def maybe_hidden_file?(path); end # source://rubocop//lib/rubocop/path_util.rb#8 def relative_path(path, base_dir = T.unsafe(nil)); end # source://rubocop//lib/rubocop/path_util.rb#25 def smart_path(path); end end end # This module provides information on the platform that RuboCop is being run # on. # # source://rubocop//lib/rubocop/platform.rb#6 module RuboCop::Platform class << self # @return [Boolean] # # source://rubocop//lib/rubocop/platform.rb#7 def windows?; end end end # source://rubocop//lib/rubocop/ast_aliases.rb#6 RuboCop::ProcessedSource = RuboCop::AST::ProcessedSource # Common methods and behaviors for dealing with remote config files. # # @api private # # source://rubocop//lib/rubocop/remote_config.rb#9 class RuboCop::RemoteConfig # @api private # @return [RemoteConfig] a new instance of RemoteConfig # # source://rubocop//lib/rubocop/remote_config.rb#14 def initialize(url, base_dir); end # @api private # # source://rubocop//lib/rubocop/remote_config.rb#19 def file; end # @api private # # source://rubocop//lib/rubocop/remote_config.rb#34 def inherit_from_remote(file, path); end # @api private # # source://rubocop//lib/rubocop/remote_config.rb#10 def uri; end private # @api private # # source://rubocop//lib/rubocop/remote_config.rb#99 def cache_name_from_uri; end # @api private # # source://rubocop//lib/rubocop/remote_config.rb#82 def cache_path; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/remote_config.rb#86 def cache_path_exists?; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/remote_config.rb#90 def cache_path_expired?; end # @api private # @yield [request] # # source://rubocop//lib/rubocop/remote_config.rb#57 def generate_request(uri); end # @api private # # source://rubocop//lib/rubocop/remote_config.rb#65 def handle_response(response, limit, &block); end # @api private # @raise [ArgumentError] # # source://rubocop//lib/rubocop/remote_config.rb#42 def request(uri = T.unsafe(nil), limit = T.unsafe(nil), &block); end end # @api private # # source://rubocop//lib/rubocop/remote_config.rb#12 RuboCop::RemoteConfig::CACHE_LIFETIME = T.let(T.unsafe(nil), Integer) # Provides functionality for caching rubocop runs. # # @api private # # source://rubocop//lib/rubocop/result_cache.rb#11 class RuboCop::ResultCache # @api private # @return [ResultCache] a new instance of ResultCache # # source://rubocop//lib/rubocop/result_cache.rb#88 def initialize(file, team, options, config_store, cache_root = T.unsafe(nil)); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/result_cache.rb#101 def debug?; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#109 def load; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#86 def path; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#114 def save(offenses); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/result_cache.rb#105 def valid?; end private # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/result_cache.rb#148 def any_symlink?(path); end # We combine team and options into a single "context" checksum to avoid # making file names that are too long for some filesystems to handle. # This context is for anything that's not (1) the RuboCop executable # checksum or (2) the inspected file checksum. # # @api private # # source://rubocop//lib/rubocop/result_cache.rb#226 def context_checksum(team, options); end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#159 def file_checksum(file, config_store); end # Return a hash of the options given at invocation, minus the ones that have # no effect on which offenses and disabled line ranges are found, and thus # don't affect caching. # # @api private # # source://rubocop//lib/rubocop/result_cache.rb#210 def relevant_options_digest(options); end # The checksum of the rubocop program running the inspection. # # @api private # # source://rubocop//lib/rubocop/result_cache.rb#178 def rubocop_checksum; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#194 def rubocop_extra_features; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/result_cache.rb#144 def symlink_protection_triggered?(path); end # The external dependency checksums are cached per RuboCop team so that # the checksums don't need to be recomputed for each file. # # @api private # # source://rubocop//lib/rubocop/result_cache.rb#217 def team_checksum(team); end class << self # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/result_cache.rb#82 def allow_symlinks_in_cache_location?(config_store); end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#69 def cache_root(config_store); end # Remove old files so that the cache doesn't grow too big. When the # threshold MaxFilesInCache has been exceeded, the oldest 50% of all the # files in the cache are removed. The reason for removing so much is that # cleaning should be done relatively seldom, since there is a slight risk # that some other RuboCop process was just about to read the file, when # there's parallel execution and the cache is shared. # # @api private # # source://rubocop//lib/rubocop/result_cache.rb#21 def cleanup(config_store, verbose, cache_root = T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#174 def inhibit_cleanup; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#174 def inhibit_cleanup=(_arg0); end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#35 def rubocop_required_features; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#35 def rubocop_required_features=(_arg0); end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#174 def source_checksum; end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#174 def source_checksum=(_arg0); end private # @api private # # source://rubocop//lib/rubocop/result_cache.rb#59 def remove_files(files, dirs, remove_count); end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#46 def remove_oldest_files(files, dirs, cache_root, verbose); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/result_cache.rb#41 def requires_file_removal?(file_count, config_store); end end end # @api private # # source://rubocop//lib/rubocop/result_cache.rb#12 RuboCop::ResultCache::NON_CHANGING = T.let(T.unsafe(nil), Array) # This class handles the processing of files, which includes dealing with # formatters and letting cops inspect the files. # # source://rubocop//lib/rubocop/runner.rb#8 class RuboCop::Runner # @return [Runner] a new instance of Runner # # source://rubocop//lib/rubocop/runner.rb#33 def initialize(options, config_store); end # Sets the attribute aborting # # @param value the value to set the attribute aborting to. # # source://rubocop//lib/rubocop/runner.rb#31 def aborting=(_arg0); end # @return [Boolean] # # source://rubocop//lib/rubocop/runner.rb#57 def aborting?; end # Returns the value of attribute errors. # # source://rubocop//lib/rubocop/runner.rb#30 def errors; end # source://rubocop//lib/rubocop/runner.rb#41 def run(paths); end # Returns the value of attribute warnings. # # source://rubocop//lib/rubocop/runner.rb#30 def warnings; end private # source://rubocop//lib/rubocop/runner.rb#164 def add_redundant_disables(file, offenses, source); end # source://rubocop//lib/rubocop/runner.rb#138 def cached_result(file, team); end # @return [Boolean] # # source://rubocop//lib/rubocop/runner.rb#221 def cached_run?; end # Check whether a run created source identical to a previous run, which # means that we definitely have an infinite loop. # # source://rubocop//lib/rubocop/runner.rb#300 def check_for_infinite_loop(processed_source, offenses_by_iteration); end # @return [Boolean] # # source://rubocop//lib/rubocop/runner.rb#190 def check_for_redundant_disables?(source); end # @return [Boolean] # # source://rubocop//lib/rubocop/runner.rb#367 def considered_failure?(offense); end # source://rubocop//lib/rubocop/runner.rb#244 def do_inspection_loop(file); end # source://rubocop//lib/rubocop/runner.rb#99 def each_inspected_file(files); end # source://rubocop//lib/rubocop/runner.rb#214 def file_finished(file, offenses); end # source://rubocop//lib/rubocop/runner.rb#142 def file_offense_cache(file); end # source://rubocop//lib/rubocop/runner.rb#130 def file_offenses(file); end # source://rubocop//lib/rubocop/runner.rb#207 def file_started(file); end # source://rubocop//lib/rubocop/runner.rb#345 def filter_cop_classes(cop_classes, config); end # @return [Boolean] # # source://rubocop//lib/rubocop/runner.rb#203 def filtered_run?; end # source://rubocop//lib/rubocop/runner.rb#70 def find_target_files(paths); end # source://rubocop//lib/rubocop/runner.rb#356 def formatter_set; end # source://rubocop//lib/rubocop/runner.rb#383 def get_processed_source(file); end # source://rubocop//lib/rubocop/runner.rb#314 def inspect_file(processed_source, team = T.unsafe(nil)); end # source://rubocop//lib/rubocop/runner.rb#81 def inspect_files(files); end # source://rubocop//lib/rubocop/runner.rb#275 def iterate_until_no_changes(source, offenses_by_iteration); end # source://rubocop//lib/rubocop/runner.rb#114 def list_files(paths); end # source://rubocop//lib/rubocop/runner.rb#376 def minimum_severity_to_fail; end # source://rubocop//lib/rubocop/runner.rb#321 def mobilize_team(processed_source); end # source://rubocop//lib/rubocop/runner.rb#326 def mobilized_cop_classes(config); end # source://rubocop//lib/rubocop/runner.rb#120 def process_file(file); end # source://rubocop//lib/rubocop/runner.rb#194 def redundant_cop_disable_directive(file); end # source://rubocop//lib/rubocop/runner.rb#234 def save_in_cache(cache, offenses); end # A Cop::Team instance is stateful and may change when inspecting. # The "standby" team for a given config is an initialized but # otherwise dormant team that can be used for config- and option- # level caching in ResultCache. # # source://rubocop//lib/rubocop/runner.rb#401 def standby_team(config); end # @return [Boolean] # # source://rubocop//lib/rubocop/runner.rb#352 def style_guide_cops_only?(config); end # @yield [team] # # source://rubocop//lib/rubocop/runner.rb#179 def team_for_redundant_disables(file, offenses, source); end # Warms up the RuboCop cache by forking a suitable number of rubocop # instances that each inspects its allotted group of files. # # source://rubocop//lib/rubocop/runner.rb#65 def warm_cache(target_files); end end # An exception indicating that the inspection loop got stuck correcting # offenses back and forth. # # source://rubocop//lib/rubocop/runner.rb#11 class RuboCop::Runner::InfiniteCorrectionLoop < ::RuntimeError # @return [InfiniteCorrectionLoop] a new instance of InfiniteCorrectionLoop # # source://rubocop//lib/rubocop/runner.rb#14 def initialize(path, offenses_by_iteration, loop_start: T.unsafe(nil)); end # Returns the value of attribute offenses. # # source://rubocop//lib/rubocop/runner.rb#12 def offenses; end end # @api private # # source://rubocop//lib/rubocop/runner.rb#28 RuboCop::Runner::MAX_ITERATIONS = T.let(T.unsafe(nil), Integer) # Take a string with embedded escapes, and convert the escapes as the Ruby # interpreter would when reading a double-quoted string literal. # For example, "\\n" will be converted to "\n". # # source://rubocop//lib/rubocop/string_interpreter.rb#7 class RuboCop::StringInterpreter class << self # source://rubocop//lib/rubocop/string_interpreter.rb#24 def interpret(string); end private # source://rubocop//lib/rubocop/string_interpreter.rb#51 def interpret_hex(escape); end # source://rubocop//lib/rubocop/string_interpreter.rb#55 def interpret_octal(escape); end # source://rubocop//lib/rubocop/string_interpreter.rb#33 def interpret_string_escape(escape); end # source://rubocop//lib/rubocop/string_interpreter.rb#43 def interpret_unicode(escape); end end end # source://rubocop//lib/rubocop/string_interpreter.rb#8 RuboCop::StringInterpreter::STRING_ESCAPES = T.let(T.unsafe(nil), Hash) # source://rubocop//lib/rubocop/string_interpreter.rb#12 RuboCop::StringInterpreter::STRING_ESCAPE_REGEX = T.let(T.unsafe(nil), Regexp) # This class finds target files to inspect by scanning the directory tree # and picking ruby files. # # @api private # # source://rubocop//lib/rubocop/target_finder.rb#7 class RuboCop::TargetFinder # @api private # @return [TargetFinder] a new instance of TargetFinder # # source://rubocop//lib/rubocop/target_finder.rb#10 def initialize(config_store, options = T.unsafe(nil)); end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#138 def all_cops_include; end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#105 def combined_exclude_glob_patterns(base_dir); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#167 def configured_include?(file); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#19 def debug?; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#23 def fail_fast?; end # Generate a list of target files by expanding globbing patterns # (if any). If args is empty, recursively find all Ruby source # files under the current directory # # @api private # @return [Array] array of file paths # # source://rubocop//lib/rubocop/target_finder.rb#31 def find(args, mode); end # Search for files recursively starting at the given base directory using # the given flags that determine how the match is made. Excluded files will # be removed later by the caller, but as an optimization find_files removes # the top level directories that are excluded in configuration in the # normal way (dir/**/*). # # @api private # # source://rubocop//lib/rubocop/target_finder.rb#83 def find_files(base_dir, flags); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#15 def force_exclusion?; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#171 def included_file?(file); end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#175 def process_explicit_path(path, mode); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#143 def ruby_executable?(file); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#112 def ruby_extension?(file); end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#116 def ruby_extensions; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#162 def ruby_file?(file); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#125 def ruby_filename?(file); end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#129 def ruby_filenames; end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#154 def ruby_interpreters(file); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#158 def stdin?; end # Finds all Ruby source files under the current or other supplied # directory. A Ruby source file is defined as a file with the `.rb` # extension or a file with no extension that has a ruby shebang line # as its first line. # It is possible to specify includes and excludes using the config file, # so you can include other Ruby files like Rakefiles and gemspecs. # # @api private # @param base_dir Root directory under which to search for # ruby source files # @return [Array] Array of filenames # # source://rubocop//lib/rubocop/target_finder.rb#56 def target_files_in_dir(base_dir = T.unsafe(nil)); end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_finder.rb#71 def to_inspect?(file, hidden_files, base_dir_config); end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#96 def wanted_dir_patterns(base_dir, exclude_pattern, flags); end private # @api private # # source://rubocop//lib/rubocop/target_finder.rb#192 def order; end end # @api private # # source://rubocop//lib/rubocop/target_finder.rb#8 RuboCop::TargetFinder::HIDDEN_PATH_SUBSTRING = T.let(T.unsafe(nil), String) # The kind of Ruby that code inspected by RuboCop is written in. # # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#6 class RuboCop::TargetRuby # @api private # @return [TargetRuby] a new instance of TargetRuby # # source://rubocop//lib/rubocop/target_ruby.rb#136 def initialize(config); end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#152 def rubocop_version_with_support; end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#140 def source; end # @api private # @return [Boolean] # # source://rubocop//lib/rubocop/target_ruby.rb#148 def supported?; end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#144 def version; end class << self # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#129 def supported_versions; end end end # The lock file of Bundler may identify the target ruby version. # # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#76 class RuboCop::TargetRuby::BundlerLockFile < ::RuboCop::TargetRuby::Source # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#77 def name; end private # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#110 def bundler_lock_file_path; end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#83 def find_version; end end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#8 RuboCop::TargetRuby::DEFAULT_VERSION = T.let(T.unsafe(nil), Float) # If all else fails, a default version will be picked. # # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#117 class RuboCop::TargetRuby::Default < ::RuboCop::TargetRuby::Source # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#118 def name; end private # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#124 def find_version; end end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#7 RuboCop::TargetRuby::KNOWN_RUBIES = T.let(T.unsafe(nil), Array) # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#10 RuboCop::TargetRuby::OBSOLETE_RUBIES = T.let(T.unsafe(nil), Hash) # The target ruby version may be configured in RuboCop's config. # # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#32 class RuboCop::TargetRuby::RuboCopConfig < ::RuboCop::TargetRuby::Source # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#33 def name; end private # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#39 def find_version; end end # The target ruby version may be found in a .ruby-version file. # # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#46 class RuboCop::TargetRuby::RubyVersionFile < ::RuboCop::TargetRuby::Source # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#49 def name; end private # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#55 def find_version; end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#67 def ruby_version_file; end end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#47 RuboCop::TargetRuby::RubyVersionFile::FILENAME = T.let(T.unsafe(nil), String) # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#133 RuboCop::TargetRuby::SOURCES = T.let(T.unsafe(nil), Array) # A place where information about a target ruby version is found. # # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#17 class RuboCop::TargetRuby::Source # @api private # @return [Source] a new instance of Source # # source://rubocop//lib/rubocop/target_ruby.rb#20 def initialize(config); end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#18 def name; end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#25 def to_s; end # @api private # # source://rubocop//lib/rubocop/target_ruby.rb#18 def version; end end # source://rubocop//lib/rubocop/ast_aliases.rb#7 RuboCop::Token = RuboCop::AST::Token # source://rubocop//lib/rubocop/error.rb#10 class RuboCop::ValidationError < ::RuboCop::Error; end # This module holds the RuboCop version information. # # source://rubocop//lib/rubocop/version.rb#5 module RuboCop::Version class << self # @api private # # source://rubocop//lib/rubocop/version.rb#25 def document_version; end # @api private # # source://rubocop//lib/rubocop/version.rb#13 def version(debug: T.unsafe(nil)); end end end # source://rubocop//lib/rubocop/version.rb#8 RuboCop::Version::MSG = T.let(T.unsafe(nil), String) # source://rubocop//lib/rubocop/version.rb#6 RuboCop::Version::STRING = T.let(T.unsafe(nil), String) # A Warning exception is different from an Offense with severity 'warning' # When a Warning is raised, this means that RuboCop was unable to perform a # requested operation (such as inspecting or correcting a source file) due to # user error # For example, a configuration value in .rubocop.yml might be malformed # # source://rubocop//lib/rubocop/warning.rb#9 class RuboCop::Warning < ::StandardError; end # Find duplicated keys from YAML. # # @api private # # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#6 module RuboCop::YAMLDuplicationChecker class << self # @api private # # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#7 def check(yaml_string, filename, &on_duplicated); end private # @api private # # source://rubocop//lib/rubocop/yaml_duplication_checker.rb#21 def traverse(tree, &on_duplicated); end end end # Extensions to the core String class # # source://rubocop//lib/rubocop/core_ext/string.rb#4 class String include ::Comparable # Checks whether a string is blank. A string is considered blank if it # is either empty or contains only whitespace characters. # # @example # ''.blank? #=> true # @example # ' '.blank? #=> true # @example # ' test'.blank? #=> false # @return [Boolean] true is the string is blank, false otherwise # # source://rubocop//lib/rubocop/core_ext/string.rb#19 def blank?; end end