diff --git a/Library/Homebrew/.yardopts b/Library/Homebrew/.yardopts index b90bbe7b213608..4bb4553c05ef6a 100644 --- a/Library/Homebrew/.yardopts +++ b/Library/Homebrew/.yardopts @@ -3,7 +3,7 @@ --markup markdown --no-private --plugin sorbet ---load yard/ignore_directives.rb +--load ./yard/docstring_parser.rb --template-path yard/templates --exclude sorbet/rbi/gems/ --exclude test/ diff --git a/Library/Homebrew/Gemfile b/Library/Homebrew/Gemfile index 533593a96f4894..d8c898284faaa4 100644 --- a/Library/Homebrew/Gemfile +++ b/Library/Homebrew/Gemfile @@ -15,6 +15,10 @@ end # installed gems (should all be require: false) # ALL gems that are not vendored should be in a group +group :doc, optional: true do + gem "yard", require: false + gem "yard-sorbet", require: false +end group :ast, optional: true do gem "rubocop-ast", require: false end diff --git a/Library/Homebrew/Gemfile.lock b/Library/Homebrew/Gemfile.lock index 02fb5f81c048fe..ec08c940feaada 100644 --- a/Library/Homebrew/Gemfile.lock +++ b/Library/Homebrew/Gemfile.lock @@ -198,6 +198,8 @@ DEPENDENCIES stackprof tapioca warning + yard + yard-sorbet RUBY VERSION ruby 3.1.4p223 diff --git a/Library/Homebrew/PATH.rb b/Library/Homebrew/PATH.rb index 9ec76658c8d9a5..474bd2f0c10d04 100644 --- a/Library/Homebrew/PATH.rb +++ b/Library/Homebrew/PATH.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Representation of a `*PATH` environment variable. -# -# @api private class PATH include Enumerable extend Forwardable diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index 2599bb40f3d5c6..abb6ec60204744 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -9,8 +9,6 @@ module Homebrew # Helper functions for using Homebrew's formulae.brew.sh API. - # - # @api private module API extend Cachable @@ -191,7 +189,6 @@ def self.internal_json_v3? end end - # @api private sig { params(block: T.proc.returns(T.untyped)).returns(T.untyped) } def self.with_no_api_env(&block) return yield if Homebrew::EnvConfig.no_install_from_api? @@ -199,7 +196,6 @@ def self.with_no_api_env(&block) with_env(HOMEBREW_NO_INSTALL_FROM_API: "1", HOMEBREW_AUTOMATICALLY_SET_NO_INSTALL_FROM_API: "1", &block) end - # @api private sig { params(condition: T::Boolean, block: T.proc.returns(T.untyped)).returns(T.untyped) } def self.with_no_api_env_if_needed(condition, &block) return yield unless condition diff --git a/Library/Homebrew/api/analytics.rb b/Library/Homebrew/api/analytics.rb index fb5ddd7b44834b..da1803f8880068 100644 --- a/Library/Homebrew/api/analytics.rb +++ b/Library/Homebrew/api/analytics.rb @@ -4,8 +4,6 @@ module Homebrew module API # Helper functions for using the analytics JSON API. - # - # @api private module Analytics class << self sig { returns(String) } diff --git a/Library/Homebrew/api/cask.rb b/Library/Homebrew/api/cask.rb index d70f6da2e17d9c..8d518c4406bb13 100644 --- a/Library/Homebrew/api/cask.rb +++ b/Library/Homebrew/api/cask.rb @@ -7,8 +7,6 @@ module Homebrew module API # Helper functions for using the cask JSON API. - # - # @api private module Cask extend Cachable diff --git a/Library/Homebrew/api/download.rb b/Library/Homebrew/api/download.rb index 8dee0067ac6fd9..28f8068dee75b4 100644 --- a/Library/Homebrew/api/download.rb +++ b/Library/Homebrew/api/download.rb @@ -5,7 +5,6 @@ module Homebrew module API - # @api private class DownloadStrategy < CurlDownloadStrategy sig { override.returns(Pathname) } def symlink_location @@ -13,7 +12,6 @@ def symlink_location end end - # @api private class Download < Downloadable sig { params( diff --git a/Library/Homebrew/api/formula.rb b/Library/Homebrew/api/formula.rb index 5cda1457537fd0..e14866fefb4f99 100644 --- a/Library/Homebrew/api/formula.rb +++ b/Library/Homebrew/api/formula.rb @@ -7,8 +7,6 @@ module Homebrew module API # Helper functions for using the formula JSON API. - # - # @api private module Formula extend Cachable diff --git a/Library/Homebrew/build.rb b/Library/Homebrew/build.rb index 9795c2e5af9a18..bdcd05d4f0925e 100644 --- a/Library/Homebrew/build.rb +++ b/Library/Homebrew/build.rb @@ -17,8 +17,6 @@ require "cmd/install" # A formula build. -# -# @api private class Build attr_reader :formula, :deps, :reqs, :args diff --git a/Library/Homebrew/build_environment.rb b/Library/Homebrew/build_environment.rb index e8427cb5c07a45..a07db8e88bfc24 100644 --- a/Library/Homebrew/build_environment.rb +++ b/Library/Homebrew/build_environment.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Settings for the build environment. -# -# @api private class BuildEnvironment sig { params(settings: Symbol).void } def initialize(*settings) diff --git a/Library/Homebrew/build_options.rb b/Library/Homebrew/build_options.rb index 10149e805a7d37..75f39c3193f166 100644 --- a/Library/Homebrew/build_options.rb +++ b/Library/Homebrew/build_options.rb @@ -2,10 +2,7 @@ # frozen_string_literal: true # Options for a formula build. -# -# @api private class BuildOptions - # @private def initialize(args, options) @args = args @options = options @@ -70,12 +67,10 @@ def any_args_or_options? !@args.empty? || !@options.empty? end - # @private def used_options @options & @args end - # @private def unused_options @options - @args end diff --git a/Library/Homebrew/bump_version_parser.rb b/Library/Homebrew/bump_version_parser.rb index 7b7636ef1f4809..cc47324e32f355 100644 --- a/Library/Homebrew/bump_version_parser.rb +++ b/Library/Homebrew/bump_version_parser.rb @@ -3,8 +3,6 @@ module Homebrew # Class handling architecture-specific version information. - # - # @api private class BumpVersionParser sig { returns(T.nilable(T.any(Version, Cask::DSL::Version))) } attr_reader :arm, :general, :intel diff --git a/Library/Homebrew/bundle_version.rb b/Library/Homebrew/bundle_version.rb index 4f2f017c97eea1..7592277120d048 100644 --- a/Library/Homebrew/bundle_version.rb +++ b/Library/Homebrew/bundle_version.rb @@ -5,8 +5,6 @@ module Homebrew # Representation of a macOS bundle version, commonly found in `Info.plist` files. - # - # @api private class BundleVersion include Comparable diff --git a/Library/Homebrew/cask/artifact.rb b/Library/Homebrew/cask/artifact.rb index 06095d0b79133e..eab26b9f4334f3 100644 --- a/Library/Homebrew/cask/artifact.rb +++ b/Library/Homebrew/cask/artifact.rb @@ -30,8 +30,6 @@ module Cask # Module containing all cask artifact classes. - # - # @api private module Artifact end end diff --git a/Library/Homebrew/cask/artifact/abstract_artifact.rb b/Library/Homebrew/cask/artifact/abstract_artifact.rb index 2128f099265d6d..a202cad6b40822 100644 --- a/Library/Homebrew/cask/artifact/abstract_artifact.rb +++ b/Library/Homebrew/cask/artifact/abstract_artifact.rb @@ -7,8 +7,6 @@ module Cask module Artifact # Abstract superclass for all artifacts. - # - # @api private class AbstractArtifact extend T::Helpers abstract! diff --git a/Library/Homebrew/cask/artifact/abstract_flight_block.rb b/Library/Homebrew/cask/artifact/abstract_flight_block.rb index eccdb10cab178a..5c8c4daec7b346 100644 --- a/Library/Homebrew/cask/artifact/abstract_flight_block.rb +++ b/Library/Homebrew/cask/artifact/abstract_flight_block.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Abstract superclass for block artifacts. - # - # @api private class AbstractFlightBlock < AbstractArtifact def self.dsl_key super.to_s.sub(/_block$/, "").to_sym diff --git a/Library/Homebrew/cask/artifact/abstract_uninstall.rb b/Library/Homebrew/cask/artifact/abstract_uninstall.rb index 8cd40e7fe4e10a..4ed93fe16a8ba3 100644 --- a/Library/Homebrew/cask/artifact/abstract_uninstall.rb +++ b/Library/Homebrew/cask/artifact/abstract_uninstall.rb @@ -12,8 +12,6 @@ module Cask module Artifact # Abstract superclass for uninstall artifacts. - # - # @api private class AbstractUninstall < AbstractArtifact include SystemCommand::Mixin diff --git a/Library/Homebrew/cask/artifact/app.rb b/Library/Homebrew/cask/artifact/app.rb index c2ec38df445448..c4775ab3230337 100644 --- a/Library/Homebrew/cask/artifact/app.rb +++ b/Library/Homebrew/cask/artifact/app.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `app` stanza. - # - # @api private class App < Moved end end diff --git a/Library/Homebrew/cask/artifact/artifact.rb b/Library/Homebrew/cask/artifact/artifact.rb index 9472fec95e7a3b..f28fa816c05dbd 100644 --- a/Library/Homebrew/cask/artifact/artifact.rb +++ b/Library/Homebrew/cask/artifact/artifact.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Generic artifact corresponding to the `artifact` stanza. - # - # @api private class Artifact < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/audio_unit_plugin.rb b/Library/Homebrew/cask/artifact/audio_unit_plugin.rb index 1fe7cf108fa527..0a8b71eaa83106 100644 --- a/Library/Homebrew/cask/artifact/audio_unit_plugin.rb +++ b/Library/Homebrew/cask/artifact/audio_unit_plugin.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `audio_unit_plugin` stanza. - # - # @api private class AudioUnitPlugin < Moved end end diff --git a/Library/Homebrew/cask/artifact/binary.rb b/Library/Homebrew/cask/artifact/binary.rb index 16bbfe84248324..c28355025db98d 100644 --- a/Library/Homebrew/cask/artifact/binary.rb +++ b/Library/Homebrew/cask/artifact/binary.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `binary` stanza. - # - # @api private class Binary < Symlinked def link(command: nil, **options) super(command:, **options) diff --git a/Library/Homebrew/cask/artifact/colorpicker.rb b/Library/Homebrew/cask/artifact/colorpicker.rb index 3743b70b21a578..a0d1bc7b5fe35a 100644 --- a/Library/Homebrew/cask/artifact/colorpicker.rb +++ b/Library/Homebrew/cask/artifact/colorpicker.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `colorpicker` stanza. - # - # @api private class Colorpicker < Moved end end diff --git a/Library/Homebrew/cask/artifact/dictionary.rb b/Library/Homebrew/cask/artifact/dictionary.rb index 50749b2bdd81b7..a247c0949e9a31 100644 --- a/Library/Homebrew/cask/artifact/dictionary.rb +++ b/Library/Homebrew/cask/artifact/dictionary.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `dictionary` stanza. - # - # @api private class Dictionary < Moved end end diff --git a/Library/Homebrew/cask/artifact/font.rb b/Library/Homebrew/cask/artifact/font.rb index caa2fcc7ba3ce4..2902156de6e1b9 100644 --- a/Library/Homebrew/cask/artifact/font.rb +++ b/Library/Homebrew/cask/artifact/font.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `font` stanza. - # - # @api private class Font < Moved end end diff --git a/Library/Homebrew/cask/artifact/input_method.rb b/Library/Homebrew/cask/artifact/input_method.rb index 79b3acaadf8753..347efba7d5e225 100644 --- a/Library/Homebrew/cask/artifact/input_method.rb +++ b/Library/Homebrew/cask/artifact/input_method.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `input_method` stanza. - # - # @api private class InputMethod < Moved end end diff --git a/Library/Homebrew/cask/artifact/installer.rb b/Library/Homebrew/cask/artifact/installer.rb index 040045c80302b1..3a746b17cc8595 100644 --- a/Library/Homebrew/cask/artifact/installer.rb +++ b/Library/Homebrew/cask/artifact/installer.rb @@ -7,8 +7,6 @@ module Cask module Artifact # Artifact corresponding to the `installer` stanza. - # - # @api private class Installer < AbstractArtifact VALID_KEYS = Set.new([ :manual, diff --git a/Library/Homebrew/cask/artifact/internet_plugin.rb b/Library/Homebrew/cask/artifact/internet_plugin.rb index 73c655a52bc345..a603b142000378 100644 --- a/Library/Homebrew/cask/artifact/internet_plugin.rb +++ b/Library/Homebrew/cask/artifact/internet_plugin.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `internet_plugin` stanza. - # - # @api private class InternetPlugin < Moved end end diff --git a/Library/Homebrew/cask/artifact/keyboard_layout.rb b/Library/Homebrew/cask/artifact/keyboard_layout.rb index 608279d2e21bbf..6b5364af14b9e5 100644 --- a/Library/Homebrew/cask/artifact/keyboard_layout.rb +++ b/Library/Homebrew/cask/artifact/keyboard_layout.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `keyboard_layout` stanza. - # - # @api private class KeyboardLayout < Moved def install_phase(**options) super(**options) diff --git a/Library/Homebrew/cask/artifact/manpage.rb b/Library/Homebrew/cask/artifact/manpage.rb index 2c085154dec1e7..de56dee06e95e6 100644 --- a/Library/Homebrew/cask/artifact/manpage.rb +++ b/Library/Homebrew/cask/artifact/manpage.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `manpage` stanza. - # - # @api private class Manpage < Symlinked attr_reader :section diff --git a/Library/Homebrew/cask/artifact/mdimporter.rb b/Library/Homebrew/cask/artifact/mdimporter.rb index 27419fa7c289f8..ae0327f40f4ec9 100644 --- a/Library/Homebrew/cask/artifact/mdimporter.rb +++ b/Library/Homebrew/cask/artifact/mdimporter.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `mdimporter` stanza. - # - # @api private class Mdimporter < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/moved.rb b/Library/Homebrew/cask/artifact/moved.rb index 22f17091a1844c..b6fe5c893f975b 100644 --- a/Library/Homebrew/cask/artifact/moved.rb +++ b/Library/Homebrew/cask/artifact/moved.rb @@ -7,8 +7,6 @@ module Cask module Artifact # Superclass for all artifacts that are installed by moving them to the target location. - # - # @api private class Moved < Relocated sig { returns(String) } def self.english_description diff --git a/Library/Homebrew/cask/artifact/pkg.rb b/Library/Homebrew/cask/artifact/pkg.rb index 0df431932fe1ef..313832b61f0f58 100644 --- a/Library/Homebrew/cask/artifact/pkg.rb +++ b/Library/Homebrew/cask/artifact/pkg.rb @@ -10,8 +10,6 @@ module Cask module Artifact # Artifact corresponding to the `pkg` stanza. - # - # @api private class Pkg < AbstractArtifact attr_reader :path, :stanza_options diff --git a/Library/Homebrew/cask/artifact/postflight_block.rb b/Library/Homebrew/cask/artifact/postflight_block.rb index 00d170fda7ce00..fb0e7b5efc2e6e 100644 --- a/Library/Homebrew/cask/artifact/postflight_block.rb +++ b/Library/Homebrew/cask/artifact/postflight_block.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `postflight` stanza. - # - # @api private class PostflightBlock < AbstractFlightBlock end end diff --git a/Library/Homebrew/cask/artifact/preflight_block.rb b/Library/Homebrew/cask/artifact/preflight_block.rb index 0b7f21c8ecd98c..d2845590356e25 100644 --- a/Library/Homebrew/cask/artifact/preflight_block.rb +++ b/Library/Homebrew/cask/artifact/preflight_block.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `preflight` stanza. - # - # @api private class PreflightBlock < AbstractFlightBlock end end diff --git a/Library/Homebrew/cask/artifact/prefpane.rb b/Library/Homebrew/cask/artifact/prefpane.rb index 04483f3170914b..a397234538424e 100644 --- a/Library/Homebrew/cask/artifact/prefpane.rb +++ b/Library/Homebrew/cask/artifact/prefpane.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `prefpane` stanza. - # - # @api private class Prefpane < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/qlplugin.rb b/Library/Homebrew/cask/artifact/qlplugin.rb index bd95a3602ab689..f38164ff1c5d29 100644 --- a/Library/Homebrew/cask/artifact/qlplugin.rb +++ b/Library/Homebrew/cask/artifact/qlplugin.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `qlplugin` stanza. - # - # @api private class Qlplugin < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/relocated.rb b/Library/Homebrew/cask/artifact/relocated.rb index 345699031dcdd1..5a66fd5cc80d7c 100644 --- a/Library/Homebrew/cask/artifact/relocated.rb +++ b/Library/Homebrew/cask/artifact/relocated.rb @@ -7,8 +7,6 @@ module Cask module Artifact # Superclass for all artifacts which have a source and a target location. - # - # @api private class Relocated < AbstractArtifact def self.from_args(cask, *args) source_string, target_hash = args diff --git a/Library/Homebrew/cask/artifact/screen_saver.rb b/Library/Homebrew/cask/artifact/screen_saver.rb index c52e0361da015e..cc9cd6249fdcb6 100644 --- a/Library/Homebrew/cask/artifact/screen_saver.rb +++ b/Library/Homebrew/cask/artifact/screen_saver.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `screen_saver` stanza. - # - # @api private class ScreenSaver < Moved end end diff --git a/Library/Homebrew/cask/artifact/service.rb b/Library/Homebrew/cask/artifact/service.rb index 901cb5ac07900b..032fd78788e54c 100644 --- a/Library/Homebrew/cask/artifact/service.rb +++ b/Library/Homebrew/cask/artifact/service.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `service` stanza. - # - # @api private class Service < Moved end end diff --git a/Library/Homebrew/cask/artifact/stage_only.rb b/Library/Homebrew/cask/artifact/stage_only.rb index 41f23e0c1180ef..1f4b12be9e89ec 100644 --- a/Library/Homebrew/cask/artifact/stage_only.rb +++ b/Library/Homebrew/cask/artifact/stage_only.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `stage_only` stanza. - # - # @api private class StageOnly < AbstractArtifact def self.from_args(cask, *args, **kwargs) if (args != [true] && args != ["true"]) || kwargs.present? diff --git a/Library/Homebrew/cask/artifact/suite.rb b/Library/Homebrew/cask/artifact/suite.rb index 6d7a2e3ccfd7dd..cc49c85b160580 100644 --- a/Library/Homebrew/cask/artifact/suite.rb +++ b/Library/Homebrew/cask/artifact/suite.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `suite` stanza. - # - # @api private class Suite < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/symlinked.rb b/Library/Homebrew/cask/artifact/symlinked.rb index 1f5199d8876229..1de7e715ddb358 100644 --- a/Library/Homebrew/cask/artifact/symlinked.rb +++ b/Library/Homebrew/cask/artifact/symlinked.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Superclass for all artifacts which are installed by symlinking them to the target location. - # - # @api private class Symlinked < Relocated sig { returns(String) } def self.link_type_english_name diff --git a/Library/Homebrew/cask/artifact/uninstall.rb b/Library/Homebrew/cask/artifact/uninstall.rb index 4b83e183252a76..cbb3b9cd78ddff 100644 --- a/Library/Homebrew/cask/artifact/uninstall.rb +++ b/Library/Homebrew/cask/artifact/uninstall.rb @@ -8,8 +8,6 @@ module Cask module Artifact # Artifact corresponding to the `uninstall` stanza. - # - # @api private class Uninstall < AbstractUninstall def uninstall_phase(upgrade: false, reinstall: false, **options) filtered_directives = ORDERED_DIRECTIVES.filter do |directive_sym| diff --git a/Library/Homebrew/cask/artifact/vst3_plugin.rb b/Library/Homebrew/cask/artifact/vst3_plugin.rb index 313c09cb95665e..f59701de59e0dd 100644 --- a/Library/Homebrew/cask/artifact/vst3_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst3_plugin.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `vst3_plugin` stanza. - # - # @api private class Vst3Plugin < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/vst_plugin.rb b/Library/Homebrew/cask/artifact/vst_plugin.rb index d2cdca6073e13d..cd330cc840fd16 100644 --- a/Library/Homebrew/cask/artifact/vst_plugin.rb +++ b/Library/Homebrew/cask/artifact/vst_plugin.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `vst_plugin` stanza. - # - # @api private class VstPlugin < Moved sig { returns(String) } def self.english_name diff --git a/Library/Homebrew/cask/artifact/zap.rb b/Library/Homebrew/cask/artifact/zap.rb index eadc014618ea61..052149986a0b28 100644 --- a/Library/Homebrew/cask/artifact/zap.rb +++ b/Library/Homebrew/cask/artifact/zap.rb @@ -6,8 +6,6 @@ module Cask module Artifact # Artifact corresponding to the `zap` stanza. - # - # @api private class Zap < AbstractUninstall def zap_phase(**options) dispatch_uninstall_directives(**options) diff --git a/Library/Homebrew/cask/artifact_set.rb b/Library/Homebrew/cask/artifact_set.rb index b92d1eeaf9ea02..e3d45a9178bf8b 100644 --- a/Library/Homebrew/cask/artifact_set.rb +++ b/Library/Homebrew/cask/artifact_set.rb @@ -5,8 +5,6 @@ module Cask # Sorted set containing all cask artifacts. - # - # @api private class ArtifactSet < ::Set def each(&block) return enum_for(T.must(__method__)) { size } unless block diff --git a/Library/Homebrew/cask/audit.rb b/Library/Homebrew/cask/audit.rb index f2805902ef0f6a..067e775c9c31c0 100644 --- a/Library/Homebrew/cask/audit.rb +++ b/Library/Homebrew/cask/audit.rb @@ -14,8 +14,6 @@ module Cask # Audit a cask for various problems. - # - # @api private class Audit include SystemCommand::Mixin include ::Utils::Curl diff --git a/Library/Homebrew/cask/auditor.rb b/Library/Homebrew/cask/auditor.rb index 1485429020c7e4..7b5424e8f1931e 100644 --- a/Library/Homebrew/cask/auditor.rb +++ b/Library/Homebrew/cask/auditor.rb @@ -5,8 +5,6 @@ module Cask # Helper class for auditing all available languages of a cask. - # - # @api private class Auditor def self.audit(cask, **options) new(cask, **options).audit diff --git a/Library/Homebrew/cask/cache.rb b/Library/Homebrew/cask/cache.rb index d515d9d7a4a41c..9735e4789d8138 100644 --- a/Library/Homebrew/cask/cache.rb +++ b/Library/Homebrew/cask/cache.rb @@ -3,8 +3,6 @@ module Cask # Helper functions for the cask cache. - # - # @api private module Cache sig { returns(Pathname) } def self.path diff --git a/Library/Homebrew/cask/cask.rb b/Library/Homebrew/cask/cask.rb index aa044484a8dd3c..e7856806ce737e 100644 --- a/Library/Homebrew/cask/cask.rb +++ b/Library/Homebrew/cask/cask.rb @@ -12,8 +12,6 @@ module Cask # An instance of a cask. - # - # @api private class Cask extend Forwardable extend Attrable @@ -35,7 +33,6 @@ class Cask attr_predicate :loaded_from_api? - # @api private def self.all(eval_all: false) if !eval_all && !Homebrew::EnvConfig.eval_all? raise ArgumentError, "Cask::Cask#all cannot be used without `--eval-all` or HOMEBREW_EVAL_ALL" @@ -383,7 +380,6 @@ def to_h } end - # @private def to_internal_api_hash api_hash = { "token" => token, @@ -426,7 +422,6 @@ def to_internal_api_hash HASH_KEYS_TO_SKIP = %w[outdated installed versions].freeze private_constant :HASH_KEYS_TO_SKIP - # @private def to_hash_with_variations(hash_method: :to_h) case hash_method when :to_h diff --git a/Library/Homebrew/cask/cask_loader.rb b/Library/Homebrew/cask/cask_loader.rb index 5f6aeaba377bb9..b92b06e38f53a9 100644 --- a/Library/Homebrew/cask/cask_loader.rb +++ b/Library/Homebrew/cask/cask_loader.rb @@ -9,8 +9,6 @@ module Cask # Loads a cask from various sources. - # - # @api private module CaskLoader extend Context diff --git a/Library/Homebrew/cask/denylist.rb b/Library/Homebrew/cask/denylist.rb index 7afbcb46b1992e..d65584862e8cf8 100644 --- a/Library/Homebrew/cask/denylist.rb +++ b/Library/Homebrew/cask/denylist.rb @@ -3,8 +3,6 @@ module Cask # List of casks which are not allowed in official taps. - # - # @api private module Denylist sig { params(name: String).returns(T.nilable(String)) } def self.reason(name) diff --git a/Library/Homebrew/cask/download.rb b/Library/Homebrew/cask/download.rb index 047def35b189aa..cf71a16fa2766f 100644 --- a/Library/Homebrew/cask/download.rb +++ b/Library/Homebrew/cask/download.rb @@ -8,8 +8,6 @@ module Cask # A download corresponding to a {Cask}. - # - # @api private class Download < ::Downloadable include Context diff --git a/Library/Homebrew/cask/dsl.rb b/Library/Homebrew/cask/dsl.rb index e70b07f0205dad..24424f3f70f519 100644 --- a/Library/Homebrew/cask/dsl.rb +++ b/Library/Homebrew/cask/dsl.rb @@ -30,8 +30,6 @@ module Cask # Class representing the domain-specific language used for casks. - # - # @api private class DSL ORDINARY_ARTIFACT_CLASSES = [ Artifact::Installer, diff --git a/Library/Homebrew/cask/dsl/base.rb b/Library/Homebrew/cask/dsl/base.rb index 9a529b6d67de44..b849665a4092de 100644 --- a/Library/Homebrew/cask/dsl/base.rb +++ b/Library/Homebrew/cask/dsl/base.rb @@ -7,8 +7,6 @@ module Cask class DSL # Superclass for all stanzas which take a block. - # - # @api private class Base extend Forwardable diff --git a/Library/Homebrew/cask/dsl/caveats.rb b/Library/Homebrew/cask/dsl/caveats.rb index 2e26ff40530ca1..2ccb4396be501e 100644 --- a/Library/Homebrew/cask/dsl/caveats.rb +++ b/Library/Homebrew/cask/dsl/caveats.rb @@ -14,8 +14,6 @@ class DSL # The return value of the last method in the block is also sent # to the output by the caller, but that feature is only for the # convenience of cask authors. - # - # @api private class Caveats < Base extend Attrable diff --git a/Library/Homebrew/cask/dsl/conflicts_with.rb b/Library/Homebrew/cask/dsl/conflicts_with.rb index 1b177198fd378c..c4a43116c499cc 100644 --- a/Library/Homebrew/cask/dsl/conflicts_with.rb +++ b/Library/Homebrew/cask/dsl/conflicts_with.rb @@ -7,8 +7,6 @@ module Cask class DSL # Class corresponding to the `conflicts_with` stanza. - # - # @api private class ConflictsWith < SimpleDelegator VALID_KEYS = [ :formula, diff --git a/Library/Homebrew/cask/dsl/container.rb b/Library/Homebrew/cask/dsl/container.rb index aa2e17563239aa..bb4beaa27fb8df 100644 --- a/Library/Homebrew/cask/dsl/container.rb +++ b/Library/Homebrew/cask/dsl/container.rb @@ -6,8 +6,6 @@ module Cask class DSL # Class corresponding to the `container` stanza. - # - # @api private class Container attr_accessor :nested, :type diff --git a/Library/Homebrew/cask/dsl/depends_on.rb b/Library/Homebrew/cask/dsl/depends_on.rb index e56faf089398a8..31ff402d554297 100644 --- a/Library/Homebrew/cask/dsl/depends_on.rb +++ b/Library/Homebrew/cask/dsl/depends_on.rb @@ -8,8 +8,6 @@ module Cask class DSL # Class corresponding to the `depends_on` stanza. - # - # @api private class DependsOn < SimpleDelegator VALID_KEYS = Set.new([ :formula, diff --git a/Library/Homebrew/cask/dsl/postflight.rb b/Library/Homebrew/cask/dsl/postflight.rb index 5231502325ba2b..3ceabd9cab3052 100644 --- a/Library/Homebrew/cask/dsl/postflight.rb +++ b/Library/Homebrew/cask/dsl/postflight.rb @@ -6,8 +6,6 @@ module Cask class DSL # Class corresponding to the `postflight` stanza. - # - # @api private class Postflight < Base include Staged diff --git a/Library/Homebrew/cask/dsl/preflight.rb b/Library/Homebrew/cask/dsl/preflight.rb index 79d2a63ba8556e..abaf1fb9751c32 100644 --- a/Library/Homebrew/cask/dsl/preflight.rb +++ b/Library/Homebrew/cask/dsl/preflight.rb @@ -6,8 +6,6 @@ module Cask class DSL # Class corresponding to the `preflight` stanza. - # - # @api private class Preflight < Base include Staged end diff --git a/Library/Homebrew/cask/dsl/uninstall_postflight.rb b/Library/Homebrew/cask/dsl/uninstall_postflight.rb index 9dc523b05d0a04..1a3e38e86887a7 100644 --- a/Library/Homebrew/cask/dsl/uninstall_postflight.rb +++ b/Library/Homebrew/cask/dsl/uninstall_postflight.rb @@ -4,8 +4,6 @@ module Cask class DSL # Class corresponding to the `uninstall_postflight` stanza. - # - # @api private class UninstallPostflight < Base end end diff --git a/Library/Homebrew/cask/dsl/uninstall_preflight.rb b/Library/Homebrew/cask/dsl/uninstall_preflight.rb index d35da3f51fa70a..5280e638bdb77e 100644 --- a/Library/Homebrew/cask/dsl/uninstall_preflight.rb +++ b/Library/Homebrew/cask/dsl/uninstall_preflight.rb @@ -6,8 +6,6 @@ module Cask class DSL # Class corresponding to the `uninstall_preflight` stanza. - # - # @api private class UninstallPreflight < Base include Staged end diff --git a/Library/Homebrew/cask/dsl/version.rb b/Library/Homebrew/cask/dsl/version.rb index 3b1887c0cda1b1..853a4f191ce7ed 100644 --- a/Library/Homebrew/cask/dsl/version.rb +++ b/Library/Homebrew/cask/dsl/version.rb @@ -4,8 +4,6 @@ module Cask class DSL # Class corresponding to the `version` stanza. - # - # @api private class Version < ::String DIVIDERS = { "." => :dots, diff --git a/Library/Homebrew/cask/exceptions.rb b/Library/Homebrew/cask/exceptions.rb index ff9332a0a51748..fc354f4e198401 100644 --- a/Library/Homebrew/cask/exceptions.rb +++ b/Library/Homebrew/cask/exceptions.rb @@ -3,13 +3,9 @@ module Cask # General cask error. - # - # @api private class CaskError < RuntimeError; end # Cask error containing multiple other errors. - # - # @api private class MultipleCaskErrors < CaskError def initialize(errors) super() @@ -28,8 +24,6 @@ def to_s end # Abstract cask error containing a cask token. - # - # @api private class AbstractCaskErrorWithToken < CaskError sig { returns(String) } attr_reader :token @@ -46,8 +40,6 @@ def initialize(token, reason = nil) end # Error when a cask is not installed. - # - # @api private class CaskNotInstalledError < AbstractCaskErrorWithToken # @!visibility private sig { returns(String) } @@ -57,8 +49,6 @@ def to_s end # Error when a cask cannot be installed. - # - # @api private class CaskCannotBeInstalledError < AbstractCaskErrorWithToken attr_reader :message @@ -75,8 +65,6 @@ def to_s end # Error when a cask conflicts with another cask. - # - # @api private class CaskConflictError < AbstractCaskErrorWithToken attr_reader :conflicting_cask @@ -93,8 +81,6 @@ def to_s end # Error when a cask is not available. - # - # @api private class CaskUnavailableError < AbstractCaskErrorWithToken # @!visibility private sig { returns(String) } @@ -104,8 +90,6 @@ def to_s end # Error when a cask is unreadable. - # - # @api private class CaskUnreadableError < CaskUnavailableError # @!visibility private sig { returns(String) } @@ -115,8 +99,6 @@ def to_s end # Error when a cask in a specific tap is not available. - # - # @api private class TapCaskUnavailableError < CaskUnavailableError attr_reader :tap @@ -135,8 +117,6 @@ def to_s end # Error when a cask with the same name is found in multiple taps. - # - # @api private class TapCaskAmbiguityError < CaskError sig { returns(String) } attr_reader :token @@ -161,8 +141,6 @@ def initialize(token, loaders) end # Error when a cask already exists. - # - # @api private class CaskAlreadyCreatedError < AbstractCaskErrorWithToken # @!visibility private sig { returns(String) } @@ -172,8 +150,6 @@ def to_s end # Error when there is a cyclic cask dependency. - # - # @api private class CaskCyclicDependencyError < AbstractCaskErrorWithToken # @!visibility private sig { returns(String) } @@ -183,8 +159,6 @@ def to_s end # Error when a cask depends on itself. - # - # @api private class CaskSelfReferencingDependencyError < CaskCyclicDependencyError # @!visibility private sig { returns(String) } @@ -194,8 +168,6 @@ def to_s end # Error when no cask is specified. - # - # @api private class CaskUnspecifiedError < CaskError # @!visibility private sig { returns(String) } @@ -205,8 +177,6 @@ def to_s end # Error when a cask is invalid. - # - # @api private class CaskInvalidError < AbstractCaskErrorWithToken # @!visibility private sig { returns(String) } @@ -216,8 +186,6 @@ def to_s end # Error when a cask token does not match the file name. - # - # @api private class CaskTokenMismatchError < CaskInvalidError def initialize(token, header_token) super(token, "Token '#{header_token}' in header line does not match the file name.") @@ -225,8 +193,6 @@ def initialize(token, header_token) end # Error during quarantining of a file. - # - # @api private class CaskQuarantineError < CaskError attr_reader :path, :reason @@ -253,8 +219,6 @@ def to_s end # Error while propagating quarantine information to subdirectories. - # - # @api private class CaskQuarantinePropagationError < CaskQuarantineError # @!visibility private sig { returns(String) } @@ -272,8 +236,6 @@ def to_s end # Error while removing quarantine information. - # - # @api private class CaskQuarantineReleaseError < CaskQuarantineError # @!visibility private sig { returns(String) } diff --git a/Library/Homebrew/cask/info.rb b/Library/Homebrew/cask/info.rb index 8864e4f44b513c..18ccf66894881b 100644 --- a/Library/Homebrew/cask/info.rb +++ b/Library/Homebrew/cask/info.rb @@ -4,8 +4,6 @@ require "json" module Cask - # - # @api private class Info def self.get_info(cask) require "cask/installer" diff --git a/Library/Homebrew/cask/installer.rb b/Library/Homebrew/cask/installer.rb index 8148e50d357ea3..b7d4309ca92813 100644 --- a/Library/Homebrew/cask/installer.rb +++ b/Library/Homebrew/cask/installer.rb @@ -15,8 +15,6 @@ module Cask # Installer for a {Cask}. - # - # @api private class Installer extend Attrable diff --git a/Library/Homebrew/cask/list.rb b/Library/Homebrew/cask/list.rb index 82d0ddf2ad1c8a..2333ae620e8c64 100644 --- a/Library/Homebrew/cask/list.rb +++ b/Library/Homebrew/cask/list.rb @@ -4,7 +4,6 @@ require "cask/artifact/relocated" module Cask - # @api private class List def self.list_casks(*casks, one: false, full_name: false, versions: false) output = if casks.any? diff --git a/Library/Homebrew/cask/metadata.rb b/Library/Homebrew/cask/metadata.rb index c7c664808499c1..eabb22275ac3e2 100644 --- a/Library/Homebrew/cask/metadata.rb +++ b/Library/Homebrew/cask/metadata.rb @@ -3,8 +3,6 @@ module Cask # Helper module for reading and writing cask metadata. - # - # @api private module Metadata METADATA_SUBDIR = ".metadata" TIMESTAMP_FORMAT = "%Y%m%d%H%M%S.%L" diff --git a/Library/Homebrew/cask/pkg.rb b/Library/Homebrew/cask/pkg.rb index 8d204251d72c70..0540d8427e196b 100644 --- a/Library/Homebrew/cask/pkg.rb +++ b/Library/Homebrew/cask/pkg.rb @@ -5,8 +5,6 @@ module Cask # Helper class for uninstalling `.pkg` installers. - # - # @api private class Pkg sig { params(regexp: String, command: T.class_of(SystemCommand)).returns(T::Array[Pkg]) } def self.all_matching(regexp, command) diff --git a/Library/Homebrew/cask/quarantine.rb b/Library/Homebrew/cask/quarantine.rb index 2d5fd2589201ff..2fdd99c98ff753 100644 --- a/Library/Homebrew/cask/quarantine.rb +++ b/Library/Homebrew/cask/quarantine.rb @@ -7,8 +7,6 @@ module Cask # Helper module for quarantining files. - # - # @api private module Quarantine extend SystemCommand::Mixin diff --git a/Library/Homebrew/cask/reinstall.rb b/Library/Homebrew/cask/reinstall.rb index 1a4cf728d8e9b3..7fa966fc1e8487 100644 --- a/Library/Homebrew/cask/reinstall.rb +++ b/Library/Homebrew/cask/reinstall.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true module Cask - # - # @api private class Reinstall def self.reinstall_casks( *casks, diff --git a/Library/Homebrew/cask/staged.rb b/Library/Homebrew/cask/staged.rb index 74df26ec2165c9..613c3e42c16b0f 100644 --- a/Library/Homebrew/cask/staged.rb +++ b/Library/Homebrew/cask/staged.rb @@ -5,8 +5,6 @@ module Cask # Helper functions for staged casks. - # - # @api private module Staged # FIXME: Enable cop again when https://github.com/sorbet/sorbet/issues/3532 is fixed. # rubocop:disable Style/MutableConstant diff --git a/Library/Homebrew/cask/uninstall.rb b/Library/Homebrew/cask/uninstall.rb index be1da477a66ccd..bd17ff7bbfaca7 100644 --- a/Library/Homebrew/cask/uninstall.rb +++ b/Library/Homebrew/cask/uninstall.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true module Cask - # @api private class Uninstall def self.uninstall_casks(*casks, binaries: nil, force: false, verbose: false) require "cask/installer" diff --git a/Library/Homebrew/cask/upgrade.rb b/Library/Homebrew/cask/upgrade.rb index 558109b6dfec9c..f0dc11178dcc31 100644 --- a/Library/Homebrew/cask/upgrade.rb +++ b/Library/Homebrew/cask/upgrade.rb @@ -5,7 +5,6 @@ require "cask/config" module Cask - # @api private class Upgrade sig { params( diff --git a/Library/Homebrew/cask/url.rb b/Library/Homebrew/cask/url.rb index 792ee814a2adac..4afd7463970a37 100644 --- a/Library/Homebrew/cask/url.rb +++ b/Library/Homebrew/cask/url.rb @@ -6,10 +6,7 @@ module Cask # Class corresponding to the `url` stanza. - # - # @api private class URL < Delegator - # @api private class DSL attr_reader :uri, :specs, :verified, :using, @@ -79,7 +76,6 @@ def initialize( end end - # @api private class BlockDSL # To access URL associated with page contents. module PageWithURL diff --git a/Library/Homebrew/cask/utils.rb b/Library/Homebrew/cask/utils.rb index 4f8f2afffaec99..8a8cddfbcc1954 100644 --- a/Library/Homebrew/cask/utils.rb +++ b/Library/Homebrew/cask/utils.rb @@ -8,8 +8,6 @@ module Cask # Helper functions for various cask operations. - # - # @api private module Utils def self.gain_permissions_mkpath(path, command: SystemCommand) dir = path.ascend.find(&:directory?) diff --git a/Library/Homebrew/caveats.rb b/Library/Homebrew/caveats.rb index c2fe663de65197..49af60b28240cf 100644 --- a/Library/Homebrew/caveats.rb +++ b/Library/Homebrew/caveats.rb @@ -5,8 +5,6 @@ require "utils/service" # A formula's caveats. -# -# @api private class Caveats extend Forwardable diff --git a/Library/Homebrew/checksum.rb b/Library/Homebrew/checksum.rb index b79cc301273282..210a9fb2e4c5be 100644 --- a/Library/Homebrew/checksum.rb +++ b/Library/Homebrew/checksum.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # A formula's checksum. -# -# @api private class Checksum extend Forwardable diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index d3176c26ca61c8..c5b2a437d7a675 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -10,8 +10,6 @@ module Homebrew # Helper class for cleaning up the Homebrew cache. - # - # @api private class Cleanup CLEANUP_DEFAULT_DAYS = Homebrew::EnvConfig.cleanup_periodic_full_days.to_i.freeze private_constant :CLEANUP_DEFAULT_DAYS diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index da8118f2ce5527..5bb1e5441fb907 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -8,8 +8,6 @@ module Homebrew module CLI # Helper class for loading formulae/casks from named arguments. - # - # @api private class NamedArgs < Array sig { params( diff --git a/Library/Homebrew/commands.rb b/Library/Homebrew/commands.rb index d57563a27d3a7a..3a31f7466c5035 100644 --- a/Library/Homebrew/commands.rb +++ b/Library/Homebrew/commands.rb @@ -4,8 +4,6 @@ require "completions" # Helper functions for commands. -# -# @api private module Commands HOMEBREW_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"cmd").freeze HOMEBREW_DEV_CMD_PATH = (HOMEBREW_LIBRARY_PATH/"dev-cmd").freeze diff --git a/Library/Homebrew/compilers.rb b/Library/Homebrew/compilers.rb index e13fc426470103..03e8d3e806344e 100644 --- a/Library/Homebrew/compilers.rb +++ b/Library/Homebrew/compilers.rb @@ -1,7 +1,6 @@ # typed: true # frozen_string_literal: true -# @private module CompilerConstants GNU_GCC_VERSIONS = %w[4.9 5 6 7 8 9 10 11 12 13].freeze GNU_GCC_REGEXP = /^gcc-(4\.9|[5-9]|10|11|12|13)$/ @@ -16,8 +15,6 @@ module CompilerConstants end # Class for checking compiler compatibility for a formula. -# -# @api private class CompilerFailure attr_reader :type @@ -99,8 +96,6 @@ def gcc_major(version) end # Class for selecting a compiler for a formula. -# -# @api private class CompilerSelector include CompilerConstants diff --git a/Library/Homebrew/completions.rb b/Library/Homebrew/completions.rb index 60d50f155587dd..b1eafb3f10a64b 100644 --- a/Library/Homebrew/completions.rb +++ b/Library/Homebrew/completions.rb @@ -7,8 +7,6 @@ module Homebrew # Helper functions for generating shell completions. - # - # @api private module Completions Variables = Struct.new( :aliases, diff --git a/Library/Homebrew/context.rb b/Library/Homebrew/context.rb index d1f01c48deff2d..801f34faabd875 100644 --- a/Library/Homebrew/context.rb +++ b/Library/Homebrew/context.rb @@ -4,8 +4,6 @@ require "monitor" # Module for querying the current execution context. -# -# @api private module Context extend MonitorMixin diff --git a/Library/Homebrew/debrew.rb b/Library/Homebrew/debrew.rb index c465f5d22c8324..15d514e084b38a 100644 --- a/Library/Homebrew/debrew.rb +++ b/Library/Homebrew/debrew.rb @@ -6,8 +6,6 @@ require "ignorable" # Helper module for debugging formulae. -# -# @api private module Debrew extend Mutex_m diff --git a/Library/Homebrew/debrew/irb.rb b/Library/Homebrew/debrew/irb.rb index af3c358c9d3a41..ade8673e47dcb2 100644 --- a/Library/Homebrew/debrew/irb.rb +++ b/Library/Homebrew/debrew/irb.rb @@ -3,7 +3,6 @@ require "irb" -# @private module IRB def self.start_within(binding) unless @setup_done diff --git a/Library/Homebrew/dependable.rb b/Library/Homebrew/dependable.rb index 6e4819ed2200a0..570309d540696b 100644 --- a/Library/Homebrew/dependable.rb +++ b/Library/Homebrew/dependable.rb @@ -4,8 +4,6 @@ require "options" # Shared functions for classes which can be depended upon. -# -# @api private module Dependable # `:run` and `:linked` are no longer used but keep them here to avoid their # misuse in future. diff --git a/Library/Homebrew/dependencies.rb b/Library/Homebrew/dependencies.rb index d59dde9a90d554..a38912a036712c 100644 --- a/Library/Homebrew/dependencies.rb +++ b/Library/Homebrew/dependencies.rb @@ -4,8 +4,6 @@ require "delegate" # A collection of dependencies. -# -# @api private class Dependencies < SimpleDelegator def initialize(*args) super(args) @@ -45,8 +43,6 @@ def inspect end # A collection of requirements. -# -# @api private class Requirements < SimpleDelegator def initialize(*args) super(Set.new(args)) diff --git a/Library/Homebrew/dependencies_helpers.rb b/Library/Homebrew/dependencies_helpers.rb index 0f0b6928a084c1..fa6b3b2b4bc072 100644 --- a/Library/Homebrew/dependencies_helpers.rb +++ b/Library/Homebrew/dependencies_helpers.rb @@ -4,8 +4,6 @@ require "cask_dependent" # Helper functions for dependencies. -# -# @api private module DependenciesHelpers def args_includes_ignores(args) includes = [:required?, :recommended?] # included by default diff --git a/Library/Homebrew/dependency.rb b/Library/Homebrew/dependency.rb index ce79b7fa47cdf5..2e03e08ee393a6 100644 --- a/Library/Homebrew/dependency.rb +++ b/Library/Homebrew/dependency.rb @@ -4,8 +4,6 @@ require "dependable" # A dependency on another Homebrew formula. -# -# @api private class Dependency extend Forwardable include Dependable @@ -28,10 +26,6 @@ def initialize(name, tags = []) @tap, = tap_with_name end - # @!visibility private - sig { returns(String) } - def to_s = name - def ==(other) instance_of?(other.class) && name == other.name && tags == other.tags end @@ -100,6 +94,10 @@ def uses_from_macos? false end + # @!visibility private + sig { returns(String) } + def to_s = name + # @!visibility private sig { returns(String) } def inspect diff --git a/Library/Homebrew/dependency_collector.rb b/Library/Homebrew/dependency_collector.rb index 713818655f5e8a..4d03ada7f81e91 100644 --- a/Library/Homebrew/dependency_collector.rb +++ b/Library/Homebrew/dependency_collector.rb @@ -158,7 +158,7 @@ def parse_string_spec(spec, tags) def parse_symbol_spec(spec, tags) # When modifying this list of supported requirements, consider - # whether Formulary::API_SUPPORTED_REQUIREMENTS should also be changed. + # whether `Formulary::API_SUPPORTED_REQUIREMENTS` should also be changed. case spec when :arch then ArchRequirement.new(tags) when :codesign then CodesignRequirement.new(tags) diff --git a/Library/Homebrew/deprecate_disable.rb b/Library/Homebrew/deprecate_disable.rb index fcd8081954c78d..36d69839c9bfd7 100644 --- a/Library/Homebrew/deprecate_disable.rb +++ b/Library/Homebrew/deprecate_disable.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Helper module for handling `disable!` and `deprecate!`. -# -# @api private module DeprecateDisable module_function diff --git a/Library/Homebrew/descriptions.rb b/Library/Homebrew/descriptions.rb index 80e9fa89df6cb2..309ff26cc95e1e 100644 --- a/Library/Homebrew/descriptions.rb +++ b/Library/Homebrew/descriptions.rb @@ -6,8 +6,6 @@ require "search" # Helper class for printing and searching descriptions. -# -# @api private class Descriptions # Given a regex, find all formulae whose specified fields contain a match. def self.search(string_or_regex, field, cache_store, eval_all = Homebrew::EnvConfig.eval_all?) diff --git a/Library/Homebrew/dev-cmd/rubydoc.rb b/Library/Homebrew/dev-cmd/rubydoc.rb new file mode 100644 index 00000000000000..e1794e4afe48e9 --- /dev/null +++ b/Library/Homebrew/dev-cmd/rubydoc.rb @@ -0,0 +1,38 @@ +# typed: true +# frozen_string_literal: true + +require "cli/parser" +require "formula" + +module Homebrew + module DevCmd + class Audit < AbstractCommand + cmd_args do + description <<~EOS + Generate Homebrew's RubyDoc documentation. + EOS + switch "--only-public", + description: "Only generate public API documentation." + switch "--open", + description: "Open generated documentation in a browser." + end + + sig { void } + def run + Homebrew.install_bundler_gems!(groups: ["doc"]) + + HOMEBREW_LIBRARY_PATH.cd do + no_api_args = if args.only_public? + ["--hide-api", "private", "--hide-api", "internal"] + else + [] + end + + system "bundle", "exec", "yard", "doc", "--output", "doc", *no_api_args + + exec_browser "file://#{HOMEBREW_LIBRARY_PATH}/doc/index.html" if args.open? + end + end + end + end +end diff --git a/Library/Homebrew/development_tools.rb b/Library/Homebrew/development_tools.rb index 15dbd2461264ee..9d900f5a0f101b 100644 --- a/Library/Homebrew/development_tools.rb +++ b/Library/Homebrew/development_tools.rb @@ -3,9 +3,14 @@ require "version" -# @private +# Helper class for gathering information about development tools. +# +# @api public class DevelopmentTools class << self + # Locate a development tool. + # + # @api public sig { params(tool: T.any(String, Symbol)).returns(T.nilable(Pathname)) } def locate(tool) # Don't call tools (cc, make, strip, etc.) directly! @@ -44,11 +49,17 @@ def insecure_download_warning(resource) "Checksums will still be verified." end + # Get the default C compiler. + # + # @api public sig { returns(Symbol) } def default_compiler :clang end + # Get the Clang version. + # + # @api public sig { returns(Version) } def clang_version @clang_version ||= if (path = locate("clang")) && @@ -59,6 +70,9 @@ def clang_version end end + # Get the Clang build version. + # + # @api public sig { returns(Version) } def clang_build_version @clang_build_version ||= if (path = locate("clang")) && @@ -70,6 +84,9 @@ def clang_build_version end end + # Get the LLVM Clang build version. + # + # @api public sig { returns(Version) } def llvm_clang_build_version @llvm_clang_build_version ||= begin diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index 9792ed45f6f50c..a14d89d501f4a0 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -15,8 +15,6 @@ module Homebrew # Module containing diagnostic checks. - # - # @api private module Diagnostic def self.missing_deps(formulae, hide = nil) missing = {} diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index bc5cd52425bd9c..2252caeb6e74f5 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -23,8 +23,6 @@ class Mechanize; end require "github_packages" # @abstract Abstract superclass for all download strategies. -# -# @api private class AbstractDownloadStrategy extend Forwardable include FileUtils @@ -32,8 +30,6 @@ class AbstractDownloadStrategy include SystemCommand::Mixin # Extension for bottle downloads. - # - # @api private module Pourable def stage ohai "Pouring #{basename}" @@ -83,7 +79,6 @@ def quiet! # Disable any output during downloading. # # @deprecated - # @api private sig { void } def shutup! odeprecated "AbstractDownloadStrategy#shutup!", "AbstractDownloadStrategy#quiet!" @@ -188,8 +183,6 @@ def env end # @abstract Abstract superclass for all download strategies downloading from a version control system. -# -# @api private class VCSDownloadStrategy < AbstractDownloadStrategy REF_TYPES = [:tag, :branch, :revisions, :revision].freeze @@ -278,8 +271,6 @@ def extract_ref(specs) end # @abstract Abstract superclass for all download strategies downloading a single file. -# -# @api private class AbstractFileDownloadStrategy < AbstractDownloadStrategy # Path for storing an incomplete download while the download is still in progress. # @@ -716,8 +707,6 @@ def stage end # Strategy for extracting local binary packages. -# -# @api private class LocalBottleDownloadStrategy < AbstractFileDownloadStrategy def initialize(path) # rubocop:disable Lint/MissingSuper @cached_location = path @@ -1444,8 +1433,6 @@ def update(timeout: nil) end # Helper class for detecting a download strategy from a URL. -# -# @api private class DownloadStrategyDetector def self.detect(url, using = nil) if using.nil? diff --git a/Library/Homebrew/downloadable.rb b/Library/Homebrew/downloadable.rb index 629cc9867aa5b0..8c03630621f82b 100644 --- a/Library/Homebrew/downloadable.rb +++ b/Library/Homebrew/downloadable.rb @@ -4,7 +4,6 @@ require "url" require "checksum" -# @api private class Downloadable include Context extend T::Helpers diff --git a/Library/Homebrew/exceptions.rb b/Library/Homebrew/exceptions.rb index 17957aea790706..5a3ec8b6b9e5f4 100644 --- a/Library/Homebrew/exceptions.rb +++ b/Library/Homebrew/exceptions.rb @@ -79,8 +79,6 @@ def initialize(formula, attr, value) class FormulaSpecificationError < StandardError; end # Raised when a deprecated method is used. -# -# @api private class MethodDeprecatedError < StandardError attr_accessor :issues_url end @@ -159,8 +157,6 @@ def to_s end # Shared methods for formula class errors. -# -# @api private module FormulaClassUnavailableErrorModule attr_reader :path, :class_name, :class_list @@ -205,8 +201,6 @@ def initialize(name, path, class_name, class_list) end # Shared methods for formula unreadable errors. -# -# @api private module FormulaUnreadableErrorModule attr_reader :formula_error diff --git a/Library/Homebrew/extend/ENV/shared.rb b/Library/Homebrew/extend/ENV/shared.rb index dd88b26891157b..86f871aeff9348 100644 --- a/Library/Homebrew/extend/ENV/shared.rb +++ b/Library/Homebrew/extend/ENV/shared.rb @@ -280,7 +280,6 @@ def effective_arch end end - # @private sig { params(name: String).returns(Formula) } def gcc_version_formula(name) version = name[GNU_GCC_REGEXP, 1] @@ -293,8 +292,8 @@ def gcc_version_formula(name) Formulary.factory(gcc_version_name) end end + private :gcc_version_formula - # @private sig { params(name: String).void } def warn_about_non_apple_gcc(name) begin @@ -312,6 +311,7 @@ def warn_about_non_apple_gcc(name) brew install #{gcc_formula.full_name} EOS end + private :warn_about_non_apple_gcc sig { void } def permit_arch_flags; end diff --git a/Library/Homebrew/extend/ENV/std.rb b/Library/Homebrew/extend/ENV/std.rb index 19cec7ad88e50a..7793727c1c7697 100644 --- a/Library/Homebrew/extend/ENV/std.rb +++ b/Library/Homebrew/extend/ENV/std.rb @@ -4,14 +4,12 @@ require "hardware" require "extend/ENV/shared" -# @api private module Stdenv include SharedEnvExtension - # @private SAFE_CFLAGS_FLAGS = "-w -pipe" + private_constant :SAFE_CFLAGS_FLAGS - # @private sig { params( formula: T.nilable(Formula), @@ -72,11 +70,6 @@ def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_a end alias generic_setup_build_environment setup_build_environment - sig { returns(T::Array[Pathname]) } - def homebrew_extra_pkg_config_paths - [] - end - sig { returns(T.nilable(PATH)) } def determine_pkg_config_libdir PATH.new( @@ -156,7 +149,17 @@ def libcxx append "CXX", "-stdlib=libc++" if compiler == :clang end - # @private + sig { returns(Integer) } + def make_jobs + Homebrew::EnvConfig.make_jobs.to_i + end + + # This method does nothing in {Stdenv} since there is no argument refurbishment. + sig { void } + def refurbish_args; end + + private + sig { params(before: Regexp, after: String).void } def replace_in_cflags(before, after) CC_FLAG_VARS.each do |key| @@ -172,7 +175,6 @@ def define_cflags(val) # Sets architecture-specific flags for every environment variable # given in the list `flags`. - # @private sig { params(flags: T::Array[String], map: T::Hash[Symbol, String]).void } def set_cpu_flags(flags, map = Hardware::CPU.optimization_flags) cflags =~ /(-Xarch_#{Hardware::CPU.arch_32_bit} )-march=/ @@ -185,21 +187,15 @@ def set_cpu_flags(flags, map = Hardware::CPU.optimization_flags) append flags, map.fetch(effective_arch) end - # @private + sig { returns(T::Array[Pathname]) } + def homebrew_extra_pkg_config_paths + [] + end + sig { params(map: T::Hash[Symbol, String]).void } def set_cpu_cflags(map = Hardware::CPU.optimization_flags) set_cpu_flags(CC_FLAG_VARS, map) end - - sig { returns(Integer) } - def make_jobs - Homebrew::EnvConfig.make_jobs.to_i - end - - # This method does nothing in stdenv since there's no arg refurbishment - # @private - sig { void } - def refurbish_args; end end require "extend/os/extend/ENV/std" diff --git a/Library/Homebrew/extend/ENV/super.rb b/Library/Homebrew/extend/ENV/super.rb index d9d4f45555580d..6be9069013ebdd 100644 --- a/Library/Homebrew/extend/ENV/super.rb +++ b/Library/Homebrew/extend/ENV/super.rb @@ -17,7 +17,6 @@ module Superenv include SharedEnvExtension - # @private attr_accessor :keg_only_deps, :deps, :run_time_deps sig { params(base: Superenv).void } @@ -27,13 +26,14 @@ def self.extended(base) base.run_time_deps = [] end - # The location of Homebrew's shims on this OS. + # The location of Homebrew's shims. + # + # @api public sig { returns(Pathname) } def self.shims_path HOMEBREW_SHIMS_PATH/"super" end - # @private sig { returns(T.nilable(Pathname)) } def self.bin; end @@ -45,7 +45,6 @@ def reset delete("as_nl") end - # @private sig { params( formula: T.nilable(Formula), @@ -353,7 +352,6 @@ def set_debug_symbols append_to_cccfg "D" end - # @private sig { void } def refurbish_args append_to_cccfg "O" diff --git a/Library/Homebrew/extend/hash/keys.rb b/Library/Homebrew/extend/hash/keys.rb index caa742d3b2e037..06878a4ce0d514 100644 --- a/Library/Homebrew/extend/hash/keys.rb +++ b/Library/Homebrew/extend/hash/keys.rb @@ -2,17 +2,17 @@ # frozen_string_literal: true class Hash - # Validates all keys in a hash match *valid_keys, raising - # +ArgumentError+ on a mismatch. + # Validates all keys in a hash match `*valid_keys`, raising + # `ArgumentError` on a mismatch. # # Note that keys are treated differently than HashWithIndifferentAccess, # meaning that string and symbol keys will not match. # - # { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) - # # => raises "ArgumentError: Unknown key: :years. Valid keys are: :name, :age" - # { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') - # # => raises "ArgumentError: Unknown key: :name. Valid keys are: 'name', 'age'" - # { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing + # { name: 'Rob', years: '28' }.assert_valid_keys(:name, :age) + # # => raises "ArgumentError: Unknown key: :years. Valid keys are: :name, :age" + # { name: 'Rob', age: '28' }.assert_valid_keys('name', 'age') + # # => raises "ArgumentError: Unknown key: :name. Valid keys are: 'name', 'age'" + # { name: 'Rob', age: '28' }.assert_valid_keys(:name, :age) # => passes, raises nothing sig { params(valid_keys: T.untyped).void } def assert_valid_keys(*valid_keys) valid_keys.flatten! @@ -28,10 +28,10 @@ def assert_valid_keys(*valid_keys) # This includes the keys from the root hash and from all # nested hashes and arrays. # - # hash = { person: { name: 'Rob', age: '28' } } + # hash = { person: { name: 'Rob', age: '28' } } # - # hash.deep_transform_keys{ |key| key.to_s.upcase } - # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} + # hash.deep_transform_keys{ |key| key.to_s.upcase } + # # => {"PERSON"=>{"NAME"=>"Rob", "AGE"=>"28"}} def deep_transform_keys(&block) = _deep_transform_keys_in_object(self, &block) # Destructively converts all keys by using the block operation. @@ -43,10 +43,10 @@ def deep_transform_keys!(&block) = _deep_transform_keys_in_object!(self, &block) # This includes the keys from the root hash and from all # nested hashes and arrays. # - # hash = { person: { name: 'Rob', age: '28' } } + # hash = { person: { name: 'Rob', age: '28' } } # - # hash.deep_stringify_keys - # # => {"person"=>{"name"=>"Rob", "age"=>"28"}} + # hash.deep_stringify_keys + # # => {"person"=>{"name"=>"Rob", "age"=>"28"}} def deep_stringify_keys = T.unsafe(self).deep_transform_keys(&:to_s) # Destructively converts all keys to strings. @@ -58,10 +58,10 @@ def deep_stringify_keys! = T.unsafe(self).deep_transform_keys!(&:to_s) # they respond to +to_sym+. This includes the keys from the root hash # and from all nested hashes and arrays. # - # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } + # hash = { 'person' => { 'name' => 'Rob', 'age' => '28' } } # - # hash.deep_symbolize_keys - # # => {:person=>{:name=>"Rob", :age=>"28"}} + # hash.deep_symbolize_keys + # # => {:person=>{:name=>"Rob", :age=>"28"}} def deep_symbolize_keys deep_transform_keys do |key| T.unsafe(key).to_sym diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/std.rb b/Library/Homebrew/extend/os/linux/extend/ENV/std.rb index 4d52ae95fe99d1..434ec586eef9f4 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/std.rb @@ -2,6 +2,16 @@ # frozen_string_literal: true module Stdenv + sig { + params( + formula: T.nilable(Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, debug_symbols: false) generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, diff --git a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb index 3959b393ccdf15..ad6d1e10a9edc6 100644 --- a/Library/Homebrew/extend/os/linux/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/linux/extend/ENV/super.rb @@ -2,17 +2,26 @@ # frozen_string_literal: true module Superenv - # The location of Homebrew's shims on Linux. + sig { returns(Pathname) } def self.shims_path HOMEBREW_SHIMS_PATH/"linux/super" end - # @private + sig { returns(T.nilable(Pathname)) } def self.bin shims_path.realpath end - # @private + sig { + params( + formula: T.nilable(Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, debug_symbols: false) generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, diff --git a/Library/Homebrew/extend/os/mac/development_tools.rb b/Library/Homebrew/extend/os/mac/development_tools.rb index df43d554bbfedd..d53f77a858a586 100644 --- a/Library/Homebrew/extend/os/mac/development_tools.rb +++ b/Library/Homebrew/extend/os/mac/development_tools.rb @@ -3,7 +3,6 @@ require "os/mac/xcode" -# @private class DevelopmentTools class << self alias generic_locate locate diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb index 51e79be5060243..c963cf47428e7a 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/std.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/std.rb @@ -2,14 +2,24 @@ # frozen_string_literal: true module Stdenv - # @private - undef homebrew_extra_pkg_config_paths + sig { returns(T::Array[Pathname]) } def homebrew_extra_pkg_config_paths [Pathname("#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}")] end - + private :homebrew_extra_pkg_config_paths + + sig { + params( + formula: T.nilable(Formula), + cc: T.nilable(String), + build_bottle: T.nilable(T::Boolean), + bottle_arch: T.nilable(String), + testing_formula: T::Boolean, + debug_symbols: T.nilable(T::Boolean), + ).void + } def setup_build_environment(formula: nil, cc: nil, build_bottle: false, bottle_arch: nil, testing_formula: false, debug_symbols: false) generic_setup_build_environment(formula:, cc:, build_bottle:, bottle_arch:, diff --git a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb index bfcd39695e8520..56a7f06ec10ed0 100644 --- a/Library/Homebrew/extend/os/mac/extend/ENV/super.rb +++ b/Library/Homebrew/extend/os/mac/extend/ENV/super.rb @@ -10,7 +10,6 @@ def shims_path undef bin - # @private def bin return unless DevelopmentTools.installed? @@ -25,12 +24,12 @@ def bin homebrew_extra_cmake_frameworks_paths, determine_cccfg - # @private + sig { returns(T::Array[Pathname]) } def homebrew_extra_pkg_config_paths [Pathname("/usr/lib/pkgconfig"), Pathname("#{HOMEBREW_LIBRARY}/Homebrew/os/mac/pkgconfig/#{MacOS.version}")] end + private :homebrew_extra_pkg_config_paths - # @private sig { returns(T::Boolean) } def libxml2_include_needed? return false if deps.any? { |d| d.name == "libxml2" } @@ -38,6 +37,7 @@ def libxml2_include_needed? true end + private :libxml2_include_needed? def homebrew_extra_isystem_paths paths = [] diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index e7fd27f2b26330..d2c19de115ff0b 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -82,6 +82,8 @@ class Pathname include DiskUsageExtension # Moves a file from the original location to the {Pathname}'s. + # + # @api public sig { params(sources: T.any( Resource, Resource::Partial, String, Pathname, @@ -137,6 +139,8 @@ def install_p(src, new_basename) private :install_p # Creates symlinks to sources in this folder. + # + # @api public sig { params( sources: T.any(String, Pathname, T::Array[T.any(String, Pathname)], T::Hash[T.any(String, Pathname), String]), @@ -165,6 +169,8 @@ def install_symlink_p(src, new_basename) private :install_symlink_p # Only appends to a file that is already created. + # + # @api public sig { params(content: String, open_args: T.untyped).void } def append_lines(content, **open_args) raise "Cannot append file that doesn't exist: #{self}" unless exist? @@ -173,6 +179,8 @@ def append_lines(content, **open_args) end # @note This always overwrites. + # + # @api public sig { params(content: String).void } def atomic_write(content) old_stat = stat if exist? @@ -202,7 +210,6 @@ def atomic_write(content) end end - # @private def cp_path_sub(pattern, replacement) raise "#{self} does not exist" unless exist? @@ -219,10 +226,9 @@ def cp_path_sub(pattern, replacement) end end - # @private - alias extname_old extname - # Extended to support common double extensions. + # + # @api public sig { returns(String) } def extname basename = File.basename(self) @@ -240,6 +246,8 @@ def extname end # For filetypes we support, returns basename without extension. + # + # @api public sig { returns(String) } def stem File.basename(self, extname) @@ -248,7 +256,6 @@ def stem # I don't trust the children.length == 0 check particularly, not to mention # it is slow to enumerate the whole directory just to see if it is empty, # instead rely on good ol' libc and the filesystem - # @private sig { returns(T::Boolean) } def rmdir_if_possible rmdir @@ -264,14 +271,12 @@ def rmdir_if_possible false end - # @private sig { returns(Version) } def version require "version" Version.parse(basename) end - # @private sig { returns(T::Boolean) } def text_executable? /\A#!\s*\S+/.match?(open("r") { |f| f.read(1024) }) @@ -293,6 +298,9 @@ def verify_checksum(expected) alias to_str to_s + # Change to this directory, optionally executing the given block. + # + # @api public sig { type_parameters(:U).params( _block: T.proc.params(path: Pathname).returns(T.type_parameter(:U)), @@ -302,18 +310,19 @@ def cd(&_block) Dir.chdir(self) { yield self } end + # Get all sub-directories of this directory. + # + # @api public sig { returns(T::Array[Pathname]) } def subdirs children.select(&:directory?) end - # @private sig { returns(Pathname) } def resolved_path symlink? ? dirname.join(readlink) : self end - # @private sig { returns(T::Boolean) } def resolved_path_exists? link = readlink @@ -324,13 +333,11 @@ def resolved_path_exists? dirname.join(link).exist? end - # @private def make_relative_symlink(src) dirname.mkpath File.symlink(src.relative_path_from(dirname), self) end - # @private def ensure_writable saved_perms = nil unless writable? @@ -342,7 +349,6 @@ def ensure_writable chmod saved_perms if saved_perms end - # @private def which_install_info @which_install_info ||= if File.executable?("/usr/bin/install-info") @@ -352,12 +358,10 @@ def which_install_info end end - # @private def install_info quiet_system(which_install_info, "--quiet", to_s, "#{dirname}/dir") end - # @private def uninstall_info quiet_system(which_install_info, "--delete", "--quiet", to_s, "#{dirname}/dir") end @@ -494,7 +498,6 @@ def zipinfo require "extend/os/pathname" -# @private module ObserverPathnameExtension class << self include Context diff --git a/Library/Homebrew/fetch.rb b/Library/Homebrew/fetch.rb index 3aeaee8929eb18..587a17f4ed3867 100644 --- a/Library/Homebrew/fetch.rb +++ b/Library/Homebrew/fetch.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true module Homebrew - # @api private module Fetch sig { params( diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb index 62eeffafe6f03c..24cc6f75a23a15 100644 --- a/Library/Homebrew/formula.rb +++ b/Library/Homebrew/formula.rb @@ -71,8 +71,8 @@ class Formula extend APIHashable SUPPORTED_NETWORK_ACCESS_PHASES = [:build, :test, :postinstall].freeze - DEFAULT_NETWORK_ACCESS_ALLOWED = true private_constant :SUPPORTED_NETWORK_ACCESS_PHASES + DEFAULT_NETWORK_ACCESS_ALLOWED = true private_constant :DEFAULT_NETWORK_ACCESS_ALLOWED # The name of this {Formula}. @@ -135,8 +135,6 @@ class Formula # `nil` if there is no HEAD version. # # @see #stable - # - # @api private sig { returns(T.nilable(SoftwareSpec)) } attr_reader :head @@ -150,12 +148,10 @@ class Formula # A symbol to indicate currently active {SoftwareSpec}. # It's either :stable or :head # @see #active_spec - # @private sig { returns(Symbol) } attr_reader :active_spec_sym # most recent modified time for source files - # @private sig { returns(T.nilable(Time)) } attr_reader :source_modified_time @@ -182,13 +178,11 @@ class Formula # When installing a bottle (binary package) from a local path this will be # set to the full path to the bottle tarball. If not, it will be `nil`. - # @private sig { returns(T.nilable(Pathname)) } attr_accessor :local_bottle_path # When performing a build, test, or other loggable action, indicates which # log file location to use. - # @private sig { returns(T.nilable(String)) } attr_reader :active_log_type @@ -208,11 +202,9 @@ class Formula alias follow_installed_alias? follow_installed_alias # Whether or not to force the use of a bottle. - # @private sig { returns(T::Boolean) } attr_accessor :force_bottle - # @private sig { params(name: String, path: Pathname, spec: Symbol, alias_path: T.nilable(Pathname), tap: T.nilable(Tap), force_bottle: T::Boolean).void @@ -264,7 +256,6 @@ def initialize(name, path, spec, alias_path: nil, tap: nil, force_bottle: false) @oldname_locks = [] end - # @private def active_spec=(spec_sym) spec = send(spec_sym) raise FormulaSpecificationError, "#{spec_sym} spec is not available for #{full_name}" unless spec @@ -281,7 +272,6 @@ def active_spec=(spec_sym) Requirement.clear_cache end - # @private def build=(build_options) old_options = @build @build = build_options @@ -395,21 +385,18 @@ def full_installed_specified_name end # Is the currently active {SoftwareSpec} a {#stable} build? - # @private sig { returns(T::Boolean) } def stable? active_spec == stable end # Is the currently active {SoftwareSpec} a {#head} build? - # @private sig { returns(T::Boolean) } def head? active_spec == head end # Is this formula HEAD-only? - # @private sig { returns(T::Boolean) } def head_only? !!head && !stable @@ -425,14 +412,12 @@ def head_only? ] => :active_spec # The Bottle object for the currently active {SoftwareSpec}. - # @private sig { returns(T.nilable(Bottle)) } def bottle @bottle ||= Bottle.new(self, bottle_specification) if bottled? end # The Bottle object for given tag. - # @private sig { params(tag: T.nilable(Utils::Bottles::Tag)).returns(T.nilable(Bottle)) } def bottle_for_tag(tag = nil) Bottle.new(self, bottle_specification, tag) if bottled?(tag) @@ -484,7 +469,6 @@ def bottle_for_tag(tag = nil) # Whether this formula was loaded using the formulae.brew.sh API # @!method loaded_from_api? - # @private # @see .loaded_from_api? delegate loaded_from_api?: :"self.class" @@ -643,14 +627,12 @@ def aliases # If this {Formula} is installed. # This is actually just a check for if the {#latest_installed_prefix} directory # exists and is not empty. - # @private sig { returns(T::Boolean) } def latest_version_installed? (dir = latest_installed_prefix).directory? && !dir.children.empty? end # If at least one version of {Formula} is installed. - # @private sig { returns(T::Boolean) } def any_version_installed? installed_prefixes.any? { |keg| (keg/Tab::FILENAME).file? } @@ -700,7 +682,6 @@ def head_version_outdated?(version, fetch_head: false) end # The latest prefix for this formula. Checks for {#head} and then {#stable}'s {#prefix} - # @private def latest_installed_prefix if head && (head_version = latest_head_version) && !head_version_outdated?(head_version) latest_head_prefix @@ -756,14 +737,12 @@ def linked_version # The parent of the prefix; the named directory in the cellar containing all # installed versions of this software. - # @private sig { returns(Pathname) } def rack HOMEBREW_CELLAR/name end # All currently installed prefix directories. - # @private def installed_prefixes possible_names.map { |name| HOMEBREW_CELLAR/name } .select(&:directory?) @@ -772,7 +751,6 @@ def installed_prefixes end # All currently installed kegs. - # @private def installed_kegs installed_prefixes.map { |dir| Keg.new(dir) } end @@ -1124,14 +1102,12 @@ def fish_completion # The directory used for as the prefix for {#etc} and {#var} files on # installation so, despite not being in `HOMEBREW_CELLAR`, they are installed # there after pouring a bottle. - # @private sig { returns(Pathname) } def bottle_prefix prefix/".bottle" end # The directory where the formula's installation or test logs will be written. - # @private sig { returns(Pathname) } def logs HOMEBREW_LOGS + name @@ -1321,20 +1297,17 @@ def pour_bottle? true end - # @private delegate pour_bottle_check_unsatisfied_reason: :"self.class" # Can be overridden to run commands on both source and bottle installation. sig { overridable.void } def post_install; end - # @private sig { returns(T::Boolean) } def post_install_defined? method(:post_install).owner != Formula end - # @private sig { void } def install_etc_var etc_var_dirs = [bottle_prefix/"etc", bottle_prefix/"var"] @@ -1345,7 +1318,6 @@ def install_etc_var end end - # @private sig { void } def run_post_install @prefix_returns_versioned_prefix = true @@ -1413,11 +1385,9 @@ def keg_only? keg_only_reason.applicable? end - # @private delegate keg_only_reason: :"self.class" # @see .skip_clean - # @private sig { params(path: Pathname).returns(T::Boolean) } def skip_clean?(path) return true if path.extname == ".la" && self.class.skip_clean_paths.include?(:la) @@ -1427,7 +1397,6 @@ def skip_clean?(path) end # @see .link_overwrite - # @private def link_overwrite?(path) # Don't overwrite files not created by Homebrew. return false if path.stat.uid != HOMEBREW_BREW_FILE.stat.uid @@ -1509,13 +1478,11 @@ def skip_cxxstdlib_check? false end - # @private sig { returns(T::Boolean) } def require_universal_deps? false end - # @private def patch return if patchlist.empty? @@ -1525,7 +1492,6 @@ def patch # Yields |self,staging| with current working directory set to the uncompressed tarball # where staging is a {Mktemp} staging context. - # @private def brew(fetch: true, keep_tmp: false, debug_symbols: false, interactive: false) @prefix_returns_versioned_prefix = true active_spec.fetch if fetch @@ -1560,7 +1526,6 @@ def brew(fetch: true, keep_tmp: false, debug_symbols: false, interactive: false) @prefix_returns_versioned_prefix = false end - # @private def lock @lock = FormulaLock.new(name) @lock.lock @@ -1575,13 +1540,11 @@ def lock end end - # @private def unlock @lock&.unlock @oldname_locks.each(&:unlock) end - # @private sig { returns(T::Array[String]) } def oldnames_to_migrate oldnames.select do |oldname| @@ -1598,7 +1561,6 @@ def migration_needed? !oldnames_to_migrate.empty? && !rack.exist? end - # @private def outdated_kegs(fetch_head: false) raise Migrator::MigrationNeededError.new(oldnames_to_migrate.first, name) if migration_needed? @@ -1691,22 +1653,17 @@ def outdated?(fetch_head: false) true end - # @private delegate pinnable?: :@pin # @api internal delegate pinned?: :@pin - # @private delegate pinned_version: :@pin - # @private delegate pin: :@pin - # @private delegate unpin: :@pin - # @private def ==(other) self.class == other.class && name == other.name && @@ -1714,19 +1671,16 @@ def ==(other) end alias eql? == - # @private def hash name.hash end - # @private def <=>(other) return unless other.is_a?(Formula) name <=> other.name end - # @private def possible_names [name, *oldnames, *aliases].compact end @@ -1904,7 +1858,6 @@ def deuniversalize_machos(*targets) targets.each { |t| extract_macho_slice_from(Pathname.new(t), Hardware::CPU.arch) } end - # @private sig { params(file: Pathname, arch: T.nilable(Symbol)).void } def extract_macho_slice_from(file, arch = Hardware::CPU.arch) odebug "Extracting #{arch} slice from #{file}" @@ -2029,38 +1982,32 @@ def generate_completions_from_executable(*commands, end # an array of all core {Formula} names - # @private def self.core_names CoreTap.instance.formula_names end # an array of all tap {Formula} names - # @private def self.tap_names @tap_names ||= Tap.reject(&:core_tap?).flat_map(&:formula_names).sort end # an array of all tap {Formula} files - # @private def self.tap_files @tap_files ||= Tap.reject(&:core_tap?).flat_map(&:formula_files) end # an array of all {Formula} names - # @private def self.names @names ||= (core_names + tap_names.map { |name| name.split("/").last }).uniq.sort end # an array of all {Formula} names, which the tap formulae have the fully-qualified name - # @private def self.full_names @full_names ||= core_names + tap_names end # an array of all {Formula} # this should only be used when users specify `--all` to a command - # @private def self.all(eval_all: false) if !eval_all && !Homebrew::EnvConfig.eval_all? raise ArgumentError, "Formula#all without `--eval-all` or HOMEBREW_EVAL_ALL" @@ -2078,7 +2025,6 @@ def self.all(eval_all: false) end # An array of all racks currently installed. - # @private def self.racks Formula.cache[:racks] ||= if HOMEBREW_CELLAR.directory? HOMEBREW_CELLAR.subdirs.reject do |rack| @@ -2090,14 +2036,12 @@ def self.racks end # An array of all currently installed formula names. - # @private sig { returns(T::Array[String]) } def self.installed_formula_names racks.map { |rack| rack.basename.to_s } end # An array of all installed {Formula} - # @private def self.installed Formula.cache[:installed] ||= racks.flat_map do |rack| Formulary.from_rack(rack) @@ -2113,37 +2057,31 @@ def self.installed_with_alias_path(alias_path) end # an array of all alias files of core {Formula} - # @private def self.core_alias_files CoreTap.instance.alias_files end # an array of all core aliases - # @private def self.core_aliases CoreTap.instance.aliases end # an array of all tap aliases - # @private def self.tap_aliases @tap_aliases ||= Tap.reject(&:core_tap?).flat_map(&:aliases).sort end # an array of all aliases - # @private def self.aliases @aliases ||= (core_aliases + tap_aliases.map { |name| name.split("/").last }).uniq.sort end # an array of all aliases as fully-qualified names - # @private def self.alias_full_names @alias_full_names ||= core_aliases + tap_aliases end # Returns a list of approximately matching formula names, but not the complete match - # @private def self.fuzzy_search(name) @spell_checker ||= DidYouMean::SpellChecker.new(dictionary: Set.new(names + full_names).to_a) @spell_checker.correct(name) @@ -2154,14 +2092,12 @@ def self.[](name) end # True if this formula is provided by Homebrew itself - # @private sig { returns(T::Boolean) } def core_formula? !!tap&.core_tap? end # True if this formula is provided by external Tap - # @private sig { returns(T::Boolean) } def tap? return false unless tap @@ -2171,13 +2107,11 @@ def tap? # True if this formula can be installed on this platform # Redefined in extend/os. - # @private sig { returns(T::Boolean) } def valid_platform? requirements.none?(MacOSRequirement) && requirements.none?(LinuxRequirement) end - # @private def print_tap_action(options = {}) return unless tap? @@ -2185,12 +2119,10 @@ def print_tap_action(options = {}) ohai "#{verb} #{name} from #{tap}" end - # @private def tap_git_head tap&.git_head end - # @private delegate env: :"self.class" # @api internal @@ -2215,7 +2147,6 @@ def recursive_requirements(&block) # Returns a Keg for the opt_prefix or installed_prefix if they exist. # If not, return `nil`. - # @private def any_installed_keg Formula.cache[:any_installed_keg] ||= {} Formula.cache[:any_installed_keg][full_name] ||= if (installed_prefix = any_installed_prefix) @@ -2265,7 +2196,6 @@ def runtime_dependencies(read_from_tab: true, undeclared: true) end # Returns a list of {Formula} objects that are required at runtime. - # @private def runtime_formula_dependencies(read_from_tab: true, undeclared: true) cache_key = "#{full_name}-#{read_from_tab}-#{undeclared}" @@ -2310,13 +2240,11 @@ def missing_dependencies(hide: nil) [] end - # @private sig { returns(T.nilable(String)) } def ruby_source_path path.relative_path_from(T.must(tap).path).to_s if tap && path.exist? end - # @private sig { returns(T.nilable(Checksum)) } def ruby_source_checksum Checksum.new(Digest::SHA256.file(path).hexdigest) if path.exist? @@ -2337,7 +2265,6 @@ def merge_spec_dependables(dependables) end private :merge_spec_dependables - # @private def to_hash hsh = { "name" => name, @@ -2423,7 +2350,6 @@ def to_hash hsh end - # @private def to_internal_api_hash api_hash = { "desc" => desc, @@ -2485,7 +2411,6 @@ def to_internal_api_hash api_hash end - # @private def to_hash_with_variations(hash_method: :to_hash) if loaded_from_api? && hash_method == :to_internal_api_hash raise ArgumentError, "API Hash must be generated from Ruby source files" @@ -2568,7 +2493,6 @@ def bottle_hash(compact_for_api: false) hash end - # @private def urls_hash hash = {} @@ -2594,7 +2518,6 @@ def urls_hash hash end - # @private def serialized_requirements requirements = self.class.spec_syms.to_h do |sym| [sym, send(sym)&.requirements] @@ -2620,13 +2543,11 @@ def serialized_requirements end end - # @private def caveats_with_placeholders caveats&.gsub(HOMEBREW_PREFIX, HOMEBREW_PREFIX_PLACEHOLDER) &.gsub(HOMEBREW_CELLAR, HOMEBREW_CELLAR_PLACEHOLDER) end - # @private def dependencies_hash # Create a hash of spec names (stable/head) to the list of dependencies under each dependencies = self.class.spec_syms.to_h do |sym| @@ -2687,22 +2608,18 @@ def dependencies_hash hash end - # @private def on_system_blocks_exist? self.class.on_system_blocks_exist? || @on_system_blocks_exist end - # @private def fetch(verify_download_integrity: true) active_spec.fetch(verify_download_integrity:) end - # @private def verify_download_integrity(filename) active_spec.verify_download_integrity(filename) end - # @private def run_test(keep_tmp: false) @prefix_returns_versioned_prefix = true @@ -2740,16 +2657,13 @@ def run_test(keep_tmp: false) @testpath = nil end - # @private sig { returns(T::Boolean) } def test_defined? false end - # @private def test; end - # @private def test_fixtures(file) HOMEBREW_LIBRARY_PATH/"test/support/fixtures"/file end @@ -2807,7 +2721,6 @@ def setup_home(home) end # Returns a list of Dependency objects that are declared in the formula. - # @private def declared_runtime_dependencies cache_key = "Formula#declared_runtime_dependencies" unless build.any_args_or_options? Dependency.expand(self, cache_key:) do |_, dependency| @@ -2824,7 +2737,6 @@ def declared_runtime_dependencies # Returns a list of Dependency objects that are not declared in the formula # but the formula links to. - # @private def undeclared_runtime_dependencies keg = any_installed_keg return [] unless keg @@ -2966,7 +2878,6 @@ def system(cmd, *args) end end - # @private def eligible_kegs_for_cleanup(quiet: false) eligible_for_cleanup = [] if latest_version_installed? @@ -3061,7 +2972,6 @@ def prepare_patches end # Returns the prefix for a given formula version number. - # @private def versioned_prefix(version) rack/version end @@ -3186,26 +3096,22 @@ def freeze end # Whether this formula was loaded using the formulae.brew.sh API - # @private attr_predicate :loaded_from_api? # Whether this formula contains OS/arch-specific blocks # (e.g. `on_macos`, `on_arm`, `on_monterey :or_older`, `on_system :linux, macos: :big_sur_or_newer`). - # @private attr_predicate :on_system_blocks_exist? - # The reason for why this software is not linked (by default) to - # {::HOMEBREW_PREFIX}. - # @private + # The reason for why this software is not linked (by default) to {::HOMEBREW_PREFIX}. attr_reader :keg_only_reason - # @!attribute [w] desc # A one-line description of the software. Used by users to get an overview # of the software and Homebrew maintainers. # Shows when running `brew info`. # #
desc "Example formula"
# + # @!attribute [w] desc # @api public attr_rw :desc @@ -3303,6 +3209,7 @@ def network_access_allowed?(phase) # #
homepage "https://www.example.com"
# + # @!attribute [w] homepage # @api public attr_rw :homepage @@ -3322,18 +3229,10 @@ def service? @service_block.present? end - # @private - attr_reader :conflicts - - # @private - attr_reader :skip_clean_paths - - # @private - attr_reader :link_overwrite_paths + attr_reader :conflicts, :skip_clean_paths, :link_overwrite_paths, :pour_bottle_only_if # If `pour_bottle?` returns `false` the user-visible reason to display for # why they cannot use the bottle. - # @private attr_accessor :pour_bottle_check_unsatisfied_reason # @!attribute [w] revision @@ -3362,13 +3261,11 @@ def service? # @api public attr_rw :version_scheme - # @private def spec_syms [:stable, :head].freeze end # A list of the {.stable} and {.head} {SoftwareSpec}s. - # @private def specs spec_syms.map do |sym| send(sym) @@ -3465,13 +3362,11 @@ def bottle(&block) stable.bottle(&block) end - # @private def build stable.build end # Get the `BUILD_FLAGS` from the formula's namespace set in `Formulary::load_formula`. - # @private def build_flags namespace = T.must(to_s.split("::")[0..-2]).join("::") return [] if namespace.empty? @@ -3884,9 +3779,6 @@ def pour_bottle?(only_if: nil, &block) @pour_bottle_check.instance_eval(&block) end - # @private - attr_reader :pour_bottle_only_if - # Deprecates a {Formula} (on the given date) so a warning is # shown on each installation. If the date has not yet passed the formula # will not be deprecated. diff --git a/Library/Homebrew/formula_assertions.rb b/Library/Homebrew/formula_assertions.rb index 8f84f6479bd87f..ad9c7ebcc7bd08 100644 --- a/Library/Homebrew/formula_assertions.rb +++ b/Library/Homebrew/formula_assertions.rb @@ -3,8 +3,6 @@ module Homebrew # Helper functions available in formula `test` blocks. - # - # @api private module Assertions include Context diff --git a/Library/Homebrew/formula_auditor.rb b/Library/Homebrew/formula_auditor.rb index 29294cf0f46f5b..e19448ac49cd6f 100644 --- a/Library/Homebrew/formula_auditor.rb +++ b/Library/Homebrew/formula_auditor.rb @@ -9,8 +9,6 @@ module Homebrew # Auditor for checking common violations in {Formula}e. - # - # @api private class FormulaAuditor include FormulaCellarChecks include Utils::Curl @@ -516,7 +514,7 @@ def audit_keg_only_reason return unless @core_tap return unless formula.keg_only? - keg_only_message = text.to_s.match(/keg_only\s+["'](.*)["']/)&.captures&.first + keg_only_message = text.without_patch.match(/keg_only\s+["'](.*)["']/)&.captures&.first return unless keg_only_message&.include?("HOMEBREW_PREFIX") problem "`keg_only` reason should not include `HOMEBREW_PREFIX` as it creates confusing `brew info` output." @@ -915,7 +913,7 @@ def audit_text shell_commands = ["system", "shell_output", "pipe_output"] bin_names.each do |name| shell_commands.each do |cmd| - if text.to_s.match?(/test do.*#{cmd}[(\s]+['"]#{Regexp.escape(name)}[\s'"]/m) + if text.without_patch.match?(/test do.*#{cmd}[(\s]+['"]#{Regexp.escape(name)}[\s'"]/m) problem %Q(fully scope test #{cmd} calls, e.g. #{cmd} "\#{bin}/#{name}") end end diff --git a/Library/Homebrew/formula_cellar_checks.rb b/Library/Homebrew/formula_cellar_checks.rb index afcffb83c9460e..db833443ff57ef 100644 --- a/Library/Homebrew/formula_cellar_checks.rb +++ b/Library/Homebrew/formula_cellar_checks.rb @@ -4,8 +4,6 @@ require "utils/shell" # Checks to perform on a formula's cellar. -# -# @api private module FormulaCellarChecks extend T::Helpers diff --git a/Library/Homebrew/formula_creator.rb b/Library/Homebrew/formula_creator.rb index 32d80792ae6dab..da833cf4eb2ad7 100644 --- a/Library/Homebrew/formula_creator.rb +++ b/Library/Homebrew/formula_creator.rb @@ -6,8 +6,6 @@ module Homebrew # Class for generating a formula from a template. - # - # @api private class FormulaCreator attr_accessor :name diff --git a/Library/Homebrew/formula_free_port.rb b/Library/Homebrew/formula_free_port.rb index 8659c74c5c0a68..d47b8a40a00bb9 100644 --- a/Library/Homebrew/formula_free_port.rb +++ b/Library/Homebrew/formula_free_port.rb @@ -5,8 +5,6 @@ module Homebrew # Helper function for finding a free port. - # - # @api private module FreePort # Returns a free port. # @api public diff --git a/Library/Homebrew/formula_info.rb b/Library/Homebrew/formula_info.rb index 0856c3d49091f3..ea61e7b601e514 100644 --- a/Library/Homebrew/formula_info.rb +++ b/Library/Homebrew/formula_info.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Formula information drawn from an external `brew info --json` call. -# -# @api private class FormulaInfo # The whole info structure parsed from the JSON. attr_accessor :info diff --git a/Library/Homebrew/formula_installer.rb b/Library/Homebrew/formula_installer.rb index 2964234b2b9303..9e76fe79e79ff9 100644 --- a/Library/Homebrew/formula_installer.rb +++ b/Library/Homebrew/formula_installer.rb @@ -25,8 +25,6 @@ require "attestation" # Installer for a formula. -# -# @api private class FormulaInstaller include FormulaCellarChecks extend Attrable diff --git a/Library/Homebrew/formula_pin.rb b/Library/Homebrew/formula_pin.rb index 829e63d70211f7..0889866b70b8f3 100644 --- a/Library/Homebrew/formula_pin.rb +++ b/Library/Homebrew/formula_pin.rb @@ -4,8 +4,6 @@ require "keg" # Helper functions for pinning a formula. -# -# @api private class FormulaPin def initialize(formula) @formula = formula diff --git a/Library/Homebrew/formula_text_auditor.rb b/Library/Homebrew/formula_text_auditor.rb index 8f2e621e7097b3..052b811d0bf0e7 100644 --- a/Library/Homebrew/formula_text_auditor.rb +++ b/Library/Homebrew/formula_text_auditor.rb @@ -3,8 +3,6 @@ module Homebrew # Auditor for checking common violations in {Formula} text content. - # - # @api private class FormulaTextAuditor def initialize(path) @text = path.open("rb", &:read) diff --git a/Library/Homebrew/formula_versions.rb b/Library/Homebrew/formula_versions.rb index 89362b88fe13cc..d7c7878a2cd4d3 100644 --- a/Library/Homebrew/formula_versions.rb +++ b/Library/Homebrew/formula_versions.rb @@ -5,7 +5,7 @@ # Helper class for traversing a formula's previous versions. # -# @api private +# @api internal class FormulaVersions include Context diff --git a/Library/Homebrew/formulary.rb b/Library/Homebrew/formulary.rb index 6beb8d90f8461f..53df1d8374a93a 100644 --- a/Library/Homebrew/formulary.rb +++ b/Library/Homebrew/formulary.rb @@ -13,16 +13,16 @@ # The {Formulary} is responsible for creating instances of {Formula}. # It is not meant to be used directly from formulae. -# -# @api private module Formulary extend Context extend Cachable URL_START_REGEX = %r{(https?|ftp|file)://} + private_constant :URL_START_REGEX - # :codesign and custom requirement classes are not supported + # `:codesign` and custom requirement classes are not supported. API_SUPPORTED_REQUIREMENTS = [:arch, :linux, :macos, :maximum_macos, :xcode].freeze + private_constant :API_SUPPORTED_REQUIREMENTS # Enable the factory cache. # @@ -76,7 +76,6 @@ def self.clear_cache super end - # @private module PathnameWriteMkpath refine Pathname do def write(content, offset = nil, **open_args) diff --git a/Library/Homebrew/git_repository.rb b/Library/Homebrew/git_repository.rb index 886f3aa0bd3229..2f17b2d0f6b298 100644 --- a/Library/Homebrew/git_repository.rb +++ b/Library/Homebrew/git_repository.rb @@ -6,7 +6,6 @@ # Given a {Pathname}, provides methods for querying Git repository information. # @see Utils::Git -# @api private class GitRepository sig { returns(Pathname) } attr_reader :pathname diff --git a/Library/Homebrew/github_packages.rb b/Library/Homebrew/github_packages.rb index 9b1766ea600c3c..68f2f244adee59 100644 --- a/Library/Homebrew/github_packages.rb +++ b/Library/Homebrew/github_packages.rb @@ -8,8 +8,6 @@ require "system_command" # GitHub Packages client. -# -# @api private class GitHubPackages include Context include SystemCommand::Mixin diff --git a/Library/Homebrew/github_releases.rb b/Library/Homebrew/github_releases.rb index 599ae363b90485..4b889516e22c75 100644 --- a/Library/Homebrew/github_releases.rb +++ b/Library/Homebrew/github_releases.rb @@ -5,8 +5,6 @@ require "json" # GitHub Releases client. -# -# @api private class GitHubReleases include Context diff --git a/Library/Homebrew/help.rb b/Library/Homebrew/help.rb index d0c25a21a26426..993ab55eeba6f0 100644 --- a/Library/Homebrew/help.rb +++ b/Library/Homebrew/help.rb @@ -6,8 +6,6 @@ module Homebrew # Helper module for printing help output. - # - # @api private module Help # NOTE: Keep the length of vanilla `--help` less than 25 lines! # This is because the default Terminal height is 25 lines. Scrolling sucks diff --git a/Library/Homebrew/ignorable.rb b/Library/Homebrew/ignorable.rb index 43a7d0af34b0c6..2b5c318f1ea285 100644 --- a/Library/Homebrew/ignorable.rb +++ b/Library/Homebrew/ignorable.rb @@ -7,8 +7,6 @@ end # Provides the ability to optionally ignore errors raised and continue execution. -# -# @api private module Ignorable # Marks exceptions which can be ignored and provides # the ability to jump back to where it was raised. diff --git a/Library/Homebrew/install.rb b/Library/Homebrew/install.rb index 82b0465d9a3381..1f194c10c1392c 100644 --- a/Library/Homebrew/install.rb +++ b/Library/Homebrew/install.rb @@ -9,8 +9,6 @@ module Homebrew # Helper module for performing (pre-)install checks. - # - # @api private module Install class << self def perform_preinstall_checks(all_fatal: false, cc: nil) diff --git a/Library/Homebrew/install_renamed.rb b/Library/Homebrew/install_renamed.rb index 6018da8102a0c1..b16d82893b71ad 100644 --- a/Library/Homebrew/install_renamed.rb +++ b/Library/Homebrew/install_renamed.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Helper module for installing default files. -# -# @api private module InstallRenamed def install_p(_, new_basename) super do |src, dst| diff --git a/Library/Homebrew/installed_dependents.rb b/Library/Homebrew/installed_dependents.rb index 5771d7430654cc..0633af88695d9f 100644 --- a/Library/Homebrew/installed_dependents.rb +++ b/Library/Homebrew/installed_dependents.rb @@ -4,8 +4,6 @@ require "cask_dependent" # Helper functions for installed dependents. -# -# @api private module InstalledDependents module_function diff --git a/Library/Homebrew/keg.rb b/Library/Homebrew/keg.rb index 9eae9205438e93..f26c18dc198ba5 100644 --- a/Library/Homebrew/keg.rb +++ b/Library/Homebrew/keg.rb @@ -7,8 +7,6 @@ require "extend/cachable" # Installation prefix of a formula. -# -# @api private class Keg extend Cachable diff --git a/Library/Homebrew/language/python.rb b/Library/Homebrew/language/python.rb index e341d358b063c3..71ef9e9bc340e3 100644 --- a/Library/Homebrew/language/python.rb +++ b/Library/Homebrew/language/python.rb @@ -202,8 +202,6 @@ def virtualenv_create(venv_root, python = "python", formula = T.cast(self, Formu # "with-python", "without-python", "with-python@2", and "without-python@2" # formula options are handled correctly even if not associated with any # corresponding depends_on statement. - # - # @api private sig { params(python: String).returns(T::Boolean) } def needs_python?(python) return true if build.with?(python) diff --git a/Library/Homebrew/lazy_object.rb b/Library/Homebrew/lazy_object.rb index f43d316e1efe70..7f702977ee55c2 100644 --- a/Library/Homebrew/lazy_object.rb +++ b/Library/Homebrew/lazy_object.rb @@ -4,8 +4,6 @@ require "delegate" # An object which lazily evaluates its inner block only once a method is called on it. -# -# @api private class LazyObject < Delegator def initialize(&callable) super(callable) diff --git a/Library/Homebrew/linkage_checker.rb b/Library/Homebrew/linkage_checker.rb index 6a0bfa39622da2..dec594f9876f03 100644 --- a/Library/Homebrew/linkage_checker.rb +++ b/Library/Homebrew/linkage_checker.rb @@ -7,8 +7,6 @@ require "fiddle" # Check for broken/missing linkage in a formula's keg. -# -# @api private class LinkageChecker attr_reader :undeclared_deps, :keg, :formula, :store diff --git a/Library/Homebrew/livecheck/error.rb b/Library/Homebrew/livecheck/error.rb index 8cbd8ff28e2951..1c0be81b4cbe7c 100644 --- a/Library/Homebrew/livecheck/error.rb +++ b/Library/Homebrew/livecheck/error.rb @@ -4,8 +4,6 @@ module Homebrew module Livecheck # Error during a livecheck run. - # - # @api private class Error < RuntimeError end end diff --git a/Library/Homebrew/livecheck/livecheck.rb b/Library/Homebrew/livecheck/livecheck.rb index 190c92e4475cb2..98811338a9edcc 100644 --- a/Library/Homebrew/livecheck/livecheck.rb +++ b/Library/Homebrew/livecheck/livecheck.rb @@ -13,8 +13,6 @@ module Homebrew # The {Livecheck} module consists of methods used by the `brew livecheck` # command. These methods print the requested livecheck information # for formulae. - # - # @api private module Livecheck module_function diff --git a/Library/Homebrew/livecheck/livecheck_version.rb b/Library/Homebrew/livecheck/livecheck_version.rb index bee235413dbbdf..8c06b80722e2dc 100644 --- a/Library/Homebrew/livecheck/livecheck_version.rb +++ b/Library/Homebrew/livecheck/livecheck_version.rb @@ -4,8 +4,6 @@ module Homebrew module Livecheck # A formula or cask version, split into its component sub-versions. - # - # @api private class LivecheckVersion include Comparable diff --git a/Library/Homebrew/livecheck/skip_conditions.rb b/Library/Homebrew/livecheck/skip_conditions.rb index dc19de5916c1a2..e868d7640d1f1f 100644 --- a/Library/Homebrew/livecheck/skip_conditions.rb +++ b/Library/Homebrew/livecheck/skip_conditions.rb @@ -5,8 +5,6 @@ module Homebrew module Livecheck # The `Livecheck::SkipConditions` module primarily contains methods that # check for various formula/cask/resource conditions where a check should be skipped. - # - # @api private module SkipConditions module_function diff --git a/Library/Homebrew/livecheck/strategy.rb b/Library/Homebrew/livecheck/strategy.rb index 68f0d34bd1e738..e3f8d8d61d412d 100644 --- a/Library/Homebrew/livecheck/strategy.rb +++ b/Library/Homebrew/livecheck/strategy.rb @@ -7,8 +7,6 @@ module Livecheck # as some general-purpose methods for working with them. Within the context # of the `brew livecheck` command, strategies are established procedures # for finding new software versions at a given source. - # - # @api private module Strategy extend Utils::Curl diff --git a/Library/Homebrew/livecheck/strategy/electron_builder.rb b/Library/Homebrew/livecheck/strategy/electron_builder.rb index 7ec7dcb03f27e1..e2a413ba52c065 100644 --- a/Library/Homebrew/livecheck/strategy/electron_builder.rb +++ b/Library/Homebrew/livecheck/strategy/electron_builder.rb @@ -9,8 +9,6 @@ module Strategy # # This strategy is not applied automatically and it's necessary to use # `strategy :electron_builder` in a `livecheck` block to apply it. - # - # @api private class ElectronBuilder NICE_NAME = "electron-builder" diff --git a/Library/Homebrew/livecheck/strategy/extract_plist.rb b/Library/Homebrew/livecheck/strategy/extract_plist.rb index 8f2e50e882678a..c59d848abda96c 100644 --- a/Library/Homebrew/livecheck/strategy/extract_plist.rb +++ b/Library/Homebrew/livecheck/strategy/extract_plist.rb @@ -16,8 +16,6 @@ module Strategy # # This strategy is not applied automatically and it's necessary to use # `strategy :extract_plist` in a `livecheck` block to apply it. - # - # @api private class ExtractPlist # A priority of zero causes livecheck to skip the strategy. We do this # for {ExtractPlist} so we can selectively apply it when appropriate. @@ -35,9 +33,7 @@ def self.match?(url) URL_MATCH_REGEX.match?(url) end - # @api private Item = Struct.new( - # @api private :bundle_version, keyword_init: true, ) do diff --git a/Library/Homebrew/livecheck/strategy/header_match.rb b/Library/Homebrew/livecheck/strategy/header_match.rb index ae2a7c76ce8103..152cf046db223a 100644 --- a/Library/Homebrew/livecheck/strategy/header_match.rb +++ b/Library/Homebrew/livecheck/strategy/header_match.rb @@ -9,8 +9,6 @@ module Strategy # # This strategy is not applied automatically and it's necessary to use # `strategy :header_match` in a `livecheck` block to apply it. - # - # @api private class HeaderMatch NICE_NAME = "Header match" diff --git a/Library/Homebrew/livecheck/strategy/sparkle.rb b/Library/Homebrew/livecheck/strategy/sparkle.rb index 5b9f9e1df8dcf4..c875ec44147fd6 100644 --- a/Library/Homebrew/livecheck/strategy/sparkle.rb +++ b/Library/Homebrew/livecheck/strategy/sparkle.rb @@ -11,8 +11,6 @@ module Strategy # # This strategy is not applied automatically and it's necessary to use # `strategy :sparkle` in a `livecheck` block to apply it. - # - # @api private class Sparkle # A priority of zero causes livecheck to skip the strategy. We do this # for {Sparkle} so we can selectively apply it when appropriate. @@ -33,7 +31,6 @@ def self.match?(url) URL_MATCH_REGEX.match?(url) end - # @api private Item = Struct.new( # @api public :title, diff --git a/Library/Homebrew/locale.rb b/Library/Homebrew/locale.rb index 1e256fb3a243ef..a4c2d5e6957ed0 100644 --- a/Library/Homebrew/locale.rb +++ b/Library/Homebrew/locale.rb @@ -4,8 +4,6 @@ # Representation of a system locale. # # Used to compare the system language and languages defined using the cask `language` stanza. -# -# @api private class Locale # Error when a string cannot be parsed to a `Locale`. class ParserError < StandardError diff --git a/Library/Homebrew/lock_file.rb b/Library/Homebrew/lock_file.rb index ca17b61279e325..73adbb0c51837f 100644 --- a/Library/Homebrew/lock_file.rb +++ b/Library/Homebrew/lock_file.rb @@ -4,8 +4,6 @@ require "fcntl" # A lock file. -# -# @api private class LockFile attr_reader :path @@ -52,8 +50,6 @@ def create_lockfile end # A lock file for a formula. -# -# @api private class FormulaLock < LockFile def initialize(name) super("#{name}.formula") @@ -61,8 +57,6 @@ def initialize(name) end # A lock file for a cask. -# -# @api private class CaskLock < LockFile def initialize(name) super("#{name}.cask") diff --git a/Library/Homebrew/macos_version.rb b/Library/Homebrew/macos_version.rb index a4ff1e3029a5aa..c03c7d46b7223b 100644 --- a/Library/Homebrew/macos_version.rb +++ b/Library/Homebrew/macos_version.rb @@ -4,8 +4,6 @@ require "version" # A macOS version. -# -# @api private class MacOSVersion < Version # Raised when a macOS version is unsupported. class Error < RuntimeError diff --git a/Library/Homebrew/manpages.rb b/Library/Homebrew/manpages.rb index 316022f4de900c..ead19024c3e863 100644 --- a/Library/Homebrew/manpages.rb +++ b/Library/Homebrew/manpages.rb @@ -9,8 +9,6 @@ TARGET_DOC_PATH = (HOMEBREW_REPOSITORY/"docs").freeze module Homebrew # Helper functions for generating homebrew manual. - # - # @api private module Manpages Variables = Struct.new( :alumni, diff --git a/Library/Homebrew/manpages/converter/kramdown.rb b/Library/Homebrew/manpages/converter/kramdown.rb index ebd407cf3de17f..9e5ba73d31add5 100644 --- a/Library/Homebrew/manpages/converter/kramdown.rb +++ b/Library/Homebrew/manpages/converter/kramdown.rb @@ -7,8 +7,6 @@ module Homebrew module Manpages module Converter # Converts our Kramdown-like input to pure Kramdown. - # - # @api private class Kramdown < ::Kramdown::Converter::Kramdown def initialize(root, options) super(root, options.merge(line_width: 80)) diff --git a/Library/Homebrew/manpages/converter/roff.rb b/Library/Homebrew/manpages/converter/roff.rb index 3f59c7f617b3b4..b4f88b53b999d8 100644 --- a/Library/Homebrew/manpages/converter/roff.rb +++ b/Library/Homebrew/manpages/converter/roff.rb @@ -7,8 +7,6 @@ module Homebrew module Manpages module Converter # Converts our Kramdown-like input to roff. - # - # @api private class Roff < ::Kramdown::Converter::Man # Override that adds Homebrew metadata for the top level header # and doesn't escape the text inside subheaders. diff --git a/Library/Homebrew/manpages/parser/ronn.rb b/Library/Homebrew/manpages/parser/ronn.rb index 673347d5d6bd1b..fae27addb72c13 100644 --- a/Library/Homebrew/manpages/parser/ronn.rb +++ b/Library/Homebrew/manpages/parser/ronn.rb @@ -7,8 +7,6 @@ module Homebrew module Manpages module Parser # Kramdown parser with compatiblity for ronn variable syntax. - # - # @api private class Ronn < ::Kramdown::Parser::Kramdown def initialize(*) super diff --git a/Library/Homebrew/metafiles.rb b/Library/Homebrew/metafiles.rb index e7e71963df0887..9f3a74239f4010 100644 --- a/Library/Homebrew/metafiles.rb +++ b/Library/Homebrew/metafiles.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Helper for checking if a file is considered a metadata file. -# -# @api private module Metafiles LICENSES = Set.new(%w[copying copyright license licence]).freeze # {https://github.com/github/markup#markups} diff --git a/Library/Homebrew/migrator.rb b/Library/Homebrew/migrator.rb index 0e08423bb4d29f..9c6c0cb06cd9c7 100644 --- a/Library/Homebrew/migrator.rb +++ b/Library/Homebrew/migrator.rb @@ -6,8 +6,6 @@ require "tab" # Helper class for migrating a formula from an old to a new name. -# -# @api private class Migrator include Context diff --git a/Library/Homebrew/missing_formula.rb b/Library/Homebrew/missing_formula.rb index 6bf851b1d858c7..7a49643accd2c3 100644 --- a/Library/Homebrew/missing_formula.rb +++ b/Library/Homebrew/missing_formula.rb @@ -5,8 +5,6 @@ module Homebrew # Helper module for checking if there is a reason a formula is missing. - # - # @api private module MissingFormula class << self def reason(name, silent: false, show_info: false) diff --git a/Library/Homebrew/options.rb b/Library/Homebrew/options.rb index 97c40d9782d84a..572d615358c0d7 100644 --- a/Library/Homebrew/options.rb +++ b/Library/Homebrew/options.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # A formula option. -# -# @api private class Option attr_reader :name, :description, :flag @@ -40,8 +38,6 @@ def inspect end # A deprecated formula option. -# -# @api private class DeprecatedOption attr_reader :old, :current @@ -67,8 +63,6 @@ def ==(other) end # A collection of formula options. -# -# @api private class Options include Enumerable diff --git a/Library/Homebrew/os.rb b/Library/Homebrew/os.rb index 66e2d62a3eaef3..e1bdb59ef500f9 100644 --- a/Library/Homebrew/os.rb +++ b/Library/Homebrew/os.rb @@ -4,8 +4,6 @@ require "version" # Helper functions for querying operating system information. -# -# @api private module OS # Check whether the operating system is macOS. # diff --git a/Library/Homebrew/os/linux/elf.rb b/Library/Homebrew/os/linux/elf.rb index 49d0b80c63d538..8eeae1fc5e80e8 100644 --- a/Library/Homebrew/os/linux/elf.rb +++ b/Library/Homebrew/os/linux/elf.rb @@ -5,8 +5,6 @@ # {Pathname} extension for dealing with ELF files. # @see https://en.wikipedia.org/wiki/Executable_and_Linkable_Format#File_header -# -# @api private module ELFShim MAGIC_NUMBER_OFFSET = 0 private_constant :MAGIC_NUMBER_OFFSET @@ -121,8 +119,6 @@ def dynamic_elf? end # Helper class for reading metadata from an ELF file. - # - # @api private class Metadata attr_reader :path, :dylib_id, :dylibs diff --git a/Library/Homebrew/os/linux/glibc.rb b/Library/Homebrew/os/linux/glibc.rb index 440af7521dbed4..caa392f889a8de 100644 --- a/Library/Homebrew/os/linux/glibc.rb +++ b/Library/Homebrew/os/linux/glibc.rb @@ -4,8 +4,6 @@ module OS module Linux # Helper functions for querying `glibc` information. - # - # @api private module Glibc module_function diff --git a/Library/Homebrew/os/linux/kernel.rb b/Library/Homebrew/os/linux/kernel.rb index 99add3c08341db..b64056460e0431 100644 --- a/Library/Homebrew/os/linux/kernel.rb +++ b/Library/Homebrew/os/linux/kernel.rb @@ -4,8 +4,6 @@ module OS module Linux # Helper functions for querying Linux kernel information. - # - # @api private module Kernel module_function diff --git a/Library/Homebrew/os/linux/ld.rb b/Library/Homebrew/os/linux/ld.rb index 1ff2bd05f83e75..3dc85cb23e1193 100644 --- a/Library/Homebrew/os/linux/ld.rb +++ b/Library/Homebrew/os/linux/ld.rb @@ -4,8 +4,6 @@ module OS module Linux # Helper functions for querying `ld` information. - # - # @api private module Ld sig { returns(String) } def self.brewed_ld_so_diagnostics diff --git a/Library/Homebrew/os/mac/mach.rb b/Library/Homebrew/os/mac/mach.rb index 1580f06b9be9e3..b344cf6c79474c 100644 --- a/Library/Homebrew/os/mac/mach.rb +++ b/Library/Homebrew/os/mac/mach.rb @@ -4,8 +4,6 @@ require "macho" # {Pathname} extension for dealing with Mach-O files. -# -# @api private module MachOShim extend Forwardable diff --git a/Library/Homebrew/os/mac/sdk.rb b/Library/Homebrew/os/mac/sdk.rb index 44d5dd7df4b6c7..59471c744dcc86 100644 --- a/Library/Homebrew/os/mac/sdk.rb +++ b/Library/Homebrew/os/mac/sdk.rb @@ -6,8 +6,6 @@ module OS module Mac # Class representing a macOS SDK. - # - # @api private class SDK # 11.x SDKs are explicitly excluded - we want the MacOSX11.sdk symlink instead. VERSIONED_SDK_REGEX = /MacOSX(10\.\d+|\d+)\.sdk$/ @@ -30,8 +28,6 @@ def initialize(version, path, source) end # Base class for SDK locators. - # - # @api private class BaseSDKLocator extend T::Helpers include SystemCommand::Mixin @@ -141,8 +137,6 @@ def read_sdk_version(sdk_path) private_constant :BaseSDKLocator # Helper class for locating the Xcode SDK. - # - # @api private class XcodeSDKLocator < BaseSDKLocator sig { override.returns(Symbol) } def source @@ -166,8 +160,6 @@ def sdk_prefix end # Helper class for locating the macOS Command Line Tools SDK. - # - # @api private class CLTSDKLocator < BaseSDKLocator sig { override.returns(Symbol) } def source diff --git a/Library/Homebrew/os/mac/xcode.rb b/Library/Homebrew/os/mac/xcode.rb index 24d3e01530f19e..12fa0f5a995400 100644 --- a/Library/Homebrew/os/mac/xcode.rb +++ b/Library/Homebrew/os/mac/xcode.rb @@ -4,8 +4,6 @@ module OS module Mac # Helper module for querying Xcode information. - # - # @api private module Xcode DEFAULT_BUNDLE_PATH = Pathname("/Applications/Xcode.app").freeze BUNDLE_ID = "com.apple.dt.Xcode" @@ -267,8 +265,6 @@ def self.default_prefix? end # Helper module for querying macOS Command Line Tools information. - # - # @api private module CLT # The original Mavericks CLT package ID EXECUTABLE_PKG_ID = "com.apple.pkg.CLTools_Executables" diff --git a/Library/Homebrew/patch.rb b/Library/Homebrew/patch.rb index 8b5afc10f9948a..5187661442bbb0 100644 --- a/Library/Homebrew/patch.rb +++ b/Library/Homebrew/patch.rb @@ -5,8 +5,6 @@ require "erb" # Helper module for creating patches. -# -# @api private module Patch def self.create(strip, src, &block) case strip @@ -32,8 +30,6 @@ def self.create(strip, src, &block) end # An abstract class representing a patch embedded into a formula. -# -# @api private class EmbeddedPatch attr_writer :owner attr_reader :strip @@ -63,8 +59,6 @@ def inspect end # A patch at the `__END__` of a formula file. -# -# @api private class DATAPatch < EmbeddedPatch attr_accessor :path @@ -90,8 +84,6 @@ def contents end # A string containing a patch. -# -# @api private class StringPatch < EmbeddedPatch def initialize(strip, str) super(strip) @@ -104,8 +96,6 @@ def contents end # A string containing a patch. -# -# @api private class ExternalPatch extend Forwardable diff --git a/Library/Homebrew/pkg_version.rb b/Library/Homebrew/pkg_version.rb index 2cd5b2ad1cf664..c72505cc637222 100644 --- a/Library/Homebrew/pkg_version.rb +++ b/Library/Homebrew/pkg_version.rb @@ -4,8 +4,6 @@ require "version" # Combination of a version and a revision. -# -# @api private class PkgVersion include Comparable extend Forwardable diff --git a/Library/Homebrew/readall.rb b/Library/Homebrew/readall.rb index 86ad869d790267..c20251fbb18116 100644 --- a/Library/Homebrew/readall.rb +++ b/Library/Homebrew/readall.rb @@ -6,8 +6,6 @@ require "system_command" # Helper module for validating syntax in taps. -# -# @api private module Readall extend Cachable extend SystemCommand::Mixin diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb index 7a5413826b0447..038595fd9c4512 100644 --- a/Library/Homebrew/requirement.rb +++ b/Library/Homebrew/requirement.rb @@ -10,8 +10,6 @@ # A base class for non-formula requirements needed by formulae. # A fatal requirement is one that will fail the build if it is not present. # By default, requirements are non-fatal. -# -# @api private class Requirement include Dependable extend Cachable diff --git a/Library/Homebrew/requirements/arch_requirement.rb b/Library/Homebrew/requirements/arch_requirement.rb index 3b2fc1f2d61d0b..0f900a162ea307 100644 --- a/Library/Homebrew/requirements/arch_requirement.rb +++ b/Library/Homebrew/requirements/arch_requirement.rb @@ -4,8 +4,6 @@ require "requirement" # A requirement on a specific architecture. -# -# @api private class ArchRequirement < Requirement fatal true diff --git a/Library/Homebrew/requirements/codesign_requirement.rb b/Library/Homebrew/requirements/codesign_requirement.rb index 7a006472c70f9b..74e73905f7d277 100644 --- a/Library/Homebrew/requirements/codesign_requirement.rb +++ b/Library/Homebrew/requirements/codesign_requirement.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # A requirement on a code-signing identity. -# -# @api private class CodesignRequirement < Requirement fatal true diff --git a/Library/Homebrew/requirements/linux_requirement.rb b/Library/Homebrew/requirements/linux_requirement.rb index 058f5a116682c8..e0aa5def4900aa 100644 --- a/Library/Homebrew/requirements/linux_requirement.rb +++ b/Library/Homebrew/requirements/linux_requirement.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # A requirement on Linux. -# -# @api private class LinuxRequirement < Requirement fatal true diff --git a/Library/Homebrew/requirements/macos_requirement.rb b/Library/Homebrew/requirements/macos_requirement.rb index 9a55b793628d37..ac4f9b1b9e7d3a 100644 --- a/Library/Homebrew/requirements/macos_requirement.rb +++ b/Library/Homebrew/requirements/macos_requirement.rb @@ -4,8 +4,6 @@ require "requirement" # A requirement on macOS. -# -# @api private class MacOSRequirement < Requirement fatal true diff --git a/Library/Homebrew/requirements/xcode_requirement.rb b/Library/Homebrew/requirements/xcode_requirement.rb index abc74e088cd0fd..8d4d8c2d1a9e13 100644 --- a/Library/Homebrew/requirements/xcode_requirement.rb +++ b/Library/Homebrew/requirements/xcode_requirement.rb @@ -4,8 +4,6 @@ require "requirement" # A requirement on Xcode. -# -# @api private class XcodeRequirement < Requirement fatal true diff --git a/Library/Homebrew/resource.rb b/Library/Homebrew/resource.rb index 4483c6a35d27be..910bc44e112a17 100644 --- a/Library/Homebrew/resource.rb +++ b/Library/Homebrew/resource.rb @@ -9,8 +9,6 @@ # Resource is the fundamental representation of an external resource. The # primary formula download, along with other declared resources, are instances # of this class. -# -# @api private class Resource < Downloadable include FileUtils include OnSystem::MacOSAndLinux @@ -287,8 +285,6 @@ def directory(val = nil) # The context in which a {Resource#stage} occurs. Supports access to both # the {Resource} and associated {Mktemp} in a single block argument. The interface # is back-compatible with {Resource} itself as used in that context. -# -# @api private class ResourceStageContext extend Forwardable diff --git a/Library/Homebrew/resource_auditor.rb b/Library/Homebrew/resource_auditor.rb index eb29bf3b546ecb..796af321e55a26 100644 --- a/Library/Homebrew/resource_auditor.rb +++ b/Library/Homebrew/resource_auditor.rb @@ -3,8 +3,6 @@ module Homebrew # Auditor for checking common violations in {Resource}s. - # - # @api private class ResourceAuditor include Utils::Curl diff --git a/Library/Homebrew/rubocops/bottle.rb b/Library/Homebrew/rubocops/bottle.rb index 556d3c78421b2c..ddbbff8331bbb6 100644 --- a/Library/Homebrew/rubocops/bottle.rb +++ b/Library/Homebrew/rubocops/bottle.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop audits the `bottle` block in formulae. - # - # @api private class BottleFormat < FormulaCop extend AutoCorrector @@ -54,8 +52,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop audits the indentation of the bottle tags in the `bottle` block in formulae. - # - # @api private class BottleTagIndentation < FormulaCop extend AutoCorrector @@ -90,8 +86,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop audits the indentation of the sha256 digests in the`bottle` block in formulae. - # - # @api private class BottleDigestIndentation < FormulaCop extend AutoCorrector @@ -126,8 +120,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop audits the order of the `bottle` block in formulae. - # - # @api private class BottleOrder < FormulaCop extend AutoCorrector diff --git a/Library/Homebrew/rubocops/caveats.rb b/Library/Homebrew/rubocops/caveats.rb index 417de01d5f0a75..048ddd5bf9101a 100644 --- a/Library/Homebrew/rubocops/caveats.rb +++ b/Library/Homebrew/rubocops/caveats.rb @@ -22,8 +22,6 @@ module FormulaAudit # Use `sudo` to run the executable. # EOS # end - # - # @api private class Caveats < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, _body_node) caveats_strings.each do |n| diff --git a/Library/Homebrew/rubocops/checksum.rb b/Library/Homebrew/rubocops/checksum.rb index 52e01584db4280..d2bf8310b1aebf 100644 --- a/Library/Homebrew/rubocops/checksum.rb +++ b/Library/Homebrew/rubocops/checksum.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop makes sure that deprecated checksums are not used. - # - # @api private class Checksum < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -43,8 +41,6 @@ def audit_sha256(checksum) end # This cop makes sure that checksum strings are lowercase. - # - # @api private class ChecksumCase < FormulaCop extend AutoCorrector diff --git a/Library/Homebrew/rubocops/class.rb b/Library/Homebrew/rubocops/class.rb index 1d1a1b0c5bf07e..d23617e990457f 100644 --- a/Library/Homebrew/rubocops/class.rb +++ b/Library/Homebrew/rubocops/class.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop makes sure that {Formula} is used as superclass. - # - # @api private class ClassName < FormulaCop extend AutoCorrector @@ -29,8 +27,6 @@ def audit_formula(_node, _class_node, parent_class_node, _body_node) end # This cop makes sure that a `test` block contains a proper test. - # - # @api private class Test < FormulaCop extend AutoCorrector @@ -72,8 +68,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) module FormulaAuditStrict # This cop makes sure that a `test` block exists. - # - # @api private class TestPresent < FormulaCop def audit_formula(_node, class_node, _parent_class_node, body_node) return if find_block(body_node, :test) diff --git a/Library/Homebrew/rubocops/components_redundancy.rb b/Library/Homebrew/rubocops/components_redundancy.rb index e6d80186912947..463bf3da5da8ce 100644 --- a/Library/Homebrew/rubocops/components_redundancy.rb +++ b/Library/Homebrew/rubocops/components_redundancy.rb @@ -14,8 +14,6 @@ module FormulaAudit # - `stable do` should not be present without a `head` spec # - `stable do` should not be present with only `url|checksum|mirror|version` # - `head do` should not be present with only `url` - # - # @api private 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" diff --git a/Library/Homebrew/rubocops/extend/formula_cop.rb b/Library/Homebrew/rubocops/extend/formula_cop.rb index 6cfaa7b9f601fc..02f1ad1ec10a47 100644 --- a/Library/Homebrew/rubocops/extend/formula_cop.rb +++ b/Library/Homebrew/rubocops/extend/formula_cop.rb @@ -6,8 +6,6 @@ module RuboCop module Cop # Abstract base class for all formula cops. - # - # @api private class FormulaCop < Base extend T::Helpers include RangeHelp diff --git a/Library/Homebrew/rubocops/files.rb b/Library/Homebrew/rubocops/files.rb index 33443232deb52e..abce494eb7e047 100644 --- a/Library/Homebrew/rubocops/files.rb +++ b/Library/Homebrew/rubocops/files.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop makes sure that a formula's file permissions are correct. - # - # @api private class Files < FormulaCop def audit_formula(node, _class_node, _parent_class_node, _body_node) return unless file_path diff --git a/Library/Homebrew/rubocops/io_read.rb b/Library/Homebrew/rubocops/io_read.rb index 3db249031e4699..0b58afea018677 100644 --- a/Library/Homebrew/rubocops/io_read.rb +++ b/Library/Homebrew/rubocops/io_read.rb @@ -5,8 +5,6 @@ module RuboCop module Cop module Homebrew # This cop restricts usage of IO.read functions for security reasons. - # - # @api private class IORead < Base MSG = "The use of `IO.%s` is a security risk." RESTRICT_ON_SEND = [:read, :readlines].freeze diff --git a/Library/Homebrew/rubocops/keg_only.rb b/Library/Homebrew/rubocops/keg_only.rb index 80540399efcfdf..40722479623c08 100644 --- a/Library/Homebrew/rubocops/keg_only.rb +++ b/Library/Homebrew/rubocops/keg_only.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop makes sure that a `keg_only` reason has the correct format. - # - # @api private class KegOnly < FormulaCop extend AutoCorrector diff --git a/Library/Homebrew/rubocops/lines.rb b/Library/Homebrew/rubocops/lines.rb index f1bf210b41e704..6d51e275d5d8a4 100644 --- a/Library/Homebrew/rubocops/lines.rb +++ b/Library/Homebrew/rubocops/lines.rb @@ -9,8 +9,6 @@ module RuboCop module Cop module FormulaAudit # This cop checks for various miscellaneous Homebrew coding styles. - # - # @api private class Lines < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, _body_node) [:automake, :ant, :autoconf, :emacs, :expat, :libtool, :mysql, :perl, @@ -32,8 +30,6 @@ def audit_formula(_node, _class_node, _parent_class_node, _body_node) end # This cop makes sure that a space is used for class inheritance. - # - # @api private class ClassInheritance < FormulaCop def audit_formula(_node, class_node, parent_class_node, _body_node) begin_pos = start_column(parent_class_node) @@ -46,8 +42,6 @@ def audit_formula(_node, class_node, parent_class_node, _body_node) end # This cop makes sure that template comments are removed. - # - # @api private class Comments < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, _body_node) audit_comments do |comment| @@ -87,8 +81,6 @@ def audit_formula(_node, _class_node, _parent_class_node, _body_node) end # This cop makes sure that idiomatic `assert_*` statements are used. - # - # @api private class AssertStatements < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -114,8 +106,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that `option`s are used idiomatically. - # - # @api private class OptionDeclarations < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -199,8 +189,6 @@ def unless_modifier?(node) end # This cop makes sure that formulae depend on `open-mpi` instead of `mpich`. - # - # @api private class MpiCheck < FormulaCop extend AutoCorrector @@ -220,8 +208,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that formulae depend on `openssl` instead of `quictls`. - # - # @api private class QuicTLSCheck < FormulaCop extend AutoCorrector @@ -242,8 +228,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) # This cop makes sure that formulae do not depend on `pyoxidizer` at build-time # or run-time. - # - # @api private class PyoxidizerCheck < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -256,8 +240,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that the safe versions of `popen_*` calls are used. - # - # @api private class SafePopenCommands < FormulaCop extend AutoCorrector @@ -287,8 +269,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that environment variables are passed correctly to `popen_*` calls. - # - # @api private class ShellVariables < FormulaCop extend AutoCorrector @@ -319,8 +299,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that `license` has the correct format. - # - # @api private class LicenseArrays < FormulaCop extend AutoCorrector @@ -340,8 +318,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that nested `license` declarations are split onto multiple lines. - # - # @api private class Licenses < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -363,8 +339,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that Python versions are consistent. - # - # @api private class PythonVersions < FormulaCop extend AutoCorrector @@ -409,8 +383,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that OS conditionals are consistent. - # - # @api private class OnSystemConditionals < FormulaCop include OnSystemConditionalsHelper extend AutoCorrector @@ -450,8 +422,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure the `MacOS` module is not used in Linux-facing formula code - # - # @api private class MacOSOnLinux < FormulaCop include OnSystemConditionalsHelper @@ -465,8 +435,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that the `generate_completions_from_executable` DSL is used. - # - # @api private class GenerateCompletionsDSL < FormulaCop extend AutoCorrector @@ -548,8 +516,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) # This cop makes sure that the `generate_completions_from_executable` DSL is used with only # a single, combined call for all shells. - # - # @api private class SingleGenerateCompletionsDSLCall < FormulaCop extend AutoCorrector @@ -610,8 +576,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop checks for other miscellaneous style violations. - # - # @api private class Miscellaneous < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -881,8 +845,6 @@ def modifier?(node) module FormulaAuditStrict # This cop makes sure that no build-time checks are performed. - # - # @api private class MakeCheck < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if formula_tap != "homebrew-core" @@ -917,8 +879,6 @@ def audit_formula(_node, _class_node, _parent_class_node, _body_node) end # This cop makes sure that formulae build with `rust` instead of `rustup-init`. - # - # @api private class RustCheck < FormulaCop extend AutoCorrector diff --git a/Library/Homebrew/rubocops/livecheck.rb b/Library/Homebrew/rubocops/livecheck.rb index 084f43c3eefd99..7a974fdcf8fa7d 100644 --- a/Library/Homebrew/rubocops/livecheck.rb +++ b/Library/Homebrew/rubocops/livecheck.rb @@ -8,8 +8,6 @@ module Cop module FormulaAudit # This cop ensures that no other livecheck information is provided for # skipped formulae. - # - # @api private class LivecheckSkip < FormulaCop extend AutoCorrector @@ -40,8 +38,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop ensures that a `url` is specified in the `livecheck` block. - # - # @api private class LivecheckUrlProvided < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) livecheck_node = find_block(body_node, :livecheck) @@ -63,8 +59,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) # This cop ensures that a supported symbol (`head`, `stable, `homepage`) # is used when the livecheck `url` is identical to one of these formula URLs. - # - # @api private class LivecheckUrlSymbol < FormulaCop extend AutoCorrector @@ -120,8 +114,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop ensures that the `regex` call in the `livecheck` block uses parentheses. - # - # @api private class LivecheckRegexParentheses < FormulaCop extend AutoCorrector @@ -147,8 +139,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) # This cop ensures that the pattern provided to livecheck's `regex` uses `\.t` instead of # `\.tgz`, `\.tar.gz` and variants. - # - # @api private class LivecheckRegexExtension < FormulaCop extend AutoCorrector @@ -180,8 +170,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) # This cop ensures that a `regex` is provided when `strategy :page_match` is specified # in the `livecheck` block. - # - # @api private class LivecheckRegexIfPageMatch < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) livecheck_node = find_block(body_node, :livecheck) @@ -206,8 +194,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) # This cop ensures that the `regex` provided to livecheck is case-insensitive, # unless sensitivity is explicitly required for proper matching. - # - # @api private class LivecheckRegexCaseInsensitive < FormulaCop extend AutoCorrector diff --git a/Library/Homebrew/rubocops/move_to_extend_os.rb b/Library/Homebrew/rubocops/move_to_extend_os.rb index f5a1f9bfe3b062..a0177589460401 100644 --- a/Library/Homebrew/rubocops/move_to_extend_os.rb +++ b/Library/Homebrew/rubocops/move_to_extend_os.rb @@ -5,8 +5,6 @@ module RuboCop module Cop module Homebrew # This cop ensures that platform specific code ends up in `extend/os`. - # - # @api private class MoveToExtendOS < Base MSG = "Move `OS.linux?` and `OS.mac?` calls to `extend/os`." diff --git a/Library/Homebrew/rubocops/resource_requires_dependencies.rb b/Library/Homebrew/rubocops/resource_requires_dependencies.rb index 1ddcf561118823..ec2d15a1044984 100644 --- a/Library/Homebrew/rubocops/resource_requires_dependencies.rb +++ b/Library/Homebrew/rubocops/resource_requires_dependencies.rb @@ -9,8 +9,6 @@ module FormulaAudit # This cop audits Python formulae that include certain resources # to ensure that they also have the correct `uses_from_macos` # dependencies. - # - # @api private class ResourceRequiresDependencies < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? diff --git a/Library/Homebrew/rubocops/service.rb b/Library/Homebrew/rubocops/service.rb index d711df7d6a0bbb..a141e6fc749318 100644 --- a/Library/Homebrew/rubocops/service.rb +++ b/Library/Homebrew/rubocops/service.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop audits the service block. - # - # @api private class Service < FormulaCop extend AutoCorrector diff --git a/Library/Homebrew/rubocops/shared/desc_helper.rb b/Library/Homebrew/rubocops/shared/desc_helper.rb index 85a7c6dd43c7ce..550bad0112a9b3 100644 --- a/Library/Homebrew/rubocops/shared/desc_helper.rb +++ b/Library/Homebrew/rubocops/shared/desc_helper.rb @@ -6,8 +6,6 @@ module RuboCop module Cop # This module performs common checks the `desc` field in both formulae and casks. - # - # @api private module DescHelper include HelperFunctions diff --git a/Library/Homebrew/rubocops/shared/helper_functions.rb b/Library/Homebrew/rubocops/shared/helper_functions.rb index 2d728b8a11cc1f..4a62e02b2f07e7 100644 --- a/Library/Homebrew/rubocops/shared/helper_functions.rb +++ b/Library/Homebrew/rubocops/shared/helper_functions.rb @@ -11,8 +11,6 @@ module RuboCop module Cop # Helper functions for cops. - # - # @api private module HelperFunctions include RangeHelp diff --git a/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb b/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb index 3441c15f32feb3..522e5f1dde0c50 100644 --- a/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb +++ b/Library/Homebrew/rubocops/shared/on_system_conditionals_helper.rb @@ -7,8 +7,6 @@ module RuboCop module Cop # This module performs common checks on `on_{system}` blocks in both formulae and casks. - # - # @api private module OnSystemConditionalsHelper extend NodePattern::Macros include HelperFunctions diff --git a/Library/Homebrew/rubocops/shell_commands.rb b/Library/Homebrew/rubocops/shell_commands.rb index 505141ead5c614..537c1be7986d21 100644 --- a/Library/Homebrew/rubocops/shell_commands.rb +++ b/Library/Homebrew/rubocops/shell_commands.rb @@ -45,8 +45,6 @@ module Homebrew SHELL_METACHARACTERS = %W[* ? { } [ ] < > ( ) ~ & | \\ $ ; ' ` " \n #].freeze # This cop makes sure that shell command arguments are separated. - # - # @api private class ShellCommands < Base include HelperFunctions extend AutoCorrector @@ -109,8 +107,6 @@ def on_send(node) end # This cop disallows shell metacharacters in `exec` calls. - # - # @api private class ExecShellMetacharacters < Base include HelperFunctions diff --git a/Library/Homebrew/rubocops/text.rb b/Library/Homebrew/rubocops/text.rb index c14a159655def3..56601d0c174ba0 100644 --- a/Library/Homebrew/rubocops/text.rb +++ b/Library/Homebrew/rubocops/text.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop checks for various problems in a formula's source code. - # - # @api private class Text < FormulaCop extend AutoCorrector @@ -107,8 +105,6 @@ def audit_formula(node, _class_node, _parent_class_node, body_node) module FormulaAuditStrict # This cop contains stricter checks for various problems in a formula's source code. - # - # @api private class Text < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? diff --git a/Library/Homebrew/rubocops/urls.rb b/Library/Homebrew/rubocops/urls.rb index 4d60f6707befce..4e388166c27bdd 100644 --- a/Library/Homebrew/rubocops/urls.rb +++ b/Library/Homebrew/rubocops/urls.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop audits `url`s and `mirror`s in formulae. - # - # @api private class Urls < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -265,8 +263,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) end # This cop makes sure that the correct format for PyPI URLs is used. - # - # @api private class PyPiUrls < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -297,8 +293,6 @@ def get_pypi_url(url) end # This cop makes sure that git URLs have a `revision`. - # - # @api private class GitUrls < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? @@ -321,8 +315,6 @@ def audit_formula(_node, _class_node, _parent_class_node, body_node) module FormulaAuditStrict # This cop makes sure that git URLs have a `tag`. - # - # @api private class GitUrls < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) return if body_node.nil? diff --git a/Library/Homebrew/rubocops/version.rb b/Library/Homebrew/rubocops/version.rb index 3a0c5ccc2046ae..e2ba8069a882b8 100644 --- a/Library/Homebrew/rubocops/version.rb +++ b/Library/Homebrew/rubocops/version.rb @@ -7,8 +7,6 @@ module RuboCop module Cop module FormulaAudit # This cop makes sure that a `version` is in the correct format. - # - # @api private class Version < FormulaCop def audit_formula(_node, _class_node, _parent_class_node, body_node) version_node = find_node_method_by_name(body_node, :version) diff --git a/Library/Homebrew/sandbox.rb b/Library/Homebrew/sandbox.rb index 566c84a15d52a3..0cbd7db525e55e 100644 --- a/Library/Homebrew/sandbox.rb +++ b/Library/Homebrew/sandbox.rb @@ -7,8 +7,6 @@ require "tempfile" # Helper class for running a sub-process inside of a sandboxed environment. -# -# @api private class Sandbox SANDBOX_EXEC = "/usr/bin/sandbox-exec" private_constant :SANDBOX_EXEC diff --git a/Library/Homebrew/search.rb b/Library/Homebrew/search.rb index ffd09da2129286..8c04f4356156df 100644 --- a/Library/Homebrew/search.rb +++ b/Library/Homebrew/search.rb @@ -5,8 +5,6 @@ module Homebrew # Helper module for searching formulae or casks. - # - # @api private module Search def self.query_regexp(query) if (m = query.match(%r{^/(.*)/$})) diff --git a/Library/Homebrew/settings.rb b/Library/Homebrew/settings.rb index e880c5bdf46f58..8a78e72d0a0df2 100644 --- a/Library/Homebrew/settings.rb +++ b/Library/Homebrew/settings.rb @@ -5,8 +5,6 @@ module Homebrew # Helper functions for reading and writing settings. - # - # @api private module Settings def self.read(setting, repo: HOMEBREW_REPOSITORY) return unless (repo/".git/config").exist? diff --git a/Library/Homebrew/simulate_system.rb b/Library/Homebrew/simulate_system.rb index e03987b8261c29..590129993e4c50 100644 --- a/Library/Homebrew/simulate_system.rb +++ b/Library/Homebrew/simulate_system.rb @@ -3,8 +3,6 @@ module Homebrew # Helper module for simulating different system configurations. - # - # @api private class SimulateSystem class << self attr_reader :arch, :os diff --git a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cli/args.rbi b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cli/args.rbi index abd403882194d4..aed56c9c9775e0 100644 --- a/Library/Homebrew/sorbet/rbi/dsl/homebrew/cli/args.rbi +++ b/Library/Homebrew/sorbet/rbi/dsl/homebrew/cli/args.rbi @@ -4,4 +4,10 @@ # This is an autogenerated file for dynamic methods in `Homebrew::CLI::Args`. # Please instead update this file by running `bin/tapioca dsl Homebrew::CLI::Args`. -class Homebrew::CLI::Args; end +class Homebrew::CLI::Args + sig { returns(T::Boolean) } + def only_public?; end + + sig { returns(T::Boolean) } + def open?; end +end diff --git a/Library/Homebrew/source_location.rb b/Library/Homebrew/source_location.rb index 5a1c084d608a2c..a75cc443c0f950 100644 --- a/Library/Homebrew/source_location.rb +++ b/Library/Homebrew/source_location.rb @@ -3,8 +3,6 @@ module Homebrew # A location in source code. - # - # @api private class SourceLocation sig { returns(Integer) } attr_reader :line diff --git a/Library/Homebrew/standalone/sorbet.rb b/Library/Homebrew/standalone/sorbet.rb index 85647b6fbe8e7a..aec651361d6f3f 100644 --- a/Library/Homebrew/standalone/sorbet.rb +++ b/Library/Homebrew/standalone/sorbet.rb @@ -9,7 +9,7 @@ # if assured that there is no performance hit from removing this. # There are mechanisms to achieve a middle ground (`default_checked_level`). unless ENV["HOMEBREW_SORBET_RUNTIME"] - # Redefine T.let etc to make the `checked` parameter default to false rather than true. + # Redefine `T.let`, etc. to make the `checked` parameter default to `false` rather than `true`. # @private module TNoChecks def cast(value, type, checked: false) @@ -35,8 +35,7 @@ class << self prepend TNoChecks end - # Redefine T.sig to be noop. - # @private + # Redefine `T.sig` to be a no-op. module Sig def sig(arg0 = nil, &blk); end end diff --git a/Library/Homebrew/style.rb b/Library/Homebrew/style.rb index 69d13d8a1a6fa4..9bc07880cd7c62 100644 --- a/Library/Homebrew/style.rb +++ b/Library/Homebrew/style.rb @@ -7,8 +7,6 @@ module Homebrew # Helper module for running RuboCop. - # - # @api private module Style extend SystemCommand::Mixin diff --git a/Library/Homebrew/system_config.rb b/Library/Homebrew/system_config.rb index 69a218df70229b..c24f2249984f8e 100644 --- a/Library/Homebrew/system_config.rb +++ b/Library/Homebrew/system_config.rb @@ -8,8 +8,6 @@ require "system_command" # Helper module for querying information about the system configuration. -# -# @api private module SystemConfig class << self include SystemCommand::Mixin diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 8af4f01242e548..906a7dfd762420 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -88,7 +88,6 @@ def self.from_path(path) fetch(user, repo) end - # @private sig { params(name: String).returns(T.nilable([Tap, String])) } def self.with_formula_name(name) return unless (match = name.match(HOMEBREW_TAP_FORMULA_REGEX)) @@ -104,7 +103,6 @@ def self.with_formula_name(name) [tap, name.downcase] end - # @private sig { params(token: String).returns(T.nilable([Tap, String])) } def self.with_cask_token(token) return unless (match = token.match(HOMEBREW_TAP_CASK_REGEX)) @@ -181,7 +179,6 @@ def to_s = name # Always use `Tap.fetch` instead of `Tap.new`. private_class_method :new - # @private def initialize(user, repo) @user = user @repo = repo @@ -269,7 +266,6 @@ def default_remote "https://github.com/#{full_name}" end - # @private sig { returns(String) } def repo_var_suffix @repo_var_suffix ||= path.to_s @@ -380,13 +376,11 @@ def shallow? (path/".git/shallow").exist? end - # @private sig { returns(T::Boolean) } def core_tap? false end - # @private sig { returns(T::Boolean) } def core_cask_tap? false @@ -688,8 +682,6 @@ def formula_files end # A mapping of {Formula} names to {Formula} file paths. - # - # @private sig { returns(T::Hash[String, Pathname]) } def formula_files_by_name @formula_files_by_name ||= formula_files.each_with_object({}) do |file, hash| @@ -711,8 +703,6 @@ def cask_files end # A mapping of {Cask} tokens to {Cask} file paths. - # - # @private sig { returns(T::Hash[String, Pathname]) } def cask_files_by_name @cask_files_by_name ||= cask_files.each_with_object({}) do |file, hash| @@ -724,15 +714,14 @@ def cask_files_by_name end # Check whether the file has a Ruby extension. - # @private sig { params(file: Pathname).returns(T::Boolean) } def ruby_file?(file) file.extname == ".rb" end + private :ruby_file? # Check whether the given path would present a {Formula} file in this {Tap}. # Accepts either an absolute path or a path relative to this {Tap}'s path. - # @private sig { params(file: T.any(String, Pathname)).returns(T::Boolean) } def formula_file?(file) file = Pathname.new(file) unless file.is_a? Pathname @@ -742,10 +731,10 @@ def formula_file?(file) file.to_s.start_with?("#{formula_dir}/") end + private :formula_file? # Check whether the given path would present a {Cask} file in this {Tap}. # Accepts either an absolute path or a path relative to this {Tap}'s path. - # @private sig { params(file: T.any(String, Pathname)).returns(T::Boolean) } def cask_file?(file) file = Pathname.new(file) unless file.is_a? Pathname @@ -754,6 +743,7 @@ def cask_file?(file) file.to_s.start_with?("#{cask_dir}/") end + private :cask_file? # An array of all {Formula} names of this {Tap}. sig { returns(T::Array[String]) } @@ -762,7 +752,6 @@ def formula_names end # A hash of all {Formula} name prefixes to versioned {Formula} in this {Tap}. - # @private sig { returns(T::Hash[String, T::Array[String]]) } def prefix_to_versioned_formulae_names @prefix_to_versioned_formulae_names ||= formula_names @@ -773,35 +762,30 @@ def prefix_to_versioned_formulae_names end # An array of all {Cask} tokens of this {Tap}. - # @private sig { returns(T::Array[String]) } def cask_tokens @cask_tokens ||= cask_files.map { formula_file_to_name(_1) } end # Path to the directory of all alias files for this {Tap}. - # @private sig { returns(Pathname) } def alias_dir @alias_dir ||= path/"Aliases" end # An array of all alias files of this {Tap}. - # @private sig { returns(T::Array[Pathname]) } def alias_files @alias_files ||= Pathname.glob("#{alias_dir}/*").select(&:file?) end # An array of all aliases of this {Tap}. - # @private sig { returns(T::Array[String]) } def aliases @aliases ||= alias_table.keys end # Mapping from aliases to formula names. - # @private sig { returns(T::Hash[String, String]) } def alias_table @alias_table ||= alias_files.each_with_object({}) do |alias_file, alias_table| @@ -810,8 +794,6 @@ def alias_table end # Mapping from formula names to aliases. - # - # @private sig { returns(T::Hash[String, T::Array[String]]) } def alias_reverse_table @alias_reverse_table ||= alias_table.each_with_object({}) do |(alias_name, formula_name), alias_reverse_table| @@ -871,8 +853,6 @@ def cask_renames end # Mapping from new to old cask tokens. Reverse of {#cask_renames}. - # - # @private sig { returns(T::Hash[String, T::Array[String]]) } def cask_reverse_renames @cask_reverse_renames ||= cask_renames.each_with_object({}) do |(old_name, new_name), hash| @@ -892,8 +872,6 @@ def formula_renames end # Mapping from new to old formula names. Reverse of {#formula_renames}. - # - # @private sig { returns(T::Hash[String, T::Array[String]]) } def formula_reverse_renames @formula_reverse_renames ||= formula_renames.each_with_object({}) do |(old_name, new_name), hash| @@ -981,7 +959,6 @@ def synced_versions_formulae end end - # @private sig { returns(T::Boolean) } def should_report_analytics? installed? && !private? @@ -1055,13 +1032,11 @@ def self.untapped_official_taps Homebrew::Settings.read(:untapped)&.split(";") || [] end - # @private sig { params(file: Pathname).returns(String) } def formula_file_to_name(file) "#{name}/#{file.basename(".rb")}" end - # @private sig { params(file: Pathname).returns(String) } def alias_file_to_name(file) "#{name}/#{file.basename}" @@ -1143,13 +1118,11 @@ def self.ensure_installed! instance.ensure_installed! end - # @private sig { params(file: Pathname).returns(String) } def formula_file_to_name(file) file.basename(".rb").to_s end - # @private sig { override.returns(T::Boolean) } def should_report_analytics? return super if Homebrew::EnvConfig.no_install_from_api? @@ -1160,7 +1133,6 @@ def should_report_analytics? # A specialized {Tap} class for the core formulae. class CoreTap < AbstractCoreTap - # @private sig { void } def initialize super "Homebrew", "core" @@ -1196,7 +1168,6 @@ def install(quiet: false, clone_target: nil, super(quiet:, clone_target: remote, custom_remote:, force:) end - # @private sig { params(manual: T::Boolean).void } def uninstall(manual: false) raise "Tap#uninstall is not available for CoreTap" if Homebrew::EnvConfig.no_install_from_api? @@ -1204,19 +1175,16 @@ def uninstall(manual: false) super end - # @private sig { returns(T::Boolean) } def core_tap? true end - # @private sig { returns(T::Boolean) } def linuxbrew_core? remote_repo.to_s.end_with?("/linuxbrew-core") || remote_repo == "Linuxbrew/homebrew-core" end - # @private sig { returns(Pathname) } def formula_dir @formula_dir ||= begin @@ -1238,7 +1206,6 @@ def new_formula_path(name) formula_dir/formula_subdir/"#{name.downcase}.rb" end - # @private sig { returns(Pathname) } def alias_dir @alias_dir ||= begin @@ -1247,7 +1214,6 @@ def alias_dir end end - # @private sig { returns(T::Hash[String, String]) } def formula_renames @formula_renames ||= if Homebrew::EnvConfig.no_install_from_api? @@ -1258,7 +1224,6 @@ def formula_renames end end - # @private sig { returns(Hash) } def tap_migrations @tap_migrations ||= if Homebrew::EnvConfig.no_install_from_api? @@ -1273,7 +1238,6 @@ def tap_migrations end end - # @private sig { returns(T::Array[String]) } def autobump @autobump ||= begin @@ -1282,7 +1246,6 @@ def autobump end end - # @private sig { returns(Hash) } def audit_exceptions @audit_exceptions ||= begin @@ -1291,7 +1254,6 @@ def audit_exceptions end end - # @private sig { returns(Hash) } def style_exceptions @style_exceptions ||= begin @@ -1300,7 +1262,6 @@ def style_exceptions end end - # @private sig { returns(Hash) } def pypi_formula_mappings @pypi_formula_mappings ||= begin @@ -1309,7 +1270,6 @@ def pypi_formula_mappings end end - # @private sig { returns(T::Array[T::Array[String]]) } def synced_versions_formulae @synced_versions_formulae ||= begin @@ -1318,13 +1278,11 @@ def synced_versions_formulae end end - # @private sig { params(file: Pathname).returns(String) } def alias_file_to_name(file) file.basename.to_s end - # @private sig { returns(T::Hash[String, String]) } def alias_table @alias_table ||= if Homebrew::EnvConfig.no_install_from_api? @@ -1334,7 +1292,6 @@ def alias_table end end - # @private sig { returns(T::Array[Pathname]) } def formula_files return super if Homebrew::EnvConfig.no_install_from_api? @@ -1342,7 +1299,6 @@ def formula_files formula_files_by_name.values end - # @private sig { returns(T::Array[String]) } def formula_names return super if Homebrew::EnvConfig.no_install_from_api? @@ -1350,7 +1306,6 @@ def formula_names Homebrew::API::Formula.all_formulae.keys end - # @private sig { returns(T::Hash[String, Pathname]) } def formula_files_by_name return super if Homebrew::EnvConfig.no_install_from_api? @@ -1388,13 +1343,11 @@ def to_internal_api_hash # A specialized {Tap} class for homebrew-cask. class CoreCaskTap < AbstractCoreTap - # @private sig { void } def initialize super "Homebrew", "cask" end - # @private sig { override.returns(T::Boolean) } def core_cask_tap? true @@ -1420,7 +1373,6 @@ def cask_tokens Homebrew::API::Cask.all_casks.keys end - # @private sig { override.returns(T::Hash[String, Pathname]) } def cask_files_by_name return super if Homebrew::EnvConfig.no_install_from_api? diff --git a/Library/Homebrew/tap_auditor.rb b/Library/Homebrew/tap_auditor.rb index 2e7c3cd08059bc..33a577101969b9 100644 --- a/Library/Homebrew/tap_auditor.rb +++ b/Library/Homebrew/tap_auditor.rb @@ -3,8 +3,6 @@ module Homebrew # Auditor for checking common violations in {Tap}s. - # - # @api private class TapAuditor attr_reader :name, :path, :formula_names, :formula_aliases, :formula_renames, :cask_tokens, :tap_audit_exceptions, :tap_style_exceptions, :tap_pypi_formula_mappings, :problems diff --git a/Library/Homebrew/uninstall.rb b/Library/Homebrew/uninstall.rb index b3e807b6009782..543e65c376ad20 100644 --- a/Library/Homebrew/uninstall.rb +++ b/Library/Homebrew/uninstall.rb @@ -5,8 +5,6 @@ module Homebrew # Helper module for uninstalling kegs. - # - # @api private module Uninstall def self.uninstall_kegs(kegs_by_rack, casks: [], force: false, ignore_dependencies: false, named_args: []) handle_unsatisfied_dependents(kegs_by_rack, @@ -117,7 +115,6 @@ def self.check_for_dependents(kegs, casks: [], named_args: []) true end - # @api private class DependentsMessage attr_reader :reqs, :deps, :named_args @@ -139,7 +136,6 @@ def are_required_by_deps end end - # @api private class DeveloperDependentsMessage < DependentsMessage def output opoo <<~EOS @@ -150,7 +146,6 @@ def output end end - # @api private class NondeveloperDependentsMessage < DependentsMessage def output ofail <<~EOS diff --git a/Library/Homebrew/unpack_strategy.rb b/Library/Homebrew/unpack_strategy.rb index 3ce46060d3317b..74e49473cbcaa6 100644 --- a/Library/Homebrew/unpack_strategy.rb +++ b/Library/Homebrew/unpack_strategy.rb @@ -4,8 +4,6 @@ require "system_command" # Module containing all available strategies for unpacking archives. -# -# @api private module UnpackStrategy extend T::Helpers diff --git a/Library/Homebrew/unversioned_cask_checker.rb b/Library/Homebrew/unversioned_cask_checker.rb index aa207460c4cb4e..241e63348d6248 100644 --- a/Library/Homebrew/unversioned_cask_checker.rb +++ b/Library/Homebrew/unversioned_cask_checker.rb @@ -9,8 +9,6 @@ module Homebrew # Check unversioned casks for updates by extracting their # contents and guessing the version from contained files. - # - # @api private class UnversionedCaskChecker include SystemCommand::Mixin diff --git a/Library/Homebrew/upgrade.rb b/Library/Homebrew/upgrade.rb index 4bf5d5c977296f..068a3b66d23440 100644 --- a/Library/Homebrew/upgrade.rb +++ b/Library/Homebrew/upgrade.rb @@ -10,8 +10,6 @@ module Homebrew # Helper functions for upgrading formulae. - # - # @api private module Upgrade module_function diff --git a/Library/Homebrew/url.rb b/Library/Homebrew/url.rb index 3d46280729605a..e9fcb2b377c47e 100644 --- a/Library/Homebrew/url.rb +++ b/Library/Homebrew/url.rb @@ -4,7 +4,6 @@ require "download_strategy" require "version" -# @api private class URL attr_reader :specs, :using diff --git a/Library/Homebrew/utils/analytics.rb b/Library/Homebrew/utils/analytics.rb index 6477c4f58e7857..2ec9c7ab1b6ecf 100644 --- a/Library/Homebrew/utils/analytics.rb +++ b/Library/Homebrew/utils/analytics.rb @@ -8,8 +8,6 @@ module Utils # Helper module for fetching and reporting analytics data. - # - # @api private module Analytics INFLUX_BUCKET = "analytics" INFLUX_TOKEN = "iVdsgJ_OjvTYGAA79gOfWlA_fX0QCuj4eYUNdb-qVUTrC3tp3JTWCADVNE9HxV0kp2ZjIK9tuthy_teX4szr9A==" diff --git a/Library/Homebrew/utils/ast.rb b/Library/Homebrew/utils/ast.rb index 6000a8a8b0def3..7103fb300b8fa8 100644 --- a/Library/Homebrew/utils/ast.rb +++ b/Library/Homebrew/utils/ast.rb @@ -6,8 +6,6 @@ module Utils # Helper functions for editing Ruby files. - # - # @api private module AST Node = RuboCop::AST::Node SendNode = RuboCop::AST::SendNode @@ -74,8 +72,6 @@ def call_node_match?(node, name:, type: nil) end # Helper class for editing formulae. - # - # @api private class FormulaAST extend Forwardable include AST diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index eae1793a08e529..80cb9083851eeb 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -8,8 +8,6 @@ module Utils # Helper function for interacting with `curl`. - # - # @api private module Curl include SystemCommand::Mixin extend SystemCommand::Mixin diff --git a/Library/Homebrew/utils/gems.rb b/Library/Homebrew/utils/gems.rb index eec1dbe7848a84..824c238fd2cc9d 100644 --- a/Library/Homebrew/utils/gems.rb +++ b/Library/Homebrew/utils/gems.rb @@ -32,17 +32,16 @@ module Homebrew module_function - # @api private def gemfile File.join(ENV.fetch("HOMEBREW_LIBRARY"), "Homebrew", "Gemfile") end + private_class_method :gemfile - # @api private def bundler_definition @bundler_definition ||= Bundler::Definition.build(Bundler.default_gemfile, Bundler.default_lockfile, false) end + private_class_method :bundler_definition - # @api private def valid_gem_groups install_bundler! require "bundler" @@ -157,6 +156,7 @@ def find_in_path(executable) File.executable?(File.join(path, executable)) end end + private_class_method :find_in_path def install_bundler! old_bundler_version = ENV.fetch("BUNDLER_VERSION", nil) @@ -181,6 +181,7 @@ def user_gem_groups [] end end + private_class_method :user_gem_groups def write_user_gem_groups(groups) return if @user_gem_groups == groups && GEM_GROUPS_FILE.exist? @@ -203,6 +204,7 @@ def write_user_gem_groups(groups) @user_gem_groups = groups end + private_class_method :write_user_gem_groups def forget_user_gem_groups! GEM_GROUPS_FILE.truncate(0) if GEM_GROUPS_FILE.exist? @@ -216,6 +218,7 @@ def user_vendor_version 0 end end + private_class_method :user_vendor_version def install_bundler_gems!(only_warn_on_failure: false, setup_path: true, groups: []) old_path = ENV.fetch("PATH", nil) diff --git a/Library/Homebrew/utils/git.rb b/Library/Homebrew/utils/git.rb index 7027ee026e3f03..29edb1cc153eed 100644 --- a/Library/Homebrew/utils/git.rb +++ b/Library/Homebrew/utils/git.rb @@ -7,7 +7,6 @@ module Utils # Helper functions for querying Git information. # # @see GitRepository - # @api private module Git extend SystemCommand::Mixin diff --git a/Library/Homebrew/utils/github.rb b/Library/Homebrew/utils/github.rb index f7cf0457938031..fadd3ccbab590f 100644 --- a/Library/Homebrew/utils/github.rb +++ b/Library/Homebrew/utils/github.rb @@ -7,9 +7,9 @@ require "system_command" -# Wrapper functions for the GitHub API. +# A module that interfaces with GitHub, code like PAT scopes, credential handling and API errors. # -# @api private +# @api internal module GitHub extend SystemCommand::Mixin diff --git a/Library/Homebrew/utils/github/actions.rb b/Library/Homebrew/utils/github/actions.rb index 19edc3aa141e7c..412884d9769955 100644 --- a/Library/Homebrew/utils/github/actions.rb +++ b/Library/Homebrew/utils/github/actions.rb @@ -7,7 +7,7 @@ module GitHub # Helper functions for interacting with GitHub Actions. # - # @api private + # @api internal module Actions sig { params(string: String).returns(String) } def self.escape(string) diff --git a/Library/Homebrew/utils/github/api.rb b/Library/Homebrew/utils/github/api.rb index 225b5617f3c643..85ba4a9c731107 100644 --- a/Library/Homebrew/utils/github/api.rb +++ b/Library/Homebrew/utils/github/api.rb @@ -6,7 +6,6 @@ require "utils/shell" require "utils/formatter" -# A module that interfaces with GitHub, code like PAT scopes, credential handling and API errors. module GitHub def self.pat_blurb(scopes = ALL_SCOPES) <<~EOS @@ -20,18 +19,23 @@ def self.pat_blurb(scopes = ALL_SCOPES) API_URL = "https://api.github.com" API_MAX_PAGES = 50 + private_constant :API_MAX_PAGES API_MAX_ITEMS = 5000 + private_constant :API_MAX_ITEMS PAGINATE_RETRY_COUNT = 3 + private_constant :PAGINATE_RETRY_COUNT CREATE_GIST_SCOPES = ["gist"].freeze CREATE_ISSUE_FORK_OR_PR_SCOPES = ["repo"].freeze CREATE_WORKFLOW_SCOPES = ["workflow"].freeze ALL_SCOPES = (CREATE_GIST_SCOPES + CREATE_ISSUE_FORK_OR_PR_SCOPES + CREATE_WORKFLOW_SCOPES).freeze + private_constant :ALL_SCOPES GITHUB_PERSONAL_ACCESS_TOKEN_REGEX = /^(?:[a-f0-9]{40}|(?:gh[pousr]|github_pat)_\w{36,251})$/ + private_constant :GITHUB_PERSONAL_ACCESS_TOKEN_REGEX - # Helper functions to access the GitHub API. + # Helper functions for accessing the GitHub API. # - # @api private + # @api internal module API extend SystemCommand::Mixin diff --git a/Library/Homebrew/utils/github/artifacts.rb b/Library/Homebrew/utils/github/artifacts.rb index 7baaa6f5742720..70290e579ecdde 100644 --- a/Library/Homebrew/utils/github/artifacts.rb +++ b/Library/Homebrew/utils/github/artifacts.rb @@ -9,8 +9,6 @@ module GitHub # # @param url [String] URL to download from # @param artifact_id [String] a value that uniquely identifies the downloaded artifact - # - # @api private sig { params(url: String, artifact_id: String).void } def self.download_artifact(url, artifact_id) raise API::MissingAuthenticationError if API.credentials == :none @@ -25,8 +23,6 @@ def self.download_artifact(url, artifact_id) end # Strategy for downloading an artifact from GitHub Actions. -# -# @api private class GitHubArtifactDownloadStrategy < AbstractFileDownloadStrategy def initialize(url, artifact_id, token:) super(url, "artifact", artifact_id) diff --git a/Library/Homebrew/utils/inreplace.rb b/Library/Homebrew/utils/inreplace.rb index 648aebeb93632c..4031fa9c2d4b7f 100644 --- a/Library/Homebrew/utils/inreplace.rb +++ b/Library/Homebrew/utils/inreplace.rb @@ -5,8 +5,6 @@ module Utils # Helper functions for replacing text in files in-place. - # - # @api private module Inreplace # Error during text replacement. class Error < RuntimeError @@ -73,7 +71,6 @@ def self.inreplace(paths, before = nil, after = nil, audit_result: true, &block) raise Utils::Inreplace::Error, errors if errors.present? end - # @api private def self.inreplace_pairs(path, replacement_pairs, read_only_run: false, silent: false) str = File.binread(path) contents = StringInreplaceExtension.new(str) diff --git a/Library/Homebrew/utils/link.rb b/Library/Homebrew/utils/link.rb index d166878bc33226..09e56d2696cf7f 100644 --- a/Library/Homebrew/utils/link.rb +++ b/Library/Homebrew/utils/link.rb @@ -3,8 +3,6 @@ module Utils # Helper functions for creating symlinks. - # - # @api private module Link def self.link_src_dst_dirs(src_dir, dst_dir, command, link_dir: false) return unless src_dir.exist? diff --git a/Library/Homebrew/utils/pypi.rb b/Library/Homebrew/utils/pypi.rb index dd6dd8217841e9..ac7da484225297 100644 --- a/Library/Homebrew/utils/pypi.rb +++ b/Library/Homebrew/utils/pypi.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Helper functions for updating PyPI resources. -# -# @api private module PyPI PYTHONHOSTED_URL_PREFIX = "https://files.pythonhosted.org/packages/" private_constant :PYTHONHOSTED_URL_PREFIX @@ -11,7 +9,6 @@ module PyPI # Represents a Python package. # This package can be a PyPI package (either by name/version or PyPI distribution URL), # or it can be a non-PyPI URL. - # @api private class Package sig { params(package_string: String, is_url: T::Boolean, python_name: String).void } def initialize(package_string, is_url: false, python_name: "python") diff --git a/Library/Homebrew/utils/repology.rb b/Library/Homebrew/utils/repology.rb index f9a05c623e82c9..62095821d68003 100644 --- a/Library/Homebrew/utils/repology.rb +++ b/Library/Homebrew/utils/repology.rb @@ -4,8 +4,6 @@ require "utils/curl" # Repology API client. -# -# @api private module Repology HOMEBREW_CORE = "homebrew" HOMEBREW_CASK = "homebrew_casks" diff --git a/Library/Homebrew/utils/shared_audits.rb b/Library/Homebrew/utils/shared_audits.rb index 5e4fbb79a097fb..3329ea1797fb4a 100644 --- a/Library/Homebrew/utils/shared_audits.rb +++ b/Library/Homebrew/utils/shared_audits.rb @@ -5,8 +5,6 @@ require "utils/github/api" # Auditing functions for rules common to both casks and formulae. -# -# @api private module SharedAudits URL_TYPE_HOMEPAGE = "homepage URL" diff --git a/Library/Homebrew/utils/shebang.rb b/Library/Homebrew/utils/shebang.rb index 95daadcd6d6a2d..34d2356672b235 100644 --- a/Library/Homebrew/utils/shebang.rb +++ b/Library/Homebrew/utils/shebang.rb @@ -3,14 +3,10 @@ module Utils # Helper functions for manipulating shebang lines. - # - # @api private module Shebang module_function # Specification on how to rewrite a given shebang. - # - # @api private class RewriteInfo attr_reader :regex, :max_length, :replacement diff --git a/Library/Homebrew/utils/spdx.rb b/Library/Homebrew/utils/spdx.rb index 8849971e713e3f..f44aa54a8ba69d 100644 --- a/Library/Homebrew/utils/spdx.rb +++ b/Library/Homebrew/utils/spdx.rb @@ -5,8 +5,6 @@ require "utils/github" # Helper module for updating SPDX license data. -# -# @api private module SPDX module_function diff --git a/Library/Homebrew/utils/string_inreplace_extension.rb b/Library/Homebrew/utils/string_inreplace_extension.rb index 4c4d4917d46c08..fffaf771df9309 100644 --- a/Library/Homebrew/utils/string_inreplace_extension.rb +++ b/Library/Homebrew/utils/string_inreplace_extension.rb @@ -2,8 +2,6 @@ # frozen_string_literal: true # Used by the `inreplace` function (in `utils.rb`). -# -# @api private class StringInreplaceExtension sig { returns(T::Array[String]) } attr_accessor :errors diff --git a/Library/Homebrew/utils/svn.rb b/Library/Homebrew/utils/svn.rb index f45e49b3d0af13..93f6b100a976d5 100644 --- a/Library/Homebrew/utils/svn.rb +++ b/Library/Homebrew/utils/svn.rb @@ -5,8 +5,6 @@ module Utils # Helper functions for querying SVN information. - # - # @api private module Svn class << self include SystemCommand::Mixin diff --git a/Library/Homebrew/utils/tar.rb b/Library/Homebrew/utils/tar.rb index ab7b411f5eb618..bf4df5e6649433 100644 --- a/Library/Homebrew/utils/tar.rb +++ b/Library/Homebrew/utils/tar.rb @@ -5,8 +5,6 @@ module Utils # Helper functions for interacting with tar files. - # - # @api private module Tar class << self include SystemCommand::Mixin diff --git a/Library/Homebrew/utils/tty.rb b/Library/Homebrew/utils/tty.rb index 7872a7aff67010..c6b3bd8877dae5 100644 --- a/Library/Homebrew/utils/tty.rb +++ b/Library/Homebrew/utils/tty.rb @@ -4,8 +4,6 @@ require "env_config" # Various helper functions for interacting with TTYs. -# -# @api private module Tty @stream = $stdout diff --git a/Library/Homebrew/utils/user.rb b/Library/Homebrew/utils/user.rb index cb758ef47ed17d..09be3d770774e0 100644 --- a/Library/Homebrew/utils/user.rb +++ b/Library/Homebrew/utils/user.rb @@ -7,8 +7,6 @@ require "system_command" # A system user. -# -# @api private class User < SimpleDelegator include SystemCommand::Mixin diff --git a/Library/Homebrew/version.rb b/Library/Homebrew/version.rb index 7c445e2b476949..f42dbeddb4000b 100644 --- a/Library/Homebrew/version.rb +++ b/Library/Homebrew/version.rb @@ -5,8 +5,6 @@ require "version/parser" # A formula's version. -# -# @api private class Version include Comparable diff --git a/Library/Homebrew/version/parser.rb b/Library/Homebrew/version/parser.rb index 8c7dd9f561c546..76732dd92bf598 100644 --- a/Library/Homebrew/version/parser.rb +++ b/Library/Homebrew/version/parser.rb @@ -2,7 +2,6 @@ # frozen_string_literal: true class Version - # @api private class Parser extend T::Helpers abstract! @@ -11,7 +10,6 @@ class Parser def parse(spec); end end - # @api private class RegexParser < Parser extend T::Helpers abstract! @@ -39,7 +37,6 @@ def parse(spec) def self.process_spec(spec); end end - # @api private class UrlParser < RegexParser sig { override.params(spec: Pathname).returns(String) } def self.process_spec(spec) @@ -47,7 +44,6 @@ def self.process_spec(spec) end end - # @api private class StemParser < RegexParser SOURCEFORGE_DOWNLOAD_REGEX = %r{(?:sourceforge\.net|sf\.net)/.*/download$} NO_FILE_EXTENSION_REGEX = /\.[^a-zA-Z]+$/ diff --git a/Library/Homebrew/warnings.rb b/Library/Homebrew/warnings.rb index 28387659a8d07a..94f06292907953 100644 --- a/Library/Homebrew/warnings.rb +++ b/Library/Homebrew/warnings.rb @@ -4,8 +4,6 @@ require "warning" # Helper module for handling warnings. -# -# @api private module Warnings COMMON_WARNINGS = { parser_syntax: [ diff --git a/Library/Homebrew/yard/docstring_parser.rb b/Library/Homebrew/yard/docstring_parser.rb new file mode 100644 index 00000000000000..739916fbfdf07d --- /dev/null +++ b/Library/Homebrew/yard/docstring_parser.rb @@ -0,0 +1,24 @@ +# typed: true +# frozen_string_literal: true + +# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899 +module Homebrew + module YARD + class DocstringParser < ::YARD::DocstringParser + def parse_content(content) + # Ignore non-documentation comments. + content = content&.sub(/(\A(typed|.*rubocop)|TODO|FIXME):.*/m, "") + + content = super(content) + + # Mark everything as `@api private` by default. + visibility_tags = ["visibility", "api", "private"] + tags << create_tag("api", "private") if tags.none? { |tag| visibility_tags.include?(tag.tag_name) } + + content + end + end + end +end + +YARD::Docstring.default_parser = Homebrew::YARD::DocstringParser diff --git a/Library/Homebrew/yard/ignore_directives.rb b/Library/Homebrew/yard/ignore_directives.rb deleted file mode 100644 index ecc616d037af57..00000000000000 --- a/Library/Homebrew/yard/ignore_directives.rb +++ /dev/null @@ -1,11 +0,0 @@ -# typed: true -# frozen_string_literal: true - -# from https://github.com/lsegal/yard/issues/484#issuecomment-442586899 -class IgnoreDirectiveDocstringParser < YARD::DocstringParser - def parse_content(content) - super(content&.sub(/(\A(typed|.*rubocop)|TODO):.*/m, "")) - end -end - -YARD::Docstring.default_parser = IgnoreDirectiveDocstringParser