Skip to content

Commit

Permalink
Fix violations
Browse files Browse the repository at this point in the history
  • Loading branch information
dduugg committed Sep 20, 2024
1 parent c354377 commit eeb31d3
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 666 deletions.
4 changes: 0 additions & 4 deletions Library/Homebrew/PATH.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,10 @@ class PATH

delegate each: :@paths

# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
Element = T.type_alias { T.nilable(T.any(Pathname, String, PATH)) }
private_constant :Element
Elements = T.type_alias { T.any(Element, T::Array[Element]) }
private_constant :Elements
# rubocop:enable Style/MutableConstant

sig { params(paths: Elements).void }
def initialize(*paths)
@paths = parse(paths)
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/cask/staged.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ module Staged

requires_ancestor { Kernel }

# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
Paths = T.type_alias { T.any(String, Pathname, T::Array[T.any(String, Pathname)]) }
# rubocop:enable Style/MutableConstant

sig { params(paths: Paths, permissions_str: String).void }
def set_permissions(paths, permissions_str)
full_paths = remove_nonexistent(paths)
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/cli/args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,12 @@
module Homebrew
module CLI
class Args < OpenStruct
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
# Represents a processed option. The array elements are:
# 0: short option name (e.g. "-d")
# 1: long option name (e.g. "--debug")
# 2: option description (e.g. "Print debugging information")
# 3: whether the option is hidden
OptionsType = T.type_alias { T::Array[[String, T.nilable(String), String, T::Boolean]] }
# rubocop:enable Style/MutableConstant

sig { returns(T::Array[String]) }
attr_reader :options_only, :flags_only

Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/cli/parser.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
module Homebrew
module CLI
class Parser
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
ArgType = T.type_alias { T.any(NilClass, Symbol, T::Array[String], T::Array[Symbol]) }
# rubocop:enable Style/MutableConstant
HIDDEN_DESC_PLACEHOLDER = "@@HIDDEN@@"
SYMBOL_TO_USAGE_MAPPING = T.let({
text_or_regex: "<text>|`/`<regex>`/`",
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/github_runner_matrix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
require "github_runner"

class GitHubRunnerMatrix
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
RunnerSpec = T.type_alias { T.any(LinuxRunnerSpec, MacOSRunnerSpec) }
private_constant :RunnerSpec

Expand Down Expand Up @@ -36,8 +34,6 @@ class GitHubRunnerMatrix

RunnerSpecHash = T.type_alias { T.any(LinuxRunnerSpecHash, MacOSRunnerSpecHash) }
private_constant :RunnerSpecHash
# rubocop:enable Style/MutableConstant

sig { returns(T::Array[GitHubRunner]) }
attr_reader :runners

Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/sorbet/tapioca/compilers/args.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,8 @@ class Args < Tapioca::Dsl::Compiler
end.flatten.freeze, T::Array[String]
)

# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
Parsable = T.type_alias { T.any(T.class_of(Homebrew::CLI::Args), T.class_of(Homebrew::AbstractCommand)) }
ConstantType = type_member { { fixed: Parsable } }
# rubocop:enable Style/MutableConstant

sig { override.returns(T::Enumerable[Parsable]) }
def self.gather_constants
# require all the commands to ensure the command subclasses are defined
Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/sorbet/tapioca/compilers/env_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
module Tapioca
module Compilers
class EnvConfig < Tapioca::Dsl::Compiler
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
ConstantType = type_member { { fixed: Module } }
# rubocop:enable Style/MutableConstant

sig { override.returns(T::Enumerable[Module]) }
def self.gather_constants = [Homebrew::EnvConfig]
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/sorbet/tapioca/compilers/rubocop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,9 @@
module Tapioca
module Compilers
class RuboCop < Tapioca::Dsl::Compiler
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
# This should be a module whose singleton class contains RuboCop::AST::NodePattern::Macros,
# but I don't know how to express that in Sorbet.
ConstantType = type_member { { fixed: Module } }
# rubocop:enable Style/MutableConstant

sig { override.returns(T::Enumerable[Module]) }
def self.gather_constants
all_modules.select do |klass|
Expand Down
3 changes: 0 additions & 3 deletions Library/Homebrew/sorbet/tapioca/compilers/tty.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,7 @@
module Tapioca
module Compilers
class Tty < Tapioca::Dsl::Compiler
# FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed.
# rubocop:disable Style/MutableConstant
ConstantType = type_member { { fixed: Module } }
# rubocop:enable Style/MutableConstant

sig { override.returns(T::Enumerable[Module]) }
def self.gather_constants = [::Tty]
Expand Down
Loading

0 comments on commit eeb31d3

Please sign in to comment.