Class: RuboCop::Cop::Homebrew::FormulaPathMethods Private

Inherits:
Base
  • Object
show all
Extended by:
AutoCorrector
Defined in:
rubocops/formula_path_methods.rb,
sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi

Overview

This class is part of a private API. This class may only be used in the Homebrew/brew repository. Third parties should avoid using this class if possible, as it may be removed or changed without warning.

Checks for formula instances created only to build stable opt paths.

Constant Summary collapse

MSG =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

"Use `%<preferred>s` instead of `%<current>s`."
RESTRICT_ON_SEND =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

[
  :any_version_installed?,
  :installed?,
  :installed_version,
  :opt_bin,
  :opt_lib,
  :opt_libexec,
  :opt_prefix,
].freeze
FORMULA_OPT_HELPERS =

This constant is part of a private API. This constant may only be used in the Homebrew/brew repository. Third parties should avoid using this constant if possible, as it may be removed or changed without warning.

T.let({
  opt_bin:     "formula_opt_bin",
  opt_lib:     "formula_opt_lib",
  opt_libexec: "formula_opt_libexec",
  opt_prefix:  "formula_opt_prefix",
}.freeze, T::Hash[Symbol, String])

Instance Method Summary collapse

Instance Method Details

#cask_block?(node, **kwargs, &block) ⇒ T.anything

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.anything)


10
# File 'sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi', line 10

def cask_block?(node, **kwargs, &block); end

#cask_new_token_node(node, **kwargs, &block) ⇒ T.anything

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.anything)


13
# File 'sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi', line 13

def cask_new_token_node(node, **kwargs, &block); end

#formula_class?(node, **kwargs, &block) ⇒ T.anything

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.anything)


16
# File 'sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi', line 16

def formula_class?(node, **kwargs, &block); end

#formula_lookup_name_node(node, **kwargs, &block) ⇒ T.anything

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.anything)


19
# File 'sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi', line 19

def formula_lookup_name_node(node, **kwargs, &block); end

#formula_path_name_node(node, **kwargs, &block) ⇒ T.anything

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

Parameters:

Returns:

  • (T.anything)


22
# File 'sorbet/rbi/dsl/rubo_cop/cop/homebrew/formula_path_methods.rbi', line 22

def formula_path_name_node(node, **kwargs, &block); end

#on_send(node) ⇒ void

This method is part of a private API. This method may only be used in the Homebrew/brew repository. Third parties should avoid using this method if possible, as it may be removed or changed without warning.

This method returns an undefined value.

Parameters:

  • node (RuboCop::AST::SendNode)


53
54
55
56
57
58
59
60
# File 'rubocops/formula_path_methods.rb', line 53

def on_send(node)
  preferred = preferred_method_call(node)
  return unless preferred

  add_offense(node, message: format(MSG, preferred:, current: node.source)) do |corrector|
    corrector.replace(node.loc.expression, preferred)
  end
end