2828 Commits

Author SHA1 Message Date
Mike McQuaid
236208ff79
Merge pull request #14756 from apainintheneck/clean-up-extend-os-requires
extend/os: clean up requires
2023-02-23 09:07:59 +00:00
Mike McQuaid
f6d1fa62f1
Merge pull request #14762 from MikeMcQuaid/generate_api
Add generate-{cask,formula}-api commands
2023-02-23 09:02:15 +00:00
Mike McQuaid
9c9213aabd
Apply suggestions from code review
Co-authored-by: Rylan Polster <rslpolster@gmail.com>
Co-authored-by: Bo Anderson <mail@boanderson.me>
2023-02-23 08:45:56 +00:00
apainintheneck
8de625e0e2 extend/os: clean up requires
These need to be after the original module/class definitions
for the monkey-patching to work correctly.
2023-02-22 21:21:24 -08:00
Issy Long
c7b06df72e
dev-cmd/contributions: One --verbose sentence per user is enough 2023-02-22 23:05:02 +00:00
Issy Long
28a2a6ea43
utils/github: Add date filtering to the commit author API query
- I missed this off the original implementation - oops. This gives parity with
  the `git log` implementation.
2023-02-22 23:01:38 +00:00
Issy Long
1b3fa0bef7
Merge pull request #14768 from issyl0/contributions-fix-trailers-args
dev-cmd/contributions: Correctly order the trailers method args
2023-02-22 17:41:23 +00:00
Issy Long
0d345c4257
dev-cmd/contributions: Correctly order the trailers method args
- Was this a bad merge conflict resolution, or me not paying enough
  attention another time?
2023-02-22 17:24:13 +00:00
Issy Long
3d3369c542
dev-cmd/contributions.rb: odie
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2023-02-22 17:02:22 +00:00
Issy Long
d40bd0ae3e
dev-cmd/contributions: Fix single-user handling; be more verbose
- `brew contributions --user=issyl0` was taking forever because it went
  through all maintainers first, because the conditionals were in the
  wrong order.
- This was too quiet, far too quiet, for something that takes so long.
- Now verbose mode tells you what repos it's scanning for a user.
2023-02-22 16:48:31 +00:00
Issy Long
214110f665
dev-cmd/contributions: Stats for all maintainers
- With `brew contributions`, this will output a list of stats
  (across the specified time period, or all time) for people in the
  "maintainers" team on GitHub.
- Add a `--user` flag for getting stats for a specific user (either
  username, name or email address).
- This assumes that their Git committer details are the same as their name is
  set to on GitHub.
- Show an error message if trying to generate a CSV for the full maintainer
  list, since I haven't worked out how to best show all of that info yet (or
  even how best to show only the totals across everything for every user) in
  that format.
2023-02-22 16:05:58 +00:00
Mike McQuaid
8d02143c2b
Add generate-{cask,formula}-api commands
These replace the similar scripts in formulae.brew.sh.

Part of #14730.
2023-02-22 15:33:16 +00:00
Issy Long
93ce211ebd
Merge pull request #14737 from issyl0/api-commits-for-person
dev-cmd/contributions: Use GitHub APIs for commit author info
2023-02-22 14:12:16 +00:00
Markus Reiter
fbf85b7530
Ignore discontinued casks in bump-unversioned-casks. 2023-02-21 12:43:09 +01:00
Issy Long
0a6c59c0b3
dev-cmd/contributions: Less disgusting way to determine brew's NWO 2023-02-21 00:51:32 +00:00
Issy Long
298bb65dfb
rubocop: Entirely disable Metrics cops
- These are arbitrary length limits that had a load of disables in code.
- The limits were only increasing over time rather than decreasing.
- Fixing the problematic code to be shorter would take a long time for
  questionable gain since the problem has been around so long.
2023-02-21 00:34:17 +00:00
Issy Long
d3827b12f2
dev-cmd/contributions: Use GitHub APIs for commit author info
- Using `git log` was brittle with name changes and email address changes for
  contributors over the years unless we made a Git `mailmap` file which brings
  with it its own updatedness overhead.
- Let's use the GitHub commits API (importantly _not_ the search API) so that
  we can give it a username and it will return contributions associated with
  every email address on that user's account:
  https://docs.github.com/en/rest/commits/commits?apiVersion=2022-11-28#list-commits--parameters.
- This is quite significantly slower, but it's worth it for correctness
  especially when we get to all maintainers' contributions (in a separate PR).
- The commits API does not (yet?) support trailers or commit "committer"s, just
  authors.
2023-02-20 23:24:54 +00:00
Mike McQuaid
37b4780037
dev-cmd/contributions: fix spacing.
Otherwise this fails the documentation lint.
2023-02-20 16:16:08 +00:00
Mike McQuaid
315e10cbc4
Merge pull request #14712 from issyl0/contributions-primary-repos
dev-cmd/contributions: Add `--repositories=primary` to scan only `brew,core,cask`
2023-02-20 09:53:50 +00:00
Issy Long
04e476eb84
dev-cmd/contributions: Add --repositories=brew,core,cask shorthand
- For annual "has this person contributed enough", we focus on the main
  Homebrew repos: brew, core and cask. Let's make that easier than
  `--repositories=brew,core,cask`.
2023-02-19 18:36:13 +00:00
Issy Long
f8654bd363
rubocop: In-line disables of Metrics/{Module,Block,Class}Length
- We're not going to make the really long things be any shorter any time soon.
- The instructions in issue 14685 say, pragmatically, "disable all the rubocop
  rules we're never going to realistically fix e.g. Metrics/ClassLength". But
  that felt like a slippery slope to more _really_ long modules/classes/blocks,
  and the limits are here for a reason.
2023-02-19 16:33:23 +00:00
Mike McQuaid
80232af31d
More tweaks to testing output and speed
- Never bother to do `brew cleanup` after `brew install`
- Skip `brew test-bot --only-cleanup-before` in more places it's not
  needed
- Move `brew config`/`brew doctor` into the default formula run
  (through `brew test-bot --only-setup`)
- Install `buildpulse-test-reporter` rather than letting `brew tests`
  do it
- Improve the formatting of the `brew tests` step
- Further shorten the code coverage filenames
- Don't output BuildPulse results upload status unless failed
2023-02-17 16:17:45 +00:00
Mike McQuaid
a743e9277f
workflows/tests: faster, more reliable tests.
- Extract update tests into separate tests.
- Make `brew tests --online` run only once in its own job. This job
  could be made non-required to fight flakiness.
- Split up the various macOS runs into several steps now that we have
  more parallel macOS workers available.
- Cleanup some flaky tests.
2023-02-17 15:26:18 +00:00
Kevin
8ff2e29aad
Merge pull request #14652 from apainintheneck/improve-prof-errors
cmd/prof: improve error messages
2023-02-16 22:39:05 -08:00
apainintheneck
d216b3355d cmd/prof: improve error messages
- Provide an error message when the command is unknown.
- Suggest running the command again with `--` if there
  is an invalid option which might have been meant for
  a subcommand.
2023-02-16 18:51:08 -08:00
Issy Long
43a88cbd97
dev-cmd/contributions: Appease RuboCop 2023-02-15 14:04:05 +00:00
Issy Long
44edad85bc
dev-cmd/contributions: Add a grand total row to the CSV
```
$ brew contributions issyl0 --csv
The user issyl0 has made 1203 contributions in all time.
user,repo,commits,coauthorships,signoffs,total
issyl0,brew,333,13,0,346
issyl0,core,473,24,326,823
issyl0,cask,4,0,0,4
issyl0,aliases,0,0,0,0
issyl0,autoupdate,1,0,0,1
issyl0,bundle,14,2,0,16
issyl0,command-not-found,1,0,0,1
issyl0,test-bot,3,0,0,3
issyl0,services,9,0,0,9
issyl0,cask-drivers,0,0,0,0
issyl0,cask-fonts,0,0,0,0
issyl0,cask-versions,0,0,0,0
issyl0,*,*,*,*,1203
```
2023-02-15 14:00:05 +00:00
Issy Long
9aad9d011b
dev-cmd/contributions: Add a per-repo total column to the CSV
```
$ brew contributions issyl0 --csv
The user issyl0 has made 1202 contributions in all time.
user,repo,commits,coauthorships,signoffs,total
issyl0,brew,332,13,0,345
issyl0,core,473,24,326,823
issyl0,cask,4,0,0,4
issyl0,aliases,0,0,0,0
issyl0,autoupdate,1,0,0,1
issyl0,bundle,14,2,0,16
issyl0,command-not-found,1,0,0,1
issyl0,test-bot,3,0,0,3
issyl0,services,9,0,0,9
issyl0,cask-drivers,0,0,0,0
issyl0,cask-fonts,0,0,0,0
issyl0,cask-versions,0,0,0,0
```
2023-02-15 13:58:49 +00:00
Issy Long
2719c345ab
dev-cmd/contributions: CSV output of queried repos; shorter sentence
- This gives users of this command a `--csv` option to pass to... you guessed
  it, generate a CSV that's `pbcopy`able elsewhere, for more granular
  breakdowns of where a person contributed.
- Inspiration was taken from the mockup in
  https://github.com/Homebrew/brew/issues/13642#issuecomment-1254535251
  but without the extra dependency of the TerminalTable gem.
- Always print a condensed "total contributions" sentence.

Output:

```
$ brew contributions issyl0
The user issyl0 has made 1201 contributions in all time.

$ brew contributions issyl0 --csv
user,repo,commits,coauthorships,signoffs
issyl0,brew,331,13,0
issyl0,core,473,24,326
issyl0,cask,4,0,0
issyl0,aliases,0,0,0
issyl0,autoupdate,1,0,0
issyl0,bundle,14,2,0
issyl0,command-not-found,1,0,0
issyl0,test-bot,3,0,0
issyl0,services,9,0,0
issyl0,cask-drivers,0,0,0
issyl0,cask-fonts,0,0,0
issyl0,cask-versions,0,0,0
```
2023-02-15 12:47:10 +00:00
Sanjito Kurniawan
2daae5e84d
edit: add HOMEBREW_NO_INSTALL_FROM_API warning. 2023-02-14 12:04:10 +00:00
Issy Long
990170927a
Merge pull request #14597 from issyl0/contributions-add-signoffs
dev-cmd/contributions: Count commit signoffs, too
2023-02-14 11:37:08 +00:00
Issy Long
abe23fb249
dev-cmd/contributions: Add up different contribution types for a total
❯ brew contributions mikemcquaid
mikemcquaid directly authored 23766 commits, co-authored 241 commits, and signed-off 6730 commits across all Homebrew repos in all time. Total: 30737.
2023-02-14 10:51:13 +00:00
Mike McQuaid
f4f22bc937
Merge pull request #14601 from apainintheneck/stop-double-warning-in-edit
cmd/edit: stop double warning
2023-02-12 12:01:06 +00:00
Markus Reiter
8c8065746b
Fix duration calculation. 2023-02-12 01:40:19 +01:00
Issy Long
14f9a2424d
dev-cmd/contributions: Count commit signoffs, too
- `BrewTestBot` adds `Signed-off-by` for who approved PRs (1cf53b4281/Library/Homebrew/dev-cmd/pr-pull.rb (L91-L93)).
- Let's count these too, at least until we can get PR approvals from the GitHub API.
2023-02-11 12:01:12 +00:00
apainintheneck
a7dbd738dd cmd/edit: stop double warning
When you don't have EDITOR or HOMEBREW_EDITOR
configured `brew edit` printed a double warning.

This silences the first of those.
2023-02-11 00:16:11 -08:00
EricFromCanada
dfc9906184
internal messaging fixes 2023-02-10 23:17:16 -05:00
Mike McQuaid
30b2a546e5
Revert "move dev-cmd/bottle methods to extend/os" 2023-02-10 17:01:22 +00:00
Carlo Cabrera
2a3b4e4cfd
dev-cmd/cat: accept multiple formula/cask arguments
"cat" is short for "concatenate" (and not "dump to stdout"), so it seems
a little silly for `brew cat` to not be able to concatenate
formulae/casks.

Let's fix that.
2023-02-10 22:07:10 +08:00
Markus Reiter
c735c63122
Ignore livecheckable casks in bump-unversioned-casks. 2023-02-09 16:06:53 +01:00
hyuraku
8eb59869dd rename the method which returns git tags 2023-02-09 23:06:52 +09:00
hyuraku
5fd5d391fd apply extend/os to dev-cmd/update-test 2023-02-09 22:06:26 +09:00
Mike McQuaid
cb1872e5bf
Merge pull request #14553 from MikeMcQuaid/4.0.0-changes 2023-02-08 11:05:08 +00:00
Mike McQuaid
342d40e88d
Merge pull request #14510 from reitermarkus/audit-only-except
Pass `only` and `except` to cask audits.
2023-02-08 09:05:00 +01:00
Markus Reiter
b821a00bc5
Pass only and except to cask audits. 2023-02-08 08:38:32 +01:00
Mike McQuaid
6b4363092d
Revert "Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove"
This reverts commit 932d2cf3b77c9439a57b6a43577fc8d3b6399a62, reversing
changes made to f4e60482791d2ff628efadfdbf0d14d9237d2d29.
2023-02-07 19:25:51 +01:00
Mike McQuaid
2a5d41d41b
Revert "Merge pull request #14547 from Homebrew/revert-14412-homebrew_install_from_api_default"
This reverts commit f4e60482791d2ff628efadfdbf0d14d9237d2d29, reversing
changes made to e26784f424061ca16987afcb21e036c66a298492.
2023-02-07 19:25:40 +01:00
Mike McQuaid
932d2cf3b7
Merge pull request #14548 from Homebrew/revert-14382-deprecate-disable-remove
Revert "Add deprecations and disables"
2023-02-07 19:11:26 +01:00
Mike McQuaid
f4e6048279
Merge pull request #14547 from Homebrew/revert-14412-homebrew_install_from_api_default
Revert "HOMEBREW_INSTALL_FROM_API: make the default for everyone."
2023-02-07 19:11:14 +01:00
hyuraku
ddf4d6af79 repair style 2023-02-07 23:53:09 +09:00