Use exclude_from_registry instead
This commit is contained in:
parent
d9db5e8825
commit
387d2f859f
@ -9,8 +9,7 @@ module RuboCop
|
||||
# This cop audits the `bottle` block in formulae.
|
||||
#
|
||||
# @api private
|
||||
class BottleFormat < Base
|
||||
include FormulaCop
|
||||
class BottleFormat < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -57,8 +56,7 @@ module RuboCop
|
||||
# This cop audits the indentation of the bottle tags in the `bottle` block in formulae.
|
||||
#
|
||||
# @api private
|
||||
class BottleTagIndentation < Base
|
||||
include FormulaCop
|
||||
class BottleTagIndentation < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -94,8 +92,7 @@ module RuboCop
|
||||
# This cop audits the indentation of the sha256 digests in the`bottle` block in formulae.
|
||||
#
|
||||
# @api private
|
||||
class BottleDigestIndentation < Base
|
||||
include FormulaCop
|
||||
class BottleDigestIndentation < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -131,8 +128,7 @@ module RuboCop
|
||||
# This cop audits the order of the `bottle` block in formulae.
|
||||
#
|
||||
# @api private
|
||||
class BottleOrder < Base
|
||||
include FormulaCop
|
||||
class BottleOrder < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
|
||||
@ -24,9 +24,7 @@ module RuboCop
|
||||
# end
|
||||
#
|
||||
# @api private
|
||||
class Caveats < Base
|
||||
include FormulaCop
|
||||
|
||||
class Caveats < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
|
||||
caveats_strings.each do |n|
|
||||
if regex_match_group(n, /\bsetuid\b/i)
|
||||
|
||||
@ -9,9 +9,7 @@ module RuboCop
|
||||
# This cop makes sure that deprecated checksums are not used.
|
||||
#
|
||||
# @api private
|
||||
class Checksum < Base
|
||||
include FormulaCop
|
||||
|
||||
class Checksum < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -47,8 +45,7 @@ module RuboCop
|
||||
# This cop makes sure that checksum strings are lowercase.
|
||||
#
|
||||
# @api private
|
||||
class ChecksumCase < Base
|
||||
include FormulaCop
|
||||
class ChecksumCase < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
|
||||
@ -9,8 +9,7 @@ module RuboCop
|
||||
# This cop makes sure that {Formula} is used as superclass.
|
||||
#
|
||||
# @api private
|
||||
class ClassName < Base
|
||||
include FormulaCop
|
||||
class ClassName < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
DEPRECATED_CLASSES = %w[
|
||||
@ -32,8 +31,7 @@ module RuboCop
|
||||
# This cop makes sure that a `test` block contains a proper test.
|
||||
#
|
||||
# @api private
|
||||
class Test < Base
|
||||
include FormulaCop
|
||||
class Test < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -76,8 +74,7 @@ module RuboCop
|
||||
# This cop makes sure that a `test` block exists.
|
||||
#
|
||||
# @api private
|
||||
class TestPresent < Base
|
||||
include FormulaCop
|
||||
class TestPresent < FormulaCop
|
||||
def audit_formula(_node, class_node, _parent_class_node, body_node)
|
||||
return if find_block(body_node, :test)
|
||||
|
||||
|
||||
@ -11,8 +11,7 @@ module RuboCop
|
||||
#
|
||||
# - `component_precedence_list` has component hierarchy in a nested list
|
||||
# where each sub array contains components' details which are at same precedence level
|
||||
class ComponentsOrder < Base
|
||||
include FormulaCop
|
||||
class ComponentsOrder < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
|
||||
@ -14,9 +14,7 @@ module RuboCop
|
||||
# - `stable do` should not be present without a `head` spec
|
||||
#
|
||||
# @api private
|
||||
class ComponentsRedundancy < Base
|
||||
include FormulaCop
|
||||
|
||||
class ComponentsRedundancy < FormulaCop
|
||||
HEAD_MSG = "`head` and `head do` should not be simultaneously present"
|
||||
BOTTLE_MSG = "`bottle :modifier` and `bottle do` should not be simultaneously present"
|
||||
STABLE_MSG = "`stable do` should not be present without a `head` spec"
|
||||
|
||||
@ -7,8 +7,7 @@ module RuboCop
|
||||
module Cop
|
||||
module FormulaAudit
|
||||
# This cop audits versioned formulae for `conflicts_with`.
|
||||
class Conflicts < Base
|
||||
include FormulaCop
|
||||
class Conflicts < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
MSG = "Versioned formulae should not use `conflicts_with`. " \
|
||||
|
||||
@ -10,8 +10,7 @@ module RuboCop
|
||||
#
|
||||
# precedence order:
|
||||
# build-time > test > normal > recommended > optional
|
||||
class DependencyOrder < Base
|
||||
include FormulaCop
|
||||
class DependencyOrder < FormulaCop
|
||||
extend T::Sig
|
||||
extend AutoCorrector
|
||||
|
||||
|
||||
@ -7,8 +7,7 @@ module RuboCop
|
||||
module Cop
|
||||
module FormulaAudit
|
||||
# This cop audits `deprecate!` and `disable!` dates.
|
||||
class DeprecateDisableDate < Base
|
||||
include FormulaCop
|
||||
class DeprecateDisableDate < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -35,8 +34,7 @@ module RuboCop
|
||||
end
|
||||
|
||||
# This cop audits `deprecate!` and `disable!` reasons.
|
||||
class DeprecateDisableReason < Base
|
||||
include FormulaCop
|
||||
class DeprecateDisableReason < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
PUNCTUATION_MARKS = %w[. ! ?].freeze
|
||||
|
||||
@ -9,8 +9,7 @@ module RuboCop
|
||||
module FormulaAudit
|
||||
# This cop audits `desc` in formulae.
|
||||
# See the {DescHelper} module for details of the checks.
|
||||
class Desc < Base
|
||||
include FormulaCop
|
||||
class Desc < FormulaCop
|
||||
include DescHelper
|
||||
extend AutoCorrector
|
||||
|
||||
|
||||
@ -5,14 +5,18 @@ require "rubocops/shared/helper_functions"
|
||||
|
||||
module RuboCop
|
||||
module Cop
|
||||
# Mixin for all formula cops.
|
||||
# Abstract base class for all formula cops.
|
||||
#
|
||||
# @api private
|
||||
module FormulaCop
|
||||
extend RuboCop::AST::NodePattern::Macros
|
||||
class FormulaCop < Cop
|
||||
extend T::Sig
|
||||
extend T::Helpers
|
||||
include RangeHelp
|
||||
include HelperFunctions
|
||||
|
||||
abstract!
|
||||
exclude_from_registry
|
||||
|
||||
attr_accessor :file_path
|
||||
|
||||
@registry = Cop.registry
|
||||
@ -29,9 +33,16 @@ module RuboCop
|
||||
audit_formula(node, class_node, parent_class_node, @body)
|
||||
end
|
||||
|
||||
def audit_formula(node, class_node, parent_class_node, body_node)
|
||||
raise NotImplementedError, "Subclasses must implement this method."
|
||||
end
|
||||
sig {
|
||||
abstract
|
||||
.params(
|
||||
node: RuboCop::AST::ClassNode,
|
||||
class_node: RuboCop::AST::ConstNode,
|
||||
parent_class_node: RuboCop::AST::ConstNode,
|
||||
body_node: RuboCop::AST::Node,
|
||||
).void
|
||||
}
|
||||
def audit_formula(node, class_node, parent_class_node, body_node); end
|
||||
|
||||
# Yields to block when there is a match.
|
||||
#
|
||||
|
||||
@ -9,9 +9,7 @@ module RuboCop
|
||||
# This cop makes sure that a formula's file permissions are correct.
|
||||
#
|
||||
# @api private
|
||||
class Files < Base
|
||||
include FormulaCop
|
||||
|
||||
class Files < FormulaCop
|
||||
def audit_formula(node, _class_node, _parent_class_node, _body_node)
|
||||
return unless file_path
|
||||
|
||||
|
||||
@ -7,8 +7,7 @@ module RuboCop
|
||||
module Cop
|
||||
module FormulaAudit
|
||||
# This cop audits the `homepage` URL in formulae.
|
||||
class Homepage < Base
|
||||
include FormulaCop
|
||||
class Homepage < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, class_node, _parent_class_node, body_node)
|
||||
|
||||
@ -9,8 +9,7 @@ module RuboCop
|
||||
# This cop makes sure that a `keg_only` reason has the correct format.
|
||||
#
|
||||
# @api private
|
||||
class KegOnly < Base
|
||||
include FormulaCop
|
||||
class KegOnly < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
|
||||
@ -11,8 +11,7 @@ module RuboCop
|
||||
# This cop checks for various miscellaneous Homebrew coding styles.
|
||||
#
|
||||
# @api private
|
||||
class Lines < Base
|
||||
include FormulaCop
|
||||
class Lines < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
|
||||
[:automake, :ant, :autoconf, :emacs, :expat, :libtool, :mysql, :perl,
|
||||
:postgresql, :python, :python3, :rbenv, :ruby].each do |dependency|
|
||||
@ -35,8 +34,7 @@ module RuboCop
|
||||
# This cop makes sure that a space is used for class inheritance.
|
||||
#
|
||||
# @api private
|
||||
class ClassInheritance < Base
|
||||
include FormulaCop
|
||||
class ClassInheritance < FormulaCop
|
||||
def audit_formula(_node, class_node, parent_class_node, _body_node)
|
||||
begin_pos = start_column(parent_class_node)
|
||||
end_pos = end_column(class_node)
|
||||
@ -50,8 +48,7 @@ module RuboCop
|
||||
# This cop makes sure that template comments are removed.
|
||||
#
|
||||
# @api private
|
||||
class Comments < Base
|
||||
include FormulaCop
|
||||
class Comments < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
|
||||
audit_comments do |comment|
|
||||
[
|
||||
@ -92,8 +89,7 @@ module RuboCop
|
||||
# This cop makes sure that idiomatic `assert_*` statements are used.
|
||||
#
|
||||
# @api private
|
||||
class AssertStatements < Base
|
||||
include FormulaCop
|
||||
class AssertStatements < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -120,8 +116,7 @@ module RuboCop
|
||||
# This cop makes sure that `option`s are used idiomatically.
|
||||
#
|
||||
# @api private
|
||||
class OptionDeclarations < Base
|
||||
include FormulaCop
|
||||
class OptionDeclarations < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -206,8 +201,7 @@ module RuboCop
|
||||
# This cop makes sure that formulae depend on `open-mpi` instead of `mpich`.
|
||||
#
|
||||
# @api private
|
||||
class MpiCheck < Base
|
||||
include FormulaCop
|
||||
class MpiCheck < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -229,8 +223,7 @@ module RuboCop
|
||||
# or run-time.
|
||||
#
|
||||
# @api private
|
||||
class PyoxidizerCheck < Base
|
||||
include FormulaCop
|
||||
class PyoxidizerCheck < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -257,8 +250,7 @@ module RuboCop
|
||||
# This cop makes sure that the safe versions of `popen_*` calls are used.
|
||||
#
|
||||
# @api private
|
||||
class SafePopenCommands < Base
|
||||
include FormulaCop
|
||||
class SafePopenCommands < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -289,8 +281,7 @@ module RuboCop
|
||||
# This cop makes sure that environment variables are passed correctly to `popen_*` calls.
|
||||
#
|
||||
# @api private
|
||||
class ShellVariables < Base
|
||||
include FormulaCop
|
||||
class ShellVariables < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -322,8 +313,7 @@ module RuboCop
|
||||
# This cop makes sure that `license` has the correct format.
|
||||
#
|
||||
# @api private
|
||||
class LicenseArrays < Base
|
||||
include FormulaCop
|
||||
class LicenseArrays < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -344,8 +334,7 @@ module RuboCop
|
||||
# This cop makes sure that nested `license` declarations are split onto multiple lines.
|
||||
#
|
||||
# @api private
|
||||
class Licenses < Base
|
||||
include FormulaCop
|
||||
class Licenses < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -368,8 +357,7 @@ module RuboCop
|
||||
# This cop makes sure that Python versions are consistent.
|
||||
#
|
||||
# @api private
|
||||
class PythonVersions < Base
|
||||
include FormulaCop
|
||||
class PythonVersions < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -407,8 +395,7 @@ module RuboCop
|
||||
# This cop makes sure that OS conditionals are consistent.
|
||||
#
|
||||
# @api private
|
||||
class OnSystemConditionals < Base
|
||||
include FormulaCop
|
||||
class OnSystemConditionals < FormulaCop
|
||||
include OnSystemConditionalsHelper
|
||||
extend AutoCorrector
|
||||
|
||||
@ -449,8 +436,7 @@ module RuboCop
|
||||
# This cop makes sure that the `generate_completions_from_executable` DSL is used.
|
||||
#
|
||||
# @api private
|
||||
class GenerateCompletionsDSL < Base
|
||||
include FormulaCop
|
||||
class GenerateCompletionsDSL < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -533,8 +519,7 @@ module RuboCop
|
||||
# a single, combined call for all shells.
|
||||
#
|
||||
# @api private
|
||||
class SingleGenerateCompletionsDSLCall < Base
|
||||
include FormulaCop
|
||||
class SingleGenerateCompletionsDSLCall < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -596,8 +581,7 @@ module RuboCop
|
||||
# This cop checks for other miscellaneous style violations.
|
||||
#
|
||||
# @api private
|
||||
class Miscellaneous < Base
|
||||
include FormulaCop
|
||||
class Miscellaneous < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -868,8 +852,7 @@ module RuboCop
|
||||
# This cop makes sure that no build-time checks are performed.
|
||||
#
|
||||
# @api private
|
||||
class MakeCheck < Base
|
||||
include FormulaCop
|
||||
class MakeCheck < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if formula_tap != "homebrew-core"
|
||||
|
||||
@ -893,8 +876,7 @@ module RuboCop
|
||||
end
|
||||
|
||||
# This cop ensures that new formulae depending on removed Requirements are not used
|
||||
class Requirements < Base
|
||||
include FormulaCop
|
||||
class Requirements < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, _body_node)
|
||||
problem "Formulae should depend on a versioned `openjdk` instead of :java" if depends_on? :java
|
||||
problem "Formulae should depend on specific X libraries instead of :x11" if depends_on? :x11
|
||||
|
||||
@ -10,8 +10,7 @@ module RuboCop
|
||||
# skipped formulae.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckSkip < Base
|
||||
include FormulaCop
|
||||
class LivecheckSkip < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -43,8 +42,7 @@ module RuboCop
|
||||
# This cop ensures that a `url` is specified in the `livecheck` block.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckUrlProvided < Base
|
||||
include FormulaCop
|
||||
class LivecheckUrlProvided < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
livecheck_node = find_block(body_node, :livecheck)
|
||||
return if livecheck_node.blank?
|
||||
@ -68,8 +66,7 @@ module RuboCop
|
||||
# is used when the livecheck `url` is identical to one of these formula URLs.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckUrlSymbol < Base
|
||||
include FormulaCop
|
||||
class LivecheckUrlSymbol < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -126,8 +123,7 @@ module RuboCop
|
||||
# This cop ensures that the `regex` call in the `livecheck` block uses parentheses.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckRegexParentheses < Base
|
||||
include FormulaCop
|
||||
class LivecheckRegexParentheses < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -154,8 +150,7 @@ module RuboCop
|
||||
# `\.tgz`, `\.tar.gz` and variants.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckRegexExtension < Base
|
||||
include FormulaCop
|
||||
class LivecheckRegexExtension < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
TAR_PATTERN = /\\?\.t(ar|(g|l|x)z$|[bz2]{2,4}$)(\\?\.((g|l|x)z)|[bz2]{2,4}|Z)?$/i.freeze
|
||||
@ -188,8 +183,7 @@ module RuboCop
|
||||
# in the `livecheck` block.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckRegexIfPageMatch < Base
|
||||
include FormulaCop
|
||||
class LivecheckRegexIfPageMatch < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
livecheck_node = find_block(body_node, :livecheck)
|
||||
return if livecheck_node.blank?
|
||||
@ -215,8 +209,7 @@ module RuboCop
|
||||
# unless sensitivity is explicitly required for proper matching.
|
||||
#
|
||||
# @api private
|
||||
class LivecheckRegexCaseInsensitive < Base
|
||||
include FormulaCop
|
||||
class LivecheckRegexCaseInsensitive < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
MSG = "Regexes should be case-insensitive unless sensitivity is explicitly required for proper matching."
|
||||
|
||||
@ -7,8 +7,7 @@ module RuboCop
|
||||
module Cop
|
||||
module FormulaAudit
|
||||
# This cop audits `option`s in formulae.
|
||||
class Options < Base
|
||||
include FormulaCop
|
||||
class Options < FormulaCop
|
||||
DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so 32-bit options are deprecated."
|
||||
UNI_DEPRECATION_MSG = "macOS has been 64-bit only since 10.6 so universal options are deprecated."
|
||||
|
||||
|
||||
@ -8,8 +8,7 @@ module RuboCop
|
||||
module FormulaAudit
|
||||
# This cop audits `patch`es in formulae.
|
||||
# TODO: Many of these could be auto-corrected.
|
||||
class Patches < Base
|
||||
include FormulaCop
|
||||
class Patches < FormulaCop
|
||||
extend T::Sig
|
||||
extend AutoCorrector
|
||||
|
||||
|
||||
@ -9,8 +9,7 @@ module RuboCop
|
||||
# This cop checks for various problems in a formula's source code.
|
||||
#
|
||||
# @api private
|
||||
class Text < Base
|
||||
include FormulaCop
|
||||
class Text < FormulaCop
|
||||
extend AutoCorrector
|
||||
|
||||
def audit_formula(node, _class_node, _parent_class_node, body_node)
|
||||
@ -107,8 +106,7 @@ module RuboCop
|
||||
# This cop contains stricter checks for various problems in a formula's source code.
|
||||
#
|
||||
# @api private
|
||||
class Text < Base
|
||||
include FormulaCop
|
||||
class Text < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
|
||||
@ -9,9 +9,7 @@ module RuboCop
|
||||
# This cop audits `url`s and `mirror`s in formulae.
|
||||
#
|
||||
# @api private
|
||||
class Urls < Base
|
||||
include FormulaCop
|
||||
|
||||
class Urls < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
|
||||
@ -262,8 +260,7 @@ module RuboCop
|
||||
# This cop makes sure that the correct format for PyPI URLs is used.
|
||||
#
|
||||
# @api private
|
||||
class PyPiUrls < Base
|
||||
include FormulaCop
|
||||
class PyPiUrls < FormulaCop
|
||||
extend T::Sig
|
||||
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
@ -297,8 +294,7 @@ module RuboCop
|
||||
# This cop makes sure that git URLs have a `revision`.
|
||||
#
|
||||
# @api private
|
||||
class GitUrls < Base
|
||||
include FormulaCop
|
||||
class GitUrls < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
return unless formula_tap == "homebrew-core"
|
||||
@ -322,8 +318,7 @@ module RuboCop
|
||||
# This cop makes sure that git URLs have a `tag`.
|
||||
#
|
||||
# @api private
|
||||
class GitUrls < Base
|
||||
include FormulaCop
|
||||
class GitUrls < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
return if body_node.nil?
|
||||
return unless formula_tap == "homebrew-core"
|
||||
|
||||
@ -7,9 +7,7 @@ module RuboCop
|
||||
module Cop
|
||||
module FormulaAudit
|
||||
# This cop audits formulae that are keg-only because they are provided by macos.
|
||||
class ProvidedByMacos < Base
|
||||
include FormulaCop
|
||||
|
||||
class ProvidedByMacos < FormulaCop
|
||||
PROVIDED_BY_MACOS_FORMULAE = %w[
|
||||
apr
|
||||
bc
|
||||
@ -75,9 +73,7 @@ module RuboCop
|
||||
end
|
||||
|
||||
# This cop audits `uses_from_macos` dependencies in formulae.
|
||||
class UsesFromMacos < Base
|
||||
include FormulaCop
|
||||
|
||||
class UsesFromMacos < FormulaCop
|
||||
# These formulae aren't `keg_only :provided_by_macos` but are provided by
|
||||
# macOS (or very similarly, e.g. OpenSSL where system provides LibreSSL).
|
||||
# TODO: consider making some of these keg-only.
|
||||
|
||||
@ -9,9 +9,7 @@ module RuboCop
|
||||
# This cop makes sure that a `version` is in the correct format.
|
||||
#
|
||||
# @api private
|
||||
class Version < Base
|
||||
include FormulaCop
|
||||
|
||||
class Version < FormulaCop
|
||||
def audit_formula(_node, _class_node, _parent_class_node, body_node)
|
||||
version_node = find_node_method_by_name(body_node, :version)
|
||||
return unless version_node
|
||||
|
||||
@ -6963,7 +6963,7 @@ class RuboCop::Cop::FormulaAuditStrict::Text
|
||||
def share_path_starts_with(param0, param1); end
|
||||
end
|
||||
|
||||
module RuboCop::Cop::FormulaCop
|
||||
class RuboCop::Cop::FormulaCop
|
||||
def dependency_name_hash_match?(param0, param1); end
|
||||
|
||||
def dependency_type_hash_match?(param0, param1); end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user