42 Commits

Author SHA1 Message Date
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
Mike McQuaid
1e96c6fec4 formula_versions: ignore another exception. 2015-01-02 10:34:36 +00:00
Jack Nagel
195cac8c91 Rescue ErrorDuringExecution when loading old formulae 2014-11-28 16:37:37 -05:00
Jack Nagel
6a0720071e Use Formula tap methods 2014-07-06 13:16:57 -05:00
Jack Nagel
2d8a3ac35a Use popen wrapper
Closes Homebrew/homebrew#30678.
2014-07-05 15:41:22 -05:00
Jack Nagel
4d9d01893e Move deprecated Formula class methods to compat
These have all been moved to Formulary.
2014-06-22 15:03:17 -05:00
Jack Nagel
83b9043c8e Remove more unused requires 2014-06-19 19:15:35 -05:00
Jack Nagel
9e57da83a2 Stop exposing mktemp as a public method on formula objects 2014-06-09 21:36:36 -05:00
Jack Nagel
56b041ca25 Extract history introspection from "versions" command 2014-05-28 16:23:33 -05:00