Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make documentation @api private by default. #16831

Merged
merged 1 commit into from Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions Library/Homebrew/.rubocop.yml
Expand Up @@ -28,8 +28,11 @@ Style/Documentation:
- cask/dsl.rb
- cask/dsl/version.rb
- cask/url.rb
- development_tools.rb
- download_strategy.rb
- extend/ENV/super.rb
- extend/kernel.rb
- extend/pathname.rb
- formula.rb
- formula_assertions.rb
- formula_free_port.rb
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/.yardopts
Expand Up @@ -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/
Expand Down
4 changes: 4 additions & 0 deletions Library/Homebrew/Gemfile
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions Library/Homebrew/Gemfile.lock
Expand Up @@ -198,6 +198,8 @@ DEPENDENCIES
stackprof
tapioca
warning
yard
yard-sorbet

RUBY VERSION
ruby 3.1.4p223
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/PATH.rb
Expand Up @@ -2,8 +2,6 @@
# frozen_string_literal: true

# Representation of a `*PATH` environment variable.
#
# @api private
class PATH
include Enumerable
extend Forwardable
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/api.rb
Expand Up @@ -9,8 +9,6 @@

module Homebrew
# Helper functions for using Homebrew's formulae.brew.sh API.
#
# @api private
module API
extend Cachable

Expand Down Expand Up @@ -191,15 +189,13 @@ 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?

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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/api/analytics.rb
Expand Up @@ -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) }
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/api/cask.rb
Expand Up @@ -7,8 +7,6 @@
module Homebrew
module API
# Helper functions for using the cask JSON API.
#
# @api private
module Cask
extend Cachable

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/api/download.rb
Expand Up @@ -5,15 +5,13 @@

module Homebrew
module API
# @api private
class DownloadStrategy < CurlDownloadStrategy
sig { override.returns(Pathname) }
def symlink_location
cache/name
end
end

# @api private
class Download < Downloadable
sig {
params(
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/api/formula.rb
Expand Up @@ -7,8 +7,6 @@
module Homebrew
module API
# Helper functions for using the formula JSON API.
#
# @api private
module Formula
extend Cachable

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/build.rb
Expand Up @@ -17,8 +17,6 @@
require "cmd/install"

# A formula build.
#
# @api private
class Build
attr_reader :formula, :deps, :reqs, :args

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/build_environment.rb
Expand Up @@ -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)
Expand Down
5 changes: 0 additions & 5 deletions Library/Homebrew/build_options.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/bump_version_parser.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/bundle_version.rb
Expand Up @@ -5,8 +5,6 @@

module Homebrew
# Representation of a macOS bundle version, commonly found in `Info.plist` files.
#
# @api private
class BundleVersion
include Comparable

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact.rb
Expand Up @@ -30,8 +30,6 @@

module Cask
# Module containing all cask artifact classes.
#
# @api private
module Artifact
end
end
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/abstract_artifact.rb
Expand Up @@ -7,8 +7,6 @@
module Cask
module Artifact
# Abstract superclass for all artifacts.
#
# @api private
class AbstractArtifact
extend T::Helpers
abstract!
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/abstract_flight_block.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/abstract_uninstall.rb
Expand Up @@ -12,8 +12,6 @@
module Cask
module Artifact
# Abstract superclass for uninstall artifacts.
#
# @api private
class AbstractUninstall < AbstractArtifact
include SystemCommand::Mixin

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/app.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `app` stanza.
#
# @api private
class App < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/artifact.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/audio_unit_plugin.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `audio_unit_plugin` stanza.
#
# @api private
class AudioUnitPlugin < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/binary.rb
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/colorpicker.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `colorpicker` stanza.
#
# @api private
class Colorpicker < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/dictionary.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `dictionary` stanza.
#
# @api private
class Dictionary < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/font.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `font` stanza.
#
# @api private
class Font < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/input_method.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `input_method` stanza.
#
# @api private
class InputMethod < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/installer.rb
Expand Up @@ -7,8 +7,6 @@
module Cask
module Artifact
# Artifact corresponding to the `installer` stanza.
#
# @api private
class Installer < AbstractArtifact
VALID_KEYS = Set.new([
:manual,
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/internet_plugin.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `internet_plugin` stanza.
#
# @api private
class InternetPlugin < Moved
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/keyboard_layout.rb
Expand Up @@ -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)
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/manpage.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `manpage` stanza.
#
# @api private
class Manpage < Symlinked
attr_reader :section

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/mdimporter.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/moved.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/pkg.rb
Expand Up @@ -10,8 +10,6 @@
module Cask
module Artifact
# Artifact corresponding to the `pkg` stanza.
#
# @api private
class Pkg < AbstractArtifact
attr_reader :path, :stanza_options

Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/postflight_block.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `postflight` stanza.
#
# @api private
class PostflightBlock < AbstractFlightBlock
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/preflight_block.rb
Expand Up @@ -6,8 +6,6 @@
module Cask
module Artifact
# Artifact corresponding to the `preflight` stanza.
#
# @api private
class PreflightBlock < AbstractFlightBlock
end
end
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/prefpane.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/qlplugin.rb
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions Library/Homebrew/cask/artifact/relocated.rb
Expand Up @@ -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
Expand Down