Split one-class-per-file todos#22212
Merged
MikeMcQuaid merged 1 commit intoMay 10, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR removes Style/OneClassPerFile RuboCop todos by extracting previously co-located top-level classes/modules into dedicated files, while keeping existing entry-point requires to preserve stable load paths across Homebrew.
Changes:
- Split several top-level classes/modules out of “entry-point” files (e.g.,
tap.rb,tab.rb,resource.rb,options.rb,lock_file.rb, etc.) and replaced inline definitions withrequirestatements. - Moved the download strategy class hierarchy into individual files under
Library/Homebrew/download_strategy/. - Split various core extensions (blank?/deep_dup/duplicable/enumerable) into one-class-per-file layouts and added corresponding
requires.
Reviewed changes
Copilot reviewed 84 out of 84 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| Library/Homebrew/utils/github/artifacts/github_artifact_download_strategy.rb | New per-class file for GitHub Actions artifact download strategy. |
| Library/Homebrew/utils/github/artifacts.rb | Removes inline strategy class; requires the extracted strategy file. |
| Library/Homebrew/tap/abstract_core_tap.rb | Extracts AbstractCoreTap into its own file. |
| Library/Homebrew/tap/core_tap.rb | Extracts CoreTap into its own file. |
| Library/Homebrew/tap/core_cask_tap.rb | Extracts CoreCaskTap into its own file. |
| Library/Homebrew/tap/tap_config.rb | Extracts TapConfig into its own file. |
| Library/Homebrew/tap.rb | Removes multiple inline classes; requires extracted tap-related files. |
| Library/Homebrew/tab/tab.rb | Extracts Tab into its own file. |
| Library/Homebrew/tab.rb | Removes inline Tab; requires extracted tab/tab. |
| Library/Homebrew/resource/resource_stage_context.rb | Extracts ResourceStageContext into its own file. |
| Library/Homebrew/resource.rb | Removes inline ResourceStageContext; requires extracted file. |
| Library/Homebrew/reinstall/reinstall.rb | Extracts Homebrew::Reinstall implementation into its own file. |
| Library/Homebrew/reinstall.rb | Removes inline module; requires extracted reinstall implementation. |
| Library/Homebrew/os/linux/elf/os.rb | Extracts OS::Linux::Elf helper module into its own file. |
| Library/Homebrew/os/linux/elf.rb | Removes inline OS::Linux::Elf; requires extracted file. |
| Library/Homebrew/options/options.rb | Extracts Options into its own file. |
| Library/Homebrew/options/deprecated_option.rb | Extracts DeprecatedOption into its own file. |
| Library/Homebrew/options.rb | Removes inline Options/DeprecatedOption; requires extracted files. |
| Library/Homebrew/lock_file/formula_lock.rb | Extracts FormulaLock into its own file. |
| Library/Homebrew/lock_file/cask_lock.rb | Extracts CaskLock into its own file. |
| Library/Homebrew/lock_file/download_lock.rb | Extracts DownloadLock into its own file. |
| Library/Homebrew/lock_file.rb | Removes inline lock classes; requires extracted lock files. |
| Library/Homebrew/extend/os/mac/hardware/cpu/hardware.rb | Extracts macOS CPU sysctl helpers into a dedicated file. |
| Library/Homebrew/extend/os/mac/hardware/cpu.rb | Removes inline Hardware::CPU; requires extracted file. |
| Library/Homebrew/extend/os/mac/extend/pathname/os.rb | Extracts OS::Mac::Pathname::ClassMethods into its own file. |
| Library/Homebrew/extend/os/mac/extend/pathname.rb | Removes inline module; requires extracted file. |
| Library/Homebrew/extend/os/linux/extend/pathname/os.rb | Extracts OS::Linux::Pathname::ClassMethods into its own file. |
| Library/Homebrew/extend/os/linux/extend/pathname.rb | Removes inline module; requires extracted file. |
| Library/Homebrew/extend/object/duplicable/method.rb | Extracts Method#duplicable? override into its own file. |
| Library/Homebrew/extend/object/duplicable/unbound_method.rb | Extracts UnboundMethod#duplicable? override into its own file. |
| Library/Homebrew/extend/object/duplicable/singleton.rb | Extracts Singleton#duplicable? override into its own file. |
| Library/Homebrew/extend/object/duplicable.rb | Removes inline classes/modules; requires extracted duplicable extensions. |
| Library/Homebrew/extend/object/deep_dup/array.rb | Extracts Array#deep_dup into its own file. |
| Library/Homebrew/extend/object/deep_dup/hash.rb | Extracts Hash#deep_dup into its own file. |
| Library/Homebrew/extend/object/deep_dup/module.rb | Extracts Module#deep_dup into its own file. |
| Library/Homebrew/extend/object/deep_dup.rb | Removes inline deep-dup extensions; requires extracted files. |
| Library/Homebrew/extend/enumerable/hash.rb | Extracts Hash#compact_blank override into its own file. |
| Library/Homebrew/extend/enumerable.rb | Removes inline Hash#compact_blank; requires extracted file. |
| Library/Homebrew/extend/blank/nil_class.rb | Extracts NilClass#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/false_class.rb | Extracts FalseClass#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/true_class.rb | Extracts TrueClass#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/array.rb | Extracts Array#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/hash.rb | Extracts Hash#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/symbol.rb | Extracts Symbol#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/string.rb | Extracts String#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/numeric.rb | Extracts Numeric#blank?/present? into its own file. |
| Library/Homebrew/extend/blank/time.rb | Extracts Time#blank?/present? into its own file. |
| Library/Homebrew/extend/blank.rb | Removes inline blank?/present? overrides; requires extracted files. |
| Library/Homebrew/download_strategy/abstract_download_strategy.rb | Extracts AbstractDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/abstract_file_download_strategy.rb | Extracts AbstractFileDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/vcs_download_strategy.rb | Extracts VCSDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/curl_download_strategy.rb | Extracts CurlDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/pypi_download_strategy.rb | Extracts PyPIDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/homebrew_curl_download_strategy.rb | Extracts HomebrewCurlDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/curl_github_packages_download_strategy.rb | Extracts CurlGitHubPackagesDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/curl_apache_mirror_download_strategy.rb | Extracts CurlApacheMirrorDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/curl_post_download_strategy.rb | Extracts CurlPostDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/no_unzip_curl_download_strategy.rb | Extracts NoUnzipCurlDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/local_bottle_download_strategy.rb | Extracts LocalBottleDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/subversion_download_strategy.rb | Extracts SubversionDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/git_download_strategy.rb | Extracts GitDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/github_git_download_strategy.rb | Extracts GitHubGitDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/cvs_download_strategy.rb | Extracts CVSDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/mercurial_download_strategy.rb | Extracts MercurialDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/bazaar_download_strategy.rb | Extracts BazaarDownloadStrategy into its own file. |
| Library/Homebrew/download_strategy/fossil_download_strategy.rb | Extracts FossilDownloadStrategy into its own file (contains a newly introduced parsing bug per review comments). |
| Library/Homebrew/download_strategy/download_strategy_detector.rb | Extracts DownloadStrategyDetector into its own file. |
| Library/Homebrew/description_cache_store/cask_description_cache_store.rb | Extracts CaskDescriptionCacheStore into its own file. |
| Library/Homebrew/description_cache_store.rb | Removes inline cask cache store; requires extracted file. |
| Library/Homebrew/dependency/uses_from_macos_dependency.rb | Extracts UsesFromMacOSDependency into its own file. |
| Library/Homebrew/dependency.rb | Removes inline macOS dependency class; requires extracted file. |
| Library/Homebrew/dependencies/requirements.rb | Extracts Requirements into its own file. |
| Library/Homebrew/dependencies.rb | Removes inline Requirements; requires extracted file. |
| Library/Homebrew/compilers/compiler_failure.rb | Extracts CompilerFailure into its own file. |
| Library/Homebrew/compilers/compiler_selector.rb | Extracts CompilerSelector into its own file. |
| Library/Homebrew/compilers.rb | Removes inline compiler classes; requires extracted files. |
| Library/Homebrew/cmd/update-report.rb | Removes inline Reporter/ReporterHub; requires extracted files. |
| Library/Homebrew/cmd/update_report/reporter.rb | Extracts Reporter into its own file. |
| Library/Homebrew/cmd/update_report/reporter_hub.rb | Extracts ReporterHub into its own file. |
| Library/Homebrew/cache_store/cache_store.rb | Extracts CacheStore into its own file. |
| Library/Homebrew/cache_store.rb | Removes inline CacheStore; requires extracted file. |
| Library/Homebrew/brew_irb_helpers/symbol.rb | Extracts Symbol IRB helper methods into its own file. |
| Library/Homebrew/brew_irb_helpers.rb | Removes inline Symbol helper; requires extracted file. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Member
Author
|
Will address Copilot comments in a follow-up PR to avoid any logic changes here. |
- Removes inline `Style/OneClassPerFile` todos by giving each affected top-level class or module its own file. - Keeps existing entry-point `require`s so callers retain stable load paths while RuboCop can enforce the style. - Updates `Style/Documentation.Include` for split public API files so the generated CI check remains in sync.
7981640 to
1086345
Compare
daeho-ro
approved these changes
May 10, 2026
bevanjkay
approved these changes
May 10, 2026
ZhongRuoyu
approved these changes
May 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Style/OneClassPerFiletodos by giving each affected top-level class or module its own file.requires so callers retain stable load paths while RuboCop can enforce the style.brew lgtm(style, typechecking and tests) with your changes locally?OpenAI Codex 5.5 xhigh with local review.