30 Commits
Author SHA1 Message Date
Issy Long 6b76fd012a Fix (auto-correct) RuboCop RSpec/BeNil offenses 2022-03-01 00:10:10 +00:00
Mike McQuaid 41e94afda5 Fix brew style
Fixes for https://github.com/Homebrew/brew/pull/12152.

Extracted into a separate PR so this can be merged immediately.
2021-09-30 10:13:53 +01:00
nandahkrishna 53a7065bcc Allow specifying committer for some dev-cmds 2021-04-01 22:22:31 +05:30
Rylan Polster af40e072b0 style: remove RSpec/NamedSubject violations 2021-02-01 20:30:51 -05:00
Markus Reiter 24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Mike McQuaid aa81982aba brew style --fix 2020-06-02 09:49:23 +01:00
Mike McQuaid 36dbad3922 Add frozen_string_literal to all files. 2019-04-20 13:27:36 +09:00
Mike McQuaid 737b84b54b brew style --fix fixes. 2018-11-02 17:29:23 +00:00
Markus Reiter 7a991985a4 Run tests with HOMEBREW_DEVELOPER unset. 2018-09-19 19:43:45 +02:00
Mike McQuaid bcb1ec5499 Improve Homebrew/brew line length.
Use 124 max line length everywhere. Also, reduce tap max line length to
189 as Homebrew/homebrew-core has that as a maximum now. In future
Homebrew/homebrew-core will also be reduced to 124 maximum line length.
2018-09-02 16:15:09 +01:00
Markus Reiter e6b45842e8 Refactor odeprecated. 2018-08-15 12:16:02 +02:00
Markus Reiter 7762ce32aa Use more descriptive heredoc names. 2018-07-11 18:15:30 +02:00
Andrew Janke e0a8a79921 Style fixes for Rubocop 0.57.1 2018-06-30 19:40:14 -04:00
Markus Reiter 04cb105e46 Unset HOMEBREW_NO_EMOJI for all tests. 2018-06-07 18:42:30 +02:00
Mike McQuaid 9fca172d03 Fix HOMEBREW_RUBY_WARNINGS="-w"
Fix various circular requirements, method redefinitions, etc.
2018-04-07 20:28:56 +01:00
Mike McQuaid 5e1806e796 test: rubocop-rspec style auto-corrects.
There’s too many warnings to start enabling `rubocop-rspec` by default
but let’s at least apply the cleanups it does automatically.
2018-03-25 13:30:37 +01:00
Mike McQuaid ca189437e4 Tweak use of with_env
- Use it in more places where it saves code
- Allow using symbolic keys for a cleaner interface
- Use `HOMEBREW_GEM_*` instead of `GEM_OLD_*`
2017-10-29 14:44:43 +00:00
Markus Reiter 9bee9ca575 Use “squiggly” heredocs. 2017-10-18 14:39:09 +02:00
Dan Wendorf acf1b278ae List cask full-names
`brew cask list` supports the `--full-name` flag which will include the tap
name for casks not part of the core caskroom/cask tap. For example, if
cask "foo-beta" is installed from the caskroom/versions cask, `brew cask
list --full-name` will report the name as "caskroom/versions/foo-beta".
2017-09-16 10:00:06 -07:00
Misty De Meo 30adcab6cf Add with_env helper to set temporary ENV vars 2017-07-15 17:39:55 -07:00
adrianandadrian de78999def don't try to find the full path of the editor in 'brew edit'
fixes #2709
2017-06-01 17:45:07 -07:00
Mike McQuaid 6b0afa3e9c Remove puts_hash, require pp
I wasn’t aware this existed when I created puts_hash so: may as well
remove it.
2017-04-24 11:45:32 +01:00
Mike McQuaid 3e40059f8d utils: make which_editor handle editor args.
Handle cases like e.g. `EDITOR="subl -w"`.
2017-04-24 08:49:11 +01:00
Mike McQuaid d5155256ce Fix audit version_scheme and revision checks.
Another attempt at fixing `brew audit` issues around detecting
`revision` and `version_scheme` changes correctly. First done in #1754
and #2086 (reverted in #2099 and #2100).

To ease future debugging a `ph` helper has been added to print a hash
and a series of RSpec tests to verify that the `revision`,
`version_scheme` and `version` formula version audits behave as
expected.

Fixes #1731.
2017-04-23 18:56:22 +01:00
Mike McQuaid 69c7a20896 Fix brew edit with environment filtering.
For many people `brew edit` makes use of the `EDITOR` variable to pick a
sensible editor. With environment filtering enabled unless this editor
is found in the default system PATH it'll fall back to e.g. `vim`.

Instead, ensure that we export the original, pre-filtering `PATH` as
`HOMEBREW_PATH` and use that internally to locate the editor. In future
this same approach will likely be used for requirements to be able to
find tools, too, and for other variables which we want to expose to
Homebrew itself but not other build tools.

Note that `HOMEBREW_PATH` is the same as `PATH` when build filtering
hasn't been enabled.
2017-04-21 18:26:12 +01:00
Markus Reiter 44d367edca Deprecate #plural. 2017-03-11 21:16:37 +01:00
Markus Reiter a554902380 Add mktmpdir helper method. 2017-02-28 15:06:32 +01:00
Jeppe Toustrup ebaf3cdc6a Add 'B' for bytes to cleanup command output
When `brew cleanup` is run it prints out a message like the following:

> This operation has freed approximately 222M of disk space.

The '222M' refers to megabytes but the normal acronym for megabytes would be
'MB'. The 'B' is also missing from kilobytes and gigabytes in the output, so
that's what this commit adds.
2017-02-25 11:30:46 +00:00
Markus Reiter 44d2617030 Handle Homebrew.failed in spec_helper. 2017-02-19 18:41:53 +01:00
Markus Reiter 05a98f24c4 Convert Utils test to spec. 2017-02-19 18:41:53 +01:00