-
-
Notifications
You must be signed in to change notification settings - Fork 10.1k
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
Refactor commands to remove 'require "cmd/*"' #4286
Conversation
BTW, the style failure is this:
Complaining about:
Are we actually requiring longer argument names now? I seem to recall quite a few of these |
Yes, definitely, thanks and great work here!
I think ideally, yeh. Make it |
Cool. I don't remember: do you accept PRs for style-only fixes? I could make a pass of style fixes after doing this refactor; there's a lot of files with style complaints right now. |
Not sure what you mean here, |
I think the problem is that |
Oh, yep, that's what's going on. When you pass a file argument, it pulls in the "audit" rules, regardless of whether that file is a formula or something else. No problem; I can just run plain |
I've updated this PR to include other commands. Combined with #4253, this will cover all the commands that are importing "cmd/*". Then we need to refactor the tests, but I'll leave that for another PR. |
Library/Homebrew/install.rb
Outdated
|
||
def check_writable_install_location | ||
raise "Cannot write to #{HOMEBREW_CELLAR}" if HOMEBREW_CELLAR.exist? && !HOMEBREW_CELLAR.writable_real? | ||
raise "Cannot write to #{HOMEBREW_PREFIX}" unless HOMEBREW_PREFIX.writable_real? || HOMEBREW_PREFIX.to_s == "/usr/local" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you make both the above block if
s (and refactor the unless .. ||
). I know not your code but nice to refactor this so it's not wider than the GitHub diff UI.
Nice! One nit but otherwise 👍 👏. |
Rebase needed for this. |
Amended to rebase and refactor that nit out. (Had to modify the nit code a bit more to satisfy |
Thanks again @apjanke! |
brew style
with your changes locally?brew tests
with your changes locally?This is an attempt to refactor install, upgrade, and help to remove their use of
require "cmd/*"
imports.Fixes #4059.
Does this style of refactoring look good to you folks? If so, I'll do the rest, except for
search
, which is handled in #4253.