Skip to content

Commit

Permalink
vale
Browse files Browse the repository at this point in the history
  • Loading branch information
reitermarkus committed Apr 30, 2024
1 parent 37439a6 commit 4c53a9e
Show file tree
Hide file tree
Showing 39 changed files with 239 additions and 163 deletions.
2 changes: 1 addition & 1 deletion Library/Homebrew/build_environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def std?
# DSL for specifying build environment settings.
module DSL
# Initialise @env for each class which may use this DSL (e.g. each formula subclass).
# `env` may never be called, and it needs to be initialised before the class is frozen.
# `env` may never be called and it needs to be initialised before the class is frozen.
def inherited(child)
super
child.instance_eval do
Expand Down
4 changes: 1 addition & 3 deletions Library/Homebrew/cask/dsl.rb
Original file line number Diff line number Diff line change
Expand Up @@ -375,11 +375,9 @@ def depends_on(**kwargs)

# Declare conflicts that keep a cask from installing or working correctly.
#
# NOTE: Multiple conflicts can be specified.
#
# @api public
def conflicts_with(**kwargs)
# TODO: remove this constraint, and instead merge multiple conflicts_with stanzas
# TODO: Remove this constraint and instead merge multiple `conflicts_with` stanzas
set_unique_stanza(:conflicts_with, kwargs.empty?) { DSL::ConflictsWith.new(**kwargs) }
end

Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/cask/utils.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,9 @@ def self.gain_permissions(path, command_args, command)
unless tried_permissions
print_stderr = Context.current.debug? || Context.current.verbose?
# TODO: Better handling for the case where path is a symlink.
# The -h and -R flags cannot be combined, and behavior is
# The `-h` and `-R` flags cannot be combined and behavior is
# dependent on whether the file argument has a trailing
# slash. This should do the right thing, but is fragile.
# slash. This should do the right thing, but is fragile.
command.run("/usr/bin/chflags",
print_stderr:,
args: command_args + ["--", "000", path])
Expand All @@ -87,7 +87,7 @@ def self.gain_permissions(path, command_args, command)
unless tried_ownership
# in case of ownership problems
# TODO: Further examine files to see if ownership is the problem
# before using sudo+chown
# before using `sudo` and `chown`.
ohai "Using sudo to gain ownership of path '#{path}'"
command.run("/usr/sbin/chown",
args: command_args + ["--", User.current, path],
Expand Down
37 changes: 19 additions & 18 deletions Library/Homebrew/cleaner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,27 +25,28 @@ def initialize(formula)
def clean
ObserverPathnameExtension.reset_counts!

# Many formulae include 'lib/charset.alias', but it is not strictly needed
# and will conflict if more than one formula provides it
# Many formulae include `lib/charset.alias`, but it is not strictly needed
# and will conflict if more than one formula provides it.
observe_file_removal @formula.lib/"charset.alias"

[@formula.bin, @formula.sbin, @formula.lib].each { |dir| clean_dir(dir) if dir.exist? }

# Get rid of any info 'dir' files, so they don't conflict at the link stage
# Get rid of any info `dir` files, so they don't conflict at the link stage
#
# The 'dir' files come in at least 3 locations:
# The `dir` files come in at least 3 locations:
#
# 1. 'info/dir'
# 2. 'info/#{name}/dir'
# 3. 'info/#{arch}/dir'
# 1. `info/dir`
# 2. `info/#{name}/dir`
# 3. `info/#{arch}/dir`
#
# Of these 3 only 'info/#{name}/dir' is safe to keep since the rest will
# Of these 3 only `info/#{name}/dir` is safe to keep since the rest will
# conflict with other formulae because they use a shared location.
#
# See [cleaner: recursively delete info `dir`s by gromgit · Pull Request
# #11597][1], [emacs 28.1 bottle does not contain `dir` file · Issue
# #100190][2], and [Keep `info/#{f.name}/dir` files in cleaner by
# timvisher][3] for more info.
# See
# [cleaner: recursively delete info `dir`s by gromgit · Pull Request #11597][1],
# [emacs 28.1 bottle does not contain `dir` file · Issue #100190][2] and
# [Keep `info/#{f.name}/dir` files in cleaner by timvisher][3]
# for more info.
#
# [1]: https://github.com/Homebrew/brew/pull/11597
# [2]: https://github.com/Homebrew/homebrew-core/issues/100190
Expand Down Expand Up @@ -114,15 +115,15 @@ def executable_path?(path)
# created as part of installing any Perl module.
PERL_BASENAMES = Set.new(%w[perllocal.pod .packlist]).freeze

# Clean a top-level (bin, sbin, lib) directory, recursively, by fixing file
# Clean a top-level (`bin`, `sbin`, `lib`) directory, recursively, by fixing file
# permissions and removing .la files, unless the files (or parent
# directories) are protected by skip_clean.
#
# bin and sbin should not have any subdirectories; if either do that is
# caught as an audit warning
# `bin` and `sbin` should not have any subdirectories; if either do that is
# caught as an audit warning.
#
# lib may have a large directory tree (see Erlang for instance), and
# clean_dir applies cleaning rules to the entire tree
# `lib` may have a large directory tree (see Erlang for instance) and
# clean_dir applies cleaning rules to the entire tree.
sig { params(directory: Pathname).void }
def clean_dir(directory)
directory.find do |path|
Expand All @@ -137,7 +138,7 @@ def clean_dir(directory)
elsif path.symlink?
# Skip it.
else
# Set permissions for executables and non-executables
# Set permissions for executables and non-executables.
perms = if executable_path?(path)
0555
else
Expand Down
4 changes: 2 additions & 2 deletions Library/Homebrew/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -571,8 +571,8 @@ def cleanup_python_site_packages
HOMEBREW_PREFIX.glob("lib/python*/site-packages").each do |site_packages|
site_packages.each_child do |child|
next unless child.directory?
# TODO: Work out a sensible way to clean up pip's, setuptools', and wheel's
# {dist,site}-info directories. Alternatively, consider always removing
# TODO: Work out a sensible way to clean up `pip`'s, `setuptools`' and `wheel`'s
# `{dist,site}-info` directories. Alternatively, consider always removing
# all `-info` directories, because we may not be making use of them.
next if child.basename.to_s.end_with?("-info")

Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/--prefix.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def list_unbrewed
dirs = HOMEBREW_PREFIX.subdirs.map { |dir| dir.basename.to_s }
dirs -= %w[Library Cellar Caskroom .git]

# Exclude cache, logs, and repository, if they are located under the prefix.
# Exclude cache, logs and repository, if they are located under the prefix.
[HOMEBREW_CACHE, HOMEBREW_LOGS, HOMEBREW_REPOSITORY].each do |dir|
dirs.delete dir.relative_path_from(HOMEBREW_PREFIX).to_s
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/cmd/outdated.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Outdated < AbstractCommand
cmd_args do
description <<~EOS
List installed casks and formulae that have an updated version available. By default, version
information is displayed in interactive shells, and suppressed otherwise.
information is displayed in interactive shells and suppressed otherwise.
EOS
switch "-q", "--quiet",
description: "List only the names of outdated kegs (takes precedence over `--verbose`)."
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dependencies_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def recursive_includes(klass, root_dependent, includes, ignores)
end

# If a tap isn't installed, we can't find the dependencies of one of
# its formulae, and an exception will be thrown if we try.
# its formulae and an exception will be thrown if we try.
Dependency.keep_but_prune_recursive_deps if klass == Dependency && dep.tap && !dep.tap.installed?
end
end
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/dev-cmd/pr-pull.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class PrPull < AbstractCommand

cmd_args do
description <<~EOS
Download and publish bottles, and apply the bottle commit from a
Download and publish bottles and apply the bottle commit from a
pull request with artifacts generated by GitHub Actions.
Requires write access to the repository.
EOS
Expand Down Expand Up @@ -187,7 +187,7 @@ def run
end
end

# Separates a commit message into subject, body, and trailers.
# Separates a commit message into subject, body and trailers.
def separate_commit_message(message)
subject = message.lines.first.strip

Expand Down Expand Up @@ -337,7 +337,7 @@ def squash_package_commits(commits, file, git_repo:, reason: "", verbose: false,
new_package = package_file.read
bump_subject = determine_bump_subject(old_package, new_package, package_file, reason:)

# Commit with the new subject, body, and trailers.
# Commit with the new subject, body and trailers.
safe_system("git", "-C", git_repo.pathname, "commit", "--quiet",
"-m", bump_subject, "-m", messages.join("\n"), "-m", trailers.join("\n"),
"--author", original_author, "--date", original_date, "--", file)
Expand Down
12 changes: 6 additions & 6 deletions Library/Homebrew/diagnostic.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def check_for_stray_dylibs
__check_stray_files "/usr/local/lib", "*.dylib", allow_list, <<~EOS
Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
building Homebrew formulae and may need to be deleted.
Unexpected dylibs:
EOS
Expand All @@ -246,7 +246,7 @@ def check_for_stray_static_libs
__check_stray_files "/usr/local/lib", "*.a", allow_list, <<~EOS
Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
building Homebrew formulae and may need to be deleted.
Unexpected static libraries:
EOS
Expand All @@ -266,7 +266,7 @@ def check_for_stray_pcs
__check_stray_files "/usr/local/lib/pkgconfig", "*.pc", allow_list, <<~EOS
Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
building Homebrew formulae and may need to be deleted.
Unexpected '.pc' files:
EOS
Expand All @@ -287,7 +287,7 @@ def check_for_stray_las
__check_stray_files "/usr/local/lib", "*.la", allow_list, <<~EOS
Unbrewed '.la' files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
building Homebrew formulae and may need to be deleted.
Unexpected '.la' files:
EOS
Expand All @@ -306,7 +306,7 @@ def check_for_stray_headers
__check_stray_files "/usr/local/include", "**/*.h", allow_list, <<~EOS
Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
building Homebrew formulae and may need to be deleted.
Unexpected header files:
EOS
Expand Down Expand Up @@ -491,7 +491,7 @@ def check_for_git

<<~EOS
Git could not be found in your PATH.
Homebrew uses Git for several internal functions, and some formulae use Git
Homebrew uses Git for several internal functions and some formulae use Git
checkouts instead of stable tarballs. You may want to install Git:
brew install git
EOS
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/exceptions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -565,7 +565,7 @@ def initialize(formulae)
end
end

# Raised by Homebrew.install, Homebrew.reinstall, and Homebrew.upgrade
# Raised by {Homebrew.install}, {Homebrew.reinstall} and {Homebrew.upgrade}
# if the user passes any flags/environment that would case a bottle-only
# installation on a system without build tools to fail.
class BuildFlagsError < RuntimeError
Expand Down
6 changes: 3 additions & 3 deletions Library/Homebrew/extend/array.rb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def fifth = self[4]
# * <tt>:words_connector</tt> - The sign or word used to join all but the last
# element in arrays with three or more elements (default: ", ").
# * <tt>:last_word_connector</tt> - The sign or word used to join the last element
# in arrays with three or more elements (default: ", and ").
# in arrays with three or more elements (default: " and ").
# * <tt>:two_words_connector</tt> - The sign or word used to join the elements
# in arrays with two elements (default: " and ").
#
Expand All @@ -39,7 +39,7 @@ def fifth = self[4]
# [].to_sentence # => ""
# ['one'].to_sentence # => "one"
# ['one', 'two'].to_sentence # => "one and two"
# ['one', 'two', 'three'].to_sentence # => "one, two, and three"
# ['one', 'two', 'three'].to_sentence # => "one, two and three"
# ['one', 'two'].to_sentence(two_words_connector: '-')
# # => "one-two"
#
Expand All @@ -54,7 +54,7 @@ def fifth = self[4]
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sublicense, and/or sell copies of the Software, and to
# distribute, sublicense and/or sell copies of the Software and to
# permit persons to whom the Software is furnished to do so, subject to
# the following conditions:
#
Expand Down
Loading

0 comments on commit 4c53a9e

Please sign in to comment.