Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Library/Homebrew/language/perl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def perl_shebang_rewrite_info(perl_path)
)
end

# @api public
sig { params(formula: Formula).returns(Utils::Shebang::RewriteInfo) }
def detected_perl_shebang(formula = T.cast(self, Formula))
perl_deps = formula.declared_deps.select { |dep| dep.required? && dep.name == "perl" }
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/language/php.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ def php_shebang_rewrite_info(php_path)
)
end

# @api public
sig { params(formula: Formula).returns(Utils::Shebang::RewriteInfo) }
def detected_php_shebang(formula = T.cast(self, Formula))
php_deps = formula.deps.select(&:required?).map(&:name).grep(/^php(@.+)?$/)
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/language/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ def python_shebang_rewrite_info(python_path)
)
end

# @api public
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this should be public API, should it also have a documenting comment? Something like:

Suggested change
# @api public
# Returns a {Utils::Shebang::RewriteInfo} object that contains necessary information for
# rewriting a Python shebang to use the formula's Python dependency, or the `python3`
# executable from `PATH` if `use_python_from_path` is `true`.
#
# To be used with {Utils::Shebang.rewrite_shebang}.
#
# @api public

Same for the other methods.

sig { params(formula: Formula, use_python_from_path: T::Boolean).returns(Utils::Shebang::RewriteInfo) }
def detected_python_shebang(formula = T.cast(self, Formula), use_python_from_path: false)
python_path = if use_python_from_path
Expand Down
Loading