language
stringclasses
1 value
owner
stringlengths
2
15
repo
stringlengths
2
21
sha
stringlengths
45
45
message
stringlengths
7
36.3k
path
stringlengths
1
199
patch
stringlengths
15
102k
is_multipart
bool
2 classes
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/mac/system_config.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + class SystemConfig class << self undef describe_java, describe_homebrew_ruby
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/mac/unpack_strategy/zip.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module UnpackStrategy class Zip prepend Module.new {
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/mac/utils/analytics.rb
@@ -1,8 +1,10 @@ +# frozen_string_literal: true + module Utils module Analytics class << self def custom_prefix_label - "non-/usr/local".freeze + "non-/usr/local" end end end
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/mac/utils/bottles.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Utils class Bottles class << self
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/missing_formula.rb
@@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/missing_formula" if OS.mac?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/pathname.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/extend/pathname" elsif OS.linux?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/requirements/java_requirement.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/requirements/java_requirement" elsif OS.linux?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/requirements/osxfuse_requirement.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/requirements/osxfuse_requirement" elsif OS.linux?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/requirements/x11_requirement.rb
@@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/requirements/x11_requirement" if OS.mac?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/search.rb
@@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/mac/search" if OS.mac?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/software_spec.rb
@@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/linux/software_spec" if OS.linux?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/system_config.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + if OS.mac? require "extend/os/mac/system_config" elsif OS.linux?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/os/tap.rb
@@ -1 +1,3 @@ +# frozen_string_literal: true + require "extend/os/linux/tap" if OS.linux?
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/pathname.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" require "metafiles"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/predicable.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Predicable def attr_predicate(*attrs) attrs.each do |attr|
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/extend/string.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Contains backports from newer versions of Ruby require "backports/2.4.0/string/match" require "backports/2.5.0/string/delete_prefix"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/fetch.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Fetch module_function
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cache_store" require "formula_support" require "lock_file"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_assertions.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Homebrew module Assertions require "rubygems"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_cellar_checks.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "utils/shell" module FormulaCellarChecks
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_creator.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "digest" require "erb"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_installer.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "cxxstdlib" require "formula" require "keg"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_pin.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" class FormulaPin
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_support.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + # Used to track formulae that cannot be installed at the same time. FormulaConflict = Struct.new(:name, :reason)
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formula_versions.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "formula" class FormulaVersions
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/formulary.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "digest/md5" require "extend/cachable"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/global.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "English" require "json" require "json/add/exception" @@ -33,7 +35,7 @@ HOMEBREW_PRODUCT = ENV["HOMEBREW_PRODUCT"] HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"] -HOMEBREW_WWW = "https://brew.sh".freeze +HOMEBREW_WWW = "https://brew.sh" require "rbconfig" ...
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/hardware.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Hardware class CPU INTEL_32BIT_ARCHS = [:i386].freeze
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/help.rb
@@ -1,4 +1,6 @@ -HOMEBREW_HELP = <<~EOS.freeze +# frozen_string_literal: true + +HOMEBREW_HELP = <<~EOS Example usage: brew search [TEXT|/REGEX/] brew info [FORMULA...]
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/install.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "diagnostic" require "fileutils" require "hardware"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/install_renamed.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module InstallRenamed def install_p(_, new_basename) super do |src, dst|
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/keg.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg_relocate" require "language/python" require "lock_file"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/keg_relocate.rb
@@ -1,7 +1,9 @@ +# frozen_string_literal: true + class Keg - PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@".freeze - CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@".freeze - REPOSITORY_PLACEHOLDER = "@@HOMEBREW_REPOSITORY@@".freeze + PREFIX_PLACEHOLDER = "@@HOMEBREW_PREFIX@@" + CELLAR_PLACEHOLDER = "@@HOMEBREW_CELLAR@@" +...
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/language/go.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "resource" module Language
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/language/haskell.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Haskell module Cabal
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/language/java.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Java def self.java_home_cmd(_ = nil)
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/language/node.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Language module Node def self.npm_cache_config
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/language/python.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "language/python_virtualenv_constants" module Language
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/language/python_virtualenv_constants.rb
@@ -1,6 +1,8 @@ +# frozen_string_literal: true + PYTHON_VIRTUALENV_URL = "https://files.pythonhosted.org/packages/37/db" \ "/89d6b043b22052109da35416abc3c397655e4bd3cff031446ba02b9654fa" \ - "/virtualenv-16.4.3.tar.gz".freeze + "/virtualenv-16.4.3.tar.gz" PYTHON_VIRTUALENV_SHA256 = - "984d7e607b0a5d1329425dd...
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/lazy_object.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + class LazyObject < Delegator def initialize(&callable) super(callable)
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/linkage_cache_store.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "set" require "cache_store"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/linkage_checker.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "keg" require "formula" require "linkage_cache_store"
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/load_path.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "pathname" HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/locale.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + class Locale class ParserError < StandardError end
true
Other
Homebrew
brew
36dbad3922ad984f7c396a9757fe8ae9750c44b0.json
Add frozen_string_literal to all files.
Library/Homebrew/lock_file.rb
@@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "fcntl" class LockFile
true
Other
Homebrew
brew
f76b083b919cccdb7ff9578575e957c4b8b4a63f.json
Use FrozenStringLiteralComment instead of flag. Unfortunately we cannot use `--frozen-string-literal` with Ruby 2.3 due to https://bugs.ruby-lang.org/issues/12031 and our usage of ERB.
Library/.rubocop.yml
@@ -93,8 +93,7 @@ Style/ConditionalAssignment: Style/Documentation: Enabled: false -# we want to add this slowly and manually -# TODO: add to more files +# don't want this for formulae but re-enabled for Library/Homebrew Style/FrozenStringLiteralComment: Enabled: false
true
Other
Homebrew
brew
f76b083b919cccdb7ff9578575e957c4b8b4a63f.json
Use FrozenStringLiteralComment instead of flag. Unfortunately we cannot use `--frozen-string-literal` with Ruby 2.3 due to https://bugs.ruby-lang.org/issues/12031 and our usage of ERB.
Library/Homebrew/.rubocop.yml
@@ -117,6 +117,11 @@ Style/DocumentationMethod: Include: - 'Library/Homebrew/formula.rb' +# don't want this for formulae but re-enabled for Library/Homebrew +Style/FrozenStringLiteralComment: + Enabled: true + EnforcedStyle: always + # so many of these in formulae but none in here Style/GuardClause: En...
true
Other
Homebrew
brew
f76b083b919cccdb7ff9578575e957c4b8b4a63f.json
Use FrozenStringLiteralComment instead of flag. Unfortunately we cannot use `--frozen-string-literal` with Ruby 2.3 due to https://bugs.ruby-lang.org/issues/12031 and our usage of ERB.
Library/Homebrew/brew.sh
@@ -348,9 +348,6 @@ else RUBY_DISABLE_OPTIONS="--disable=gems,rubyopt" fi -# Don't set this for anyone (yet) -unset HOMEBREW_FROZEN_STRING_LITERAL - if [[ -z "$HOMEBREW_RUBY_WARNINGS" ]] then export HOMEBREW_RUBY_WARNINGS="-W0" @@ -502,5 +499,5 @@ else # Unshift command back into argument list (unless a...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/cask/artifact/installer.rb
@@ -6,10 +6,10 @@ module Cask module Artifact class Installer < AbstractArtifact - VALID_KEYS = Set.new [ - :manual, - :script, - ] + VALID_KEYS = Set.new([ + :manual, + :script, + ]).freeze ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/cask/cmd/internal_stanza.rb
@@ -22,8 +22,8 @@ class InternalStanza < AbstractInternalCommand # ARTIFACTS = - DSL::ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key) + - DSL::ARTIFACT_BLOCK_CLASSES.map(&:dsl_key) + (DSL::ORDINARY_ARTIFACT_CLASSES.map(&:dsl_key) + + DSL::ARTIFACT_BLOCK_CLASSES.map(&:dsl_key)).free...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/cask/dsl.rb
@@ -46,34 +46,34 @@ class DSL Artifact::Zap, ].freeze - ACTIVATABLE_ARTIFACT_CLASSES = ORDINARY_ARTIFACT_CLASSES - [Artifact::StageOnly] + ACTIVATABLE_ARTIFACT_CLASSES = (ORDINARY_ARTIFACT_CLASSES - [Artifact::StageOnly]).freeze ARTIFACT_BLOCK_CLASSES = [ Artifact::PreflightBlock, ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/cask/dsl/container.rb
@@ -3,10 +3,10 @@ module Cask class DSL class Container - VALID_KEYS = Set.new [ - :type, - :nested, - ] + VALID_KEYS = Set.new([ + :type, + :nested, + ]).freeze attr_accessor(*VALID_KEYS) ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/cask/dsl/depends_on.rb
@@ -3,14 +3,14 @@ module Cask class DSL class DependsOn < DelegateClass(Hash) - VALID_KEYS = Set.new [ - :formula, - :cask, - :macos, - :arch, - :x11, - :java, - ].freeze + VALID_KEYS = Set.new([ + :formula, + ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/cleanup.rb
@@ -119,7 +119,7 @@ module Homebrew class Cleanup extend Predicable - PERIODIC_CLEAN_FILE = HOMEBREW_CACHE/".cleaned" + PERIODIC_CLEAN_FILE = (HOMEBREW_CACHE/".cleaned").freeze attr_predicate :dry_run?, :scrub? attr_reader :args, :days, :cache
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/compilers.rb
@@ -8,8 +8,8 @@ module CompilerConstants "llvm_clang" => :llvm_clang, }.freeze - COMPILERS = COMPILER_SYMBOL_MAP.values + - GNU_GCC_VERSIONS.map { |n| "gcc-#{n}" } + COMPILERS = (COMPILER_SYMBOL_MAP.values + + GNU_GCC_VERSIONS.map { |n| "gcc-#{n}" }).freeze end class CompilerF...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/config.rb
@@ -1,7 +1,7 @@ raise "HOMEBREW_BREW_FILE was not exported! Please call bin/brew directly!" unless ENV["HOMEBREW_BREW_FILE"] # Path to `bin/brew` main executable in `HOMEBREW_PREFIX` -HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]) +HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]).freeze ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/debrew.rb
@@ -4,7 +4,7 @@ module Debrew extend Mutex_m - Ignorable = Module.new + Ignorable = Module.new.freeze module Raise def raise(*)
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/dependency.rb
@@ -7,7 +7,7 @@ class Dependency attr_reader :name, :tags, :env_proc, :option_names - DEFAULT_ENV_PROC = proc {} + DEFAULT_ENV_PROC = proc {}.freeze def initialize(name, tags = [], env_proc = DEFAULT_ENV_PROC, option_names = [name]) raise ArgumentError, "Dependency must have a name!" unless name
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/dev-cmd/man.rb
@@ -8,9 +8,9 @@ module Homebrew module_function - SOURCE_PATH = HOMEBREW_LIBRARY_PATH/"manpages" - TARGET_MAN_PATH = HOMEBREW_REPOSITORY/"manpages" - TARGET_DOC_PATH = HOMEBREW_REPOSITORY/"docs" + SOURCE_PATH = (HOMEBREW_LIBRARY_PATH/"manpages").freeze + TARGET_MAN_PATH = (HOMEBREW_REPOSITORY/"manpages").fre...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/extend/os/mac/keg.rb
@@ -1,4 +1,4 @@ class Keg - GENERIC_KEG_LINK_DIRECTORIES = remove_const :KEG_LINK_DIRECTORIES + GENERIC_KEG_LINK_DIRECTORIES = (remove_const :KEG_LINK_DIRECTORIES).freeze KEG_LINK_DIRECTORIES = (GENERIC_KEG_LINK_DIRECTORIES + ["Frameworks"]).freeze end
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/global.rb
@@ -28,21 +28,17 @@ require "messages" require "system_command" -ARGV_WITHOUT_MONKEY_PATCHING = ARGV.dup +ARGV_WITHOUT_MONKEY_PATCHING = ARGV.dup.freeze ARGV.extend(HomebrewArgvExtension) HOMEBREW_PRODUCT = ENV["HOMEBREW_PRODUCT"] HOMEBREW_VERSION = ENV["HOMEBREW_VERSION"] HOMEBREW_WWW = "https://brew.sh".fre...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/keg.rb
@@ -77,9 +77,9 @@ def to_s # Keep relatively in sync with # https://github.com/Homebrew/install/blob/master/install - MUST_EXIST_DIRECTORIES = MUST_EXIST_SUBDIRECTORIES + [ + MUST_EXIST_DIRECTORIES = (MUST_EXIST_SUBDIRECTORIES + [ HOMEBREW_CELLAR, - ].uniq.sort.freeze + ].sort.uniq).freeze MUST_BE_W...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/load_path.rb
@@ -1,6 +1,6 @@ require "pathname" -HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath +HOMEBREW_LIBRARY_PATH = Pathname(__dir__).realpath.freeze $LOAD_PATH.push(HOMEBREW_LIBRARY_PATH.to_s) unless $LOAD_PATH.include?(HOMEBREW_LIBRARY_PATH.to_s)
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/metafiles.rb
@@ -1,13 +1,13 @@ module Metafiles # https://github.com/github/markup#markups - EXTENSIONS = Set.new %w[ - .adoc .asc .asciidoc .creole .html .markdown .md .mdown .mediawiki .mkdn - .org .pod .rdoc .rst .rtf .textile .txt .wiki - ].freeze - BASENAMES = Set.new %w[ - about authors changelog changes copyi...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/os/linux.rb
@@ -3,7 +3,11 @@ module OS module Mac module_function - ::MacOS = self # rubocop:disable Naming/ConstantName + # rubocop:disable Naming/ConstantName + # rubocop:disable Style/MutableConstant + ::MacOS = self + # rubocop:enable Naming/ConstantName + # rubocop:enable Style/MutableConstant ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/os/linux/global.rb
@@ -3,5 +3,5 @@ module Homebrew "/usr/local".freeze else "/home/linuxbrew/.linuxbrew".freeze - end + end.freeze end
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/os/mac.rb
@@ -8,7 +8,11 @@ module OS module Mac module_function - ::MacOS = self # rubocop:disable Naming/ConstantName + # rubocop:disable Naming/ConstantName + # rubocop:disable Style/MutableConstant + ::MacOS = self + # rubocop:enable Naming/ConstantName + # rubocop:enable Style/MutableConstant ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/os/mac/xquartz.rb
@@ -1,6 +1,6 @@ module OS module Mac - X11 = XQuartz = Module.new + X11 = XQuartz = Module.new # rubocop:disable Style/MutableConstant module XQuartz module_function
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/rubocops/cask/homepage_matches_url.rb
@@ -19,11 +19,11 @@ class HomepageMatchesUrl < Cop # rubocop:disable Metrics/ClassLength MSG_NO_MATCH = "`%{url}` does not match `%{full_url}`".freeze - MSG_MISSING = "`%{domain}` does not match `%{homepage}`, a comment has to be added " \ - "above the `url` stanza. For details,...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/tap.rb
@@ -11,7 +11,7 @@ class Tap extend Cachable - TAP_DIRECTORY = HOMEBREW_LIBRARY/"Taps" + TAP_DIRECTORY = (HOMEBREW_LIBRARY/"Taps").freeze def self.fetch(*args) case args.length
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/tap_constants.rb
@@ -5,7 +5,7 @@ # match taps' directory paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap HOMEBREW_TAP_DIR_REGEX = %r{#{Regexp.escape(HOMEBREW_LIBRARY)}/Taps/(?<user>[\w-]+)/(?<repo>[\w-]+)}.freeze # match taps' formula paths, e.g. HOMEBREW_LIBRARY/Taps/someuser/sometap/someformula -HOMEBREW_TAP_PATH_REGEX = Regexp...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/test/patching_spec.rb
@@ -5,8 +5,8 @@ TESTBALL_PATCHES_URL = "file://#{TEST_FIXTURE_DIR}/tarballs/testball-0.1-patches.tgz".freeze PATCH_URL_A = "file://#{TEST_FIXTURE_DIR}/patches/noop-a.diff".freeze PATCH_URL_B = "file://#{TEST_FIXTURE_DIR}/patches/noop-b.diff".freeze - PATCH_A_CONTENTS = File.read "#{TEST_FIXTURE_DIR}/patches/n...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/test/support/lib/config.rb
@@ -2,7 +2,7 @@ require "pathname" -HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]) +HOMEBREW_BREW_FILE = Pathname.new(ENV["HOMEBREW_BREW_FILE"]).freeze TEST_TMPDIR = ENV.fetch("HOMEBREW_TEST_TMPDIR") do |k| dir = Dir.mktmpdir("homebrew-tests-", ENV["HOMEBREW_TEMP"] || "/tmp") @@ -12,25 +12,27 @...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/unpack_strategy/dmg.rb
@@ -5,19 +5,19 @@ class Dmg include UnpackStrategy module Bom - DMG_METADATA = Set.new %w[ - .background - .com.apple.timemachine.donotpresent - .com.apple.timemachine.supported - .DocumentRevisions-V100 - .DS_Store - .fseventsd - .MobileBackups - ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/version.rb
@@ -52,7 +52,7 @@ def inspect end end - NULL_TOKEN = NullToken.new + NULL_TOKEN = NullToken.new.freeze class StringToken < Token PATTERN = /[a-z]+[0-9]*/i.freeze @@ -189,7 +189,7 @@ def <=>(other) PatchToken::PATTERN, NumericToken::PATTERN, StringToken::PATTERN, - ) + ).freeze ...
true
Other
Homebrew
brew
d1ea6f38d3ea1ad8d1665ad18267ed1a2ad08b8c.json
Fix mutable constants violations.
Library/Homebrew/version/null.rb
@@ -51,5 +51,5 @@ def to_s def inspect "#<Version::NULL>".freeze end - end.new + end.new.freeze end
true
Other
Homebrew
brew
8374c3713a37385acb1894facbcfe01fd7470da9.json
extract: Replace ARGV.named with args.remaining
Library/Homebrew/dev-cmd/extract.rb
@@ -96,18 +96,18 @@ def extract extract_args.parse # Expect exactly two named arguments: formula and tap - raise UsageError if ARGV.named.length != 2 + raise UsageError if args.remaining.length != 2 - if ARGV.named.first !~ HOMEBREW_TAP_FORMULA_REGEX - name = ARGV.named.first.downcase + i...
false
Other
Homebrew
brew
4b369962d303ac832cbda43fbe40562375a23896.json
test: kill all subprocesses on timeout. Fixes #5885.
Library/Homebrew/test.rb
@@ -30,5 +30,12 @@ rescue Exception => e # rubocop:disable Lint/RescueException error_pipe.puts e.to_json error_pipe.close + pid = Process.pid.to_s + if which("pgrep") && which("pkill") && system("pgrep", "-qP", pid) + $stderr.puts "Killing child processes..." + system "pkill", "-P", pid + sleep 1 + ...
false
Other
Homebrew
brew
7fbfb02625cb979ec3a82ff3bf04f8efcf6e1ace.json
Remove usage of Thread.new I benchmarked these both locally and neither use of `Thread.new` provides any measurable speedup (and in the `readall` case appears to slow things down) on my 8 core machine.
Library/Homebrew/cleanup.rb
@@ -8,30 +8,6 @@ CLEANUP_MAX_AGE_DAYS = 120 module CleanupRefinement - refine Enumerator do - def parallel - queue = Queue.new - - each do |element| - queue.enq(element) - end - - workers = (0...Hardware::CPU.cores).map do - Thread.new do - Kernel.loop do - ...
true
Other
Homebrew
brew
7fbfb02625cb979ec3a82ff3bf04f8efcf6e1ace.json
Remove usage of Thread.new I benchmarked these both locally and neither use of `Thread.new` provides any measurable speedup (and in the `readall` case appears to slow things down) on my 8 core machine.
Library/Homebrew/readall.rb
@@ -3,22 +3,11 @@ module Readall class << self def valid_ruby_syntax?(ruby_files) - ruby_files_queue = Queue.new - ruby_files.each { |f| ruby_files_queue << f } failed = false - workers = (0...Hardware::CPU.cores).map do - Thread.new do - Kernel.loop do - begin ...
true
Other
Homebrew
brew
ae63381bd979cccaf0f8f4234c6278a6b3b18634.json
cli/parser: use cli/args and tweak freeze behaviour.
Library/Homebrew/cli/parser.rb
@@ -1,5 +1,5 @@ +require "cli/args" require "optparse" -require "ostruct" require "set" COMMAND_DESC_WIDTH = 80 @@ -25,9 +25,7 @@ def self.global_options def initialize(&block) @parser = OptionParser.new - Homebrew.args = OpenStruct.new - # undefine tap to allow --tap argument - ...
true
Other
Homebrew
brew
ae63381bd979cccaf0f8f4234c6278a6b3b18634.json
cli/parser: use cli/args and tweak freeze behaviour.
Library/Homebrew/test/cli/parser_spec.rb
@@ -205,7 +205,7 @@ it "raises exception upon Homebrew.args mutation" do parser.parse(["--switch-a"]) - expect { parser.parse(["--switch-b"]) }.to raise_error(RuntimeError, /can't modify frozen OpenStruct/) + expect { parser.parse(["--switch-b"]) }.to raise_error(RuntimeError, /Arguments were al...
true
Other
Homebrew
brew
e9806b6b55afa5102b253c628c0d1c90297c5e23.json
cli/args: add class to handle arguments.
Library/Homebrew/cli/args.rb
@@ -0,0 +1,15 @@ +require "ostruct" + +module Homebrew + module CLI + class Args < OpenStruct + # undefine tap to allow --tap argument + undef tap + + def initialize(argv:) + super + @argv = argv + end + end + end +end
false
Other
Homebrew
brew
34a8ab74af5e7687e92a8a9641be1aabc14cb54d.json
global: provide unpatched ARGV.
Library/Homebrew/global.rb
@@ -28,6 +28,7 @@ require "messages" require "system_command" +ARGV_WITHOUT_MONKEY_PATCHING = ARGV.dup ARGV.extend(HomebrewArgvExtension) HOMEBREW_PRODUCT = ENV["HOMEBREW_PRODUCT"]
false
Other
Homebrew
brew
18630c70322e34f0a629c5461768a4ff1693867e.json
extend/ARGV: remove unused methods.
Library/Homebrew/extend/ARGV.rb
@@ -1,34 +1,4 @@ module HomebrewArgvExtension - def formula_install_option_names - %w[ - --debug - --env= - --ignore-dependencies - --cc= - --build-from-source - --devel - --HEAD - --keep-tmp - --interactive - --git - --sandbox - --no-sandbox - --bui...
true
Other
Homebrew
brew
18630c70322e34f0a629c5461768a4ff1693867e.json
extend/ARGV: remove unused methods.
Library/Homebrew/test/ARGV_spec.rb
@@ -91,13 +91,13 @@ it "returns true if the given string is a switch" do %w[n s i].each do |s| - expect(subject.switch?(s)).to be true + expect(subject.send("switch?", s)).to be true end end it "returns false if the given string is not a switch" do %w[b ns bar --bar...
true
Other
Homebrew
brew
888c38480188ac8b1772e85e636ee33c8c9ed252.json
release-notes: use stderr for header output. This makes the use of `brew release-notes | pbcopy` a bit easier.
Library/Homebrew/dev-cmd/release-notes.rb
@@ -49,7 +49,7 @@ def release_notes end end - puts "Release notes between #{previous_tag} and #{end_ref}:" + $stderr.puts "Release notes between #{previous_tag} and #{end_ref}:" puts output end end
false
Other
Homebrew
brew
6748b1ee84fd7c3381cf2a9918e3530c4ed9693f.json
docs: update Acceptable Formula for options/guis
docs/Acceptable-Formulae.md
@@ -60,7 +60,7 @@ Don’t make your formula build an `.app` (native macOS Application); we don’t want those things in Homebrew. Encourage upstream projects to build and support a `.app` that can be distributed by [homebrew/cask](https://github.com/Homebrew/homebrew-cask) (and used without it, too). ### Stuff that bui...
false
Other
Homebrew
brew
e0558dc7c71fd3e2d08eef876a987212c41c4f69.json
trim line breaks
Library/Homebrew/cask/artifact/installer.rb
@@ -16,7 +16,6 @@ def install_phase(**) puts <<~EOS To complete the installation of Cask #{cask}, you must also run the installer at: - '#{cask.staged_path.join(path)}' EOS end
true
Other
Homebrew
brew
e0558dc7c71fd3e2d08eef876a987212c41c4f69.json
trim line breaks
Library/Homebrew/cask/dsl/caveats.rb
@@ -48,11 +48,8 @@ def eval_caveats(&block) <<~EOS To install and/or use #{@cask} you may need to enable its kernel extension in: - System Preferences → Security & Privacy → General - For more information refer to vendor documentation or this Apple Technical Note: - ...
true
Other
Homebrew
brew
e0558dc7c71fd3e2d08eef876a987212c41c4f69.json
trim line breaks
Library/Homebrew/cask/exceptions.rb
@@ -131,13 +131,11 @@ def initialize(token, expected, actual, path) def to_s <<~EOS Checksum for Cask '#{token}' does not match. - Expected: #{Formatter.success(expected.to_s)} Actual: #{Formatter.error(actual.to_s)} File: #{path} - - To retry an incomplete d...
true
Other
Homebrew
brew
e0558dc7c71fd3e2d08eef876a987212c41c4f69.json
trim line breaks
Library/Homebrew/test/cask/cmd/info_spec.rb
@@ -84,7 +84,6 @@ Custom text via puts followed by DSL-generated text: To use with-caveats, you may need to add the /custom/path/bin directory to your PATH environment variable, e.g. (for bash shell): - export PATH=/custom/path/bin:"$PATH" EOS
true
Other
Homebrew
brew
e0558dc7c71fd3e2d08eef876a987212c41c4f69.json
trim line breaks
Library/Homebrew/test/cask/installer_spec.rb
@@ -118,7 +118,6 @@ ==> Installing Cask with-installer-manual To complete the installation of Cask with-installer-manual, you must also run the installer at: - '#{with_installer_manual.staged_path.join("Caffeine.app")}' 🍺 with-installer-manual was successfully ...
true
Other
Homebrew
brew
f9a67019d62c26d60081479934eb1f71a3d8a905.json
Improve error message on cask doctor Add fix command on brew cask doctor in case staging directory is not writable.
Library/Homebrew/cask/cmd/doctor.rb
@@ -65,6 +65,7 @@ def check_staging_location if path.exist? && !path.writable? add_error "The staging path #{user_tilde(path.to_s)} is not writable by the current user." + add_error "To fix, run \'sudo chown -R ${USER}:staff #{user_tilde(path.to_s)}'" end puts user_til...
false
Other
Homebrew
brew
426c6e2c3f24ec48c33c3937c96ae76ca786a495.json
xcode_requirement: fix Swift compatability check. Ensure we're using the full macOS version so that `MacOS::Xcode.version >= "10.14.4"` can ever be true.
Library/Homebrew/requirements/xcode_requirement.rb
@@ -12,8 +12,8 @@ def initialize(tags = []) def xcode_installed_version return false unless MacOS::Xcode.installed? + return false unless xcode_swift_compatability? return true unless @version - return true if xcode_swift_compatability? MacOS::Xcode.version >= @version end @@ -54,8 +54,8 ...
false
Other
Homebrew
brew
8457fa5af5770cd940e83b804567a3cf5d7b05a9.json
Fix 2nd typo in cleaner.rb
Library/Homebrew/cleaner.rb
@@ -37,7 +37,7 @@ def observe_file_removal(path) end # Removes any empty directories in the formula's prefix subtree - # Keeps any empty directions protected by skip_clean + # Keeps any empty directories protected by skip_clean # Removes any unresolved symlinks def prune dirs = []
false
Other
Homebrew
brew
4f8489faa109d03fbf4b4529e295bd9e7fd48920.json
Fix typo in cleaner.rb Seems like auto-correct was a bit too eager to fix things :) ?
Library/Homebrew/cleaner.rb
@@ -37,7 +37,7 @@ def observe_file_removal(path) end # Removes any empty directories in the formula's prefix subtree - # Keeps any empty directions projected by skip_clean + # Keeps any empty directions protected by skip_clean # Removes any unresolved symlinks def prune dirs = []
false
Other
Homebrew
brew
deffe8d403ff092c04b92094635eb8006c8f3bdf.json
Redirect docs.brew.sh/linux to Homebrew on Linux
docs/Homebrew-on-Linux.md
@@ -3,6 +3,7 @@ title: Homebrew on Linux logo: https://brew.sh/assets/img/linuxbrew.png image: https://brew.sh/assets/img/linuxbrew.png redirect_from: + - /linux - /Linux - /Linuxbrew ---
false
Other
Homebrew
brew
da392cd9e836cf7955e9217d7e06b7a411dab107.json
xcode_requirement: require macOS 10.14.4 for Xcode 10.2. See discussion in https://github.com/Homebrew/brew/pull/5940.
Library/Homebrew/requirements/xcode_requirement.rb
@@ -13,23 +13,32 @@ def initialize(tags = []) def xcode_installed_version return false unless MacOS::Xcode.installed? return true unless @version + return true if xcode_swift_compatability? MacOS::Xcode.version >= @version end def message version = " #{@version}" if @version mes...
false
Other
Homebrew
brew
75aa369102b882e916f35821e57bd4ba1045604d.json
Fix support for `HOMEBREW_EDITOR` with args.
Library/Homebrew/utils.rb
@@ -321,7 +321,7 @@ def which_editor def exec_editor(*args) puts "Editing #{args.join "\n"}" - with_homebrew_path { safe_system(which_editor, *args) } + with_homebrew_path { safe_system(*which_editor.shellsplit, *args) } end def exec_browser(*args)
false