255 Commits

Author SHA1 Message Date
Dawid Dziurla
1e805e04f9
bump-formula-pr: fix when no 'version' stanza in formula found
Without this fix, a command like:

    `brew bump-formula-pr --version=0.3.3 --tag=v0.3.3 --revision=... test-formula-git-revision`

will fail because:

```
Error: no implicit conversion of nil into String
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:281:in `escape'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/dev-cmd/bump-formula-pr.rb:281:in `bump_formula_pr'
/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/brew.rb:111:in `<main>'
```

Additionally, reject all `nil` replacement pairs by calling `compact`
method.
2020-07-26 10:26:39 +02:00
Seeker
e5cc33ae8a bump-formula-pr: cleanup 2020-07-20 08:16:30 -07:00
Seeker
06d9152098 bump-formula-pr: check duplicate PRs as early as possible 2020-07-17 21:33:58 -07:00
Jonathan Chang
9c7f73a4c8
Merge pull request #8011 from SeekingMeaning/bump-duplicate
bump-formula-pr: restore formula if duplicate PR exists
2020-07-16 17:19:13 +10:00
Seeker
79d4b27c86 bump-formula-pr: restore formula if duplicate PR exists 2020-07-15 14:54:39 -07:00
Seeker
3ae2611365 bump-formula-pr: determine url/tag from version 2020-07-15 13:56:07 -07:00
Jonathan Chang
76709d82c5 Fix brew style. 2020-07-13 23:24:14 +10:00
Dustin Rodrigues
f684a59fa5 bump-formula-pr: search for closed dupe PRs 2020-06-27 12:50:43 -04:00
Mike McQuaid
aa81982aba
brew style --fix 2020-06-02 09:49:23 +01:00
Zhiming Wang
83fa24741e
bump-formula-pr: fix forking error when formula is guessed from url
Regression introduced in f90612ccf0db03681dc6cbf6585cca5bc27b84b1 (#6718).

`tap_full_name` returned from `use_correct_linux_tap` has been
required (`GitHub.create_fork(tap_full_name)`), but it was never set when the
formula is guessed from args.url, resulting in an API request to
https://api.github.com/repos//forks which 404s (note the missing :owner/:repo),
and subsequently

    Error: Unable to fork: Not Found!
2020-05-23 14:20:35 +08:00
EricFromCanada
9d6eb41fc5 cmd/dev-cmd: misc. usage and wording fixes 2020-04-19 13:31:54 -04:00
EricFromCanada
634e30994e bump-formula-pr: use Homebrew::EnvConfig 2020-04-07 10:25:43 -04:00
Mike McQuaid
3381cbf5c7
Use Homebrew::EnvConfig. 2020-04-07 09:58:26 +01:00
Dawid Dziurla
e3b472380d
bump-formula-pr: remove trailing '=' from --mirror in help message 2020-03-23 10:59:27 +01:00
Issy Long
202cc04456
Merge pull request #7165 from dawidd6/bump-version-equal
bump-formula-pr: ignore --version argument if equal to detected version
2020-03-15 11:04:52 +00:00
Mike McQuaid
1e265247ca
rubocop: apply autofixes. 2020-03-13 21:16:18 +00:00
Dawid Dziurla
8db863ff7e
bump-formula-pr: ignore --version argument if equal to detected version 2020-03-13 17:09:58 +01:00
Mike McQuaid
e3ac94fc5d
dev-cmd: use more and cleanup new args APIs. 2020-03-05 09:40:15 +00:00
Mike McQuaid
10ba0d5a66
Merge pull request #7092 from dawidd6/bump-push-with-token
bump-formula-pr: return remote url with token in it
2020-03-02 18:42:57 +00:00
Dawid Dziurla
456f3b1923
bump-formula-pr: return remote url with token in it 2020-03-02 18:50:42 +01:00
EricFromCanada
b80af7837a bump-formula-pr: add missing URL escapes 2020-02-28 13:02:55 -05:00
EricFromCanada
6f5cd0e7fe bump-formula-pr: support add multiple mirror URLs with --mirror 2020-02-24 13:07:46 -05:00
EricFromCanada
a24477dad6 bump-formula-pr: fix output when listing guesses 2020-02-24 13:07:46 -05:00
EricFromCanada
7ec2ffda93 bump-formula-pr: warn when removing mirrors 2020-02-24 13:07:46 -05:00
EricFromCanada
0132b905bf bump-formula-pr: automatically mirror Apache & GNU projects 2020-02-24 13:07:46 -05:00
EricFromCanada
50cc9db0f2 bump-formula-pr: also infer mirrors when a checksum is provided 2020-02-24 13:07:46 -05:00
Issy Long
1ab843ba47
bump-formula-pr: Only delete Linux bottle line if it exists
- We have some Linux-only formulae that don't have bottles.
- Previously, bumping a Linux-only formula that didn't have a bottle
  line - eg, `adoptopenjdk` which is `bottle :unneeded` - would fail:

```
Error: inreplace failed
/app/linuxbrew/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/adoptopenjdk.rb:

expected replacement of /^    sha256 ".+" => :x86_64_linux\n/m with "\2"
```
2020-02-14 22:41:31 +00:00
Issy Long
1df8584d13
bump-formula-pr: Determine Linux-only formulae with depends_on :linux
- We used to use `# tag "linux"` in Homebrew/linuxbrew-core for the ~50
  Linux-only formulae. As of
  6578a4aa86,
  we're using `depends_on :linux` to have a consistent syntax between
  Linux and macOS.
- Therefore, we have to change the search string for Linux-only formulae
  that determines whether or not `brew bump-formula-pr` deletes the bottle
  line.
2020-02-13 21:28:12 +00:00
Dawid Dziurla
359dc9674c
bump-formula-pr: delete linux sha256 line if required
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2020-01-18 15:27:40 +01:00
EricFromCanada
aea6d79d21 option parser: check for extra named args 2019-12-15 00:04:45 -05:00
EricFromCanada
2f7c3afeb8 cmd: improve wording of messages, spacing 2019-12-15 00:04:45 -05:00
Gautham Goli
22e25dd593 argv: move formulae to cli/args 2019-12-11 16:36:23 +05:30
Mike McQuaid
40c6fbdccf
bump-formula-pr: tweak fix syntax. 2019-12-07 11:27:27 +00:00
Fred Emmott
3339d5af32
Fix bump-formula-pr on a file with no tap
fixes #6821
2019-12-06 11:10:01 -08:00
Maxim Belkin
5ba5a2795e
Fix signature for forked_repo_info 2019-11-26 12:14:21 -06:00
Maxim Belkin
40b0b32a72
Revert "bump-formula-pr: fix forking logic"
This reverts commit c5da90e0eb2ade879d7e60a0ec6a193aad3f8afb.
2019-11-26 12:10:14 -06:00
Dawid Dziurla
c5da90e0eb
bump-formula-pr: fix forking logic 2019-11-23 14:08:28 +01:00
Maxim Belkin
1a0361a57d
Don't check dry run status where it is not needed 2019-11-21 11:13:10 -06:00
Maxim Belkin
ba7a05a919
bump-formula-pr.rb: Apply suggestions from code review
Co-Authored-By: Mike McQuaid <mike@mikemcquaid.com>
2019-11-21 11:13:10 -06:00
Maxim Belkin
a031fe911e
Switch from formula.tap.full_name to tap_formula_name 2019-11-21 11:13:10 -06:00
Maxim Belkin
845f65b945
Factor out some code into functions 2019-11-21 11:13:10 -06:00
Maxim Belkin
620e96b929
bump-formula-pr: enable same-repo (no-fork) Pull Requests 2019-11-21 11:13:09 -06:00
Issy Long
02524ba322
Remove --local from git config commands as it's the default
- The `--local` option doesn't exist in early versions of git (~1.7),
  but its behaviour is the default (saving in the current repo's .git
  directory).
- As it's the default across versions, we don't need to specify it
  everywhere.
- Reported in Linuxbrew/install issue 78.
2019-11-16 10:19:42 +00:00
Dawid Dziurla
f90612ccf0
bump-formula-pr: make it usable on linux
This commit makes it possible to use `bump-formula-pr` on linux to
contribute to `homebrew-core` as easily as it is on macOS, but with some
additional steps made before actual bumping of the formula.

Differences in the process (before bumping):
- add `homebrew-core` remote named `homebrew`
- fetch `homebrew/master`
- check if formula exists in `homebrew-core`
- switch to `homebrew/master` ref
2019-11-15 13:22:31 +01:00
Issy Long
1f6168fe8a
Change regexp.match?(string) to string.match?(regexp) everywhere
- Only try to call `.match?` on strings that aren't nil.
2019-10-13 23:22:51 +01:00
Issy Long
b78028b9c2
Auto-fix Performance/RegexpMatch offenses 2019-10-13 16:04:26 +01:00
EricFromCanada
8a8359cdd4 manpages: sentence rewording for readability
Use active voice when applicable, better verbs & adjectives, preposition usage, proper tense, etc.
2019-08-20 09:05:45 -04:00
EricFromCanada
6340792f78 manpages: output formatting fixes 2019-08-20 08:28:35 -04:00
EricFromCanada
a3e0647797 manpages: whitespace fixes 2019-08-20 08:24:20 -04:00
DarthSim
ddc032d989 Fix run_audit result in bump-formula-pr 2019-07-18 18:13:00 +06:00