58 Commits

Author SHA1 Message Date
Chris Wegrzyn
84bbaf9d29
Replace unless with if
Co-authored-by: Mike McQuaid <mike@mikemcquaid.com>
2021-05-04 11:30:14 -04:00
Chris Wegrzyn
87cd97a52e Don't use --first-parent on core tap 2021-05-04 09:45:31 -04:00
Chris Wegrzyn
9ab44b8b6a bottle: just check origin/HEAD for rebuild 2021-05-03 10:07:30 -04:00
Chris Wegrzyn
056c9bb37f Only consider latest rebuild 2021-05-03 10:07:29 -04:00
Bo Anderson
ac87404c34
formula_versions: try to ignore errors on formula load 2021-04-14 12:37:25 +01:00
EricFromCanada
a6643b4adf fix odebug calls 2021-01-26 12:02:30 -05:00
Markus Reiter
24ae318a3d Move type annotations into files. 2020-10-10 14:59:39 +02:00
Markus Reiter
3851087d01 Document FormulaVersions. 2020-08-26 03:13:58 +02:00
Alexander Bayandin
b43f17b2d0 formula_versions: handle references to too old MacOS in formulae 2020-08-19 09:25:32 +01:00
Markus Reiter
490e503b1b Replace Homebrew.args with Context. 2020-08-06 16:13:14 +02:00
Mike McQuaid
2a94d382ac
audit: make audit_revision_and_version_scheme faster.
This is really, really slow at the moment for a few reasons:
- it goes through the list of revisions twice
- it checks many more revisions than it needs to

Even after these improvements it's still by far the slowest audit so
am also making it a `--git` only audit.

Additionally, to further improve default `brew audit` performance do not
run `brew style` checks when doing `brew audit` with no arguments.

`brew style` can be run quickly and efficiently on all of a tap (and is
cached) so no need to duplicate it here.
2020-06-08 15:00:09 +01:00
Mike McQuaid
bc27e38f18
Remove ARGV.debug?
Replace with `Homebrew.args.debug?`.

Part of #5730.
2020-05-23 14:38:58 +01:00
EricFromCanada
9bfd597991 Format debug messages with odebug 2019-12-02 11:33:19 -05: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
e9b9ea49a1 Update to RuboCop 0.59.1. 2018-09-17 03:45:59 +02:00
Mike McQuaid
e03f07f302 Rubocop 0.53.0 automatic fixes. 2018-03-08 14:10:02 +00:00
Markus Reiter
175ca909ee Clean up code style and remove .rubocop_todo.yml. 2017-10-08 16:10:37 +02:00
Markus Reiter
8ffc77d8e8 Refactor formula_at_revision. 2017-06-04 10:24:16 +02:00
Markus Reiter
f4bacb4444 Fix previous_version_and_checksum method. 2017-05-23 14:11:34 +02:00
Markus Reiter
330307b01a Use FormulaVersions for checksum check. 2017-05-22 02:01:57 +02:00
Mike McQuaid
5647fdb2f9 audit: fix audit of new formulae.
When auditing new formulae without `--new-formula` the
`audit_revision_and_version_scheme` method fails ungracefully. Instead,
set some better defaults so fewer checks are needed.

Fixes #2551.
2017-04-26 11:33:13 +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
e793e52661 Revert "formula_versions: handle uncommitted formulae." 2017-02-22 08:49:49 +00:00
Mike McQuaid
35ae78f43d formula_versions: handle uncommitted formulae.
Otherwise an uncommitted formula can trigger an invalid `brew audit`
result.

Fixes #1731.
2016-12-30 18:43:50 +00:00
JCount
cfdbe9c645 formula_versions: fix erroneous :stable in version_attributes_map 2016-11-13 22:27:45 -05:00
Mike McQuaid
c78aa43386 audit: fix "version should not decrease" check.
Fix the "version should not decrease" check so it correctly handles
`version_scheme`s.

Fixes #1489.
2016-11-13 13:35:25 +00:00
Markus Reiter
b306f14b97 Rename FormulaMethodDeprecatedError to MethodDeprecatedError. 2016-10-08 13:26:10 +02:00
Markus Reiter
fe2d51e0b9 Fix Style/IfUnlessModifier. 2016-09-23 15:30:07 +02:00
Mike McQuaid
6693915399 rubocop --auto-correct all remaining files.
But remove some manual `.freeze`s on constants that shouldn't be
constants.
2016-09-17 16:14:13 +01:00
Mike McQuaid
27ecf588c7 Rename bottle's revision to rebuild. 2016-08-18 17:32:35 +01:00
Mike McQuaid
55ba22e296 formula_versions: add version_attributes_map.
This allows querying multiple attributes in the same way as
`revision_map` did but without duplicating code or repeatedly traversing
history.
2016-08-18 15:04:51 +01:00
Mike McQuaid
e0c8c00e87 formula_versions: set/unset raise_deprecation_exceptions. 2016-08-12 21:07:03 +01:00
Mike McQuaid
0a20ceddcc Revert "formula_versions: also silence stderr." 2016-08-11 17:07:31 +01:00
Mike McQuaid
0b8eab8dac formula_versions: also silence stderr.
We already stop old formula versions printing stdout but this also stops
them printing on stderr for e.g. old deprecation warnings.
2016-08-11 14:08:37 +01:00
ilovezfs
19a77c816e formula_versions: ignore FormulaMethodDeprecatedError
old formula revisions have deprecated elements such as sha1 checksums

Closes #605.

Signed-off-by: ilovezfs <ilovezfs@icloud.com>
2016-07-29 23:12:13 -07:00
Xu Cheng
80efb92c35 FormulaVersion: support max depth 2016-01-17 14:52:14 +08:00
Dominyk Tiller
5bc1e0b83a formula_versions: include devel in revision map 2016-01-14 17:53:08 +00:00
Xu Cheng
31da9b266a audit: enforce revision check
Add two checks:
* revision should be reset to 0 for new version.
* revision should not decrease inside the same version interval.

Closes Homebrew/homebrew#48032.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-14 15:26:21 +08:00
Xu Cheng
c796198398 formula_versions: tap is a Tap object now 2015-12-09 16:56:59 +08:00
Xu Cheng
11f0979dfb FormulaVersions: load from contents to reduce io 2015-09-06 20:47:04 +08:00
BrewTestBot
13d544e11e Core files style updates.
Closes Homebrew/homebrew#42354.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-03 13:22:35 +01:00
Jack Nagel
45a71898e8 Isolate formula class namespaces
Closes Homebrew/homebrew#40151.
Closes Homebrew/homebrew#40203.
2015-06-01 19:24:47 -04:00
Jack Nagel
0fc906b03d Remove another unused default argument 2015-05-29 00:23:06 -04:00
Jack Nagel
f80748096d Remove unused default argument 2015-05-29 00:16:51 -04:00
Jack Nagel
7de2d56f52 Simplify versions code 2015-04-01 21:15:18 -04:00
Jack Nagel
f51439329b Remove dead code 2015-04-01 21:15:18 -04:00
Xu Cheng
11defcf847 formula_versions: use Utils.popen_read instead of backticks
Closes Homebrew/homebrew#37446.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-03-07 12:03:27 +08:00
Jack Nagel
af1e9a9610 Expose bottle details on the formula object
Fixes Homebrew/homebrew#36032.
2015-01-20 22:27:23 -05:00
Jack Nagel
683e209b10 Remove unused argument 2015-01-04 14:29:00 -05:00