83 Commits

Author SHA1 Message Date
Mike McQuaid
606790d062 audit: check for version aliases.
Current version aliases should be provided for versioned formulae so
people can `brew install foo@1.2` to provide pin-like behaviour.
2017-02-21 15:36:49 +00:00
ilovezfs
c667a43b97 audit: fix insecure mirror check when stdout is empty 2017-02-20 07:51:04 -08:00
Mike McQuaid
d24ac0555c Merge pull request #1722 from broder/insecure_audit
Added check for insecure mirror URLs
2017-02-20 11:26:41 +00:00
Mike McQuaid
b2dd6bc9b0 audit: fix brew style warning. 2017-02-15 14:41:06 +00:00
Viktor Szakats
64448834a6 fix existing rule for github.io homepages 2017-02-13 16:20:34 +00:00
Viktor Szakats
a09169f248 audit: enforce https for *.sourceforge.io urls 2017-02-13 14:58:28 +00:00
Alyssa Ross
9e97eadccb rubocop: trailing comma in multiline method calls
Discussed in
https://github.com/Homebrew/brew/pull/1987/files#r100693581.

This was originally ommitted because it wasn't compatible with Ruby 1.8.
(See https://github.com/Homebrew/legacy-homebrew/pull/48144#r49928971).
2017-02-12 15:11:38 +00:00
Mike McQuaid
674e5f13f8 Merge pull request #1873 from GauthamGoli/audit_custom_cops
Custom Cops for `brew audit`
2017-02-12 13:09:28 +00:00
Markus Reiter
1292a4b219 Merge pull request #1955 from vszakats/patch-2
audit: enforce https://*.sourceforge.io/ homepages
2017-02-12 11:05:21 +01:00
Viktor Szakats
03253a8d8b audit: enforce https://*.sourceforge.io/ homepages
Ref: https://sourceforge.net/blog/introducing-https-for-project-websites/
2017-02-10 14:53:32 +00:00
Viktor Szakats
11ebfdafb2 audit: enforce https for github.com urls 2017-02-07 00:19:58 +00:00
Gautham Goli
1f5cf4fd40 Update docs and manpages to include --fix option 2017-02-06 12:46:26 +05:30
David Broder-Rodgers
64c83f3286 Use file checksum rather than file diffing 2017-02-02 21:25:29 +00:00
David Broder-Rodgers
d4aa98d230 Updated mirror checks to compare ETags, Content-Lengths and binary files 2017-01-30 21:49:42 +00:00
David Broder-Rodgers
13a3a57fa8 Merge remote-tracking branch 'origin/master' into insecure_audit 2017-01-30 18:31:52 +00:00
Mike McQuaid
34e03532a0 audit: improve homepage audit reliability.
Try first with an (exact, actual) browser user agent from Safari and
then try again with the default Homebrew `curl` user agent.
2017-01-26 16:19:38 +00:00
ilovezfs
cebe137499 audit: exempt wine's deps from the universal deprecation
This can be reverted when wine's dependencies are all vendored.
2017-01-20 07:18:51 -08:00
Gautham Goli
0b3d9031e2 Add --fix option to brew audit command 2017-01-18 22:35:37 +05:30
Mike McQuaid
4f0505f759 audit: only warn on versioned conflicts_with.
Rather than all versioned formulae regardless. Oops.
2017-01-17 19:09:41 +00:00
Mike McQuaid
dac66c4ada Add keg_only :versioned_formula.
This is used to indicate a formula is a version of another formula.
This will be used to provide a consistent interface for older formulae
versions and replaces the use of `conflicts_with`.
2017-01-17 10:50:04 +00:00
Mike McQuaid
aa104137e5 Merge pull request #1844 from MikeMcQuaid/audit-universal
audit: don't allow universal for new formulae.
2017-01-17 10:08:44 +00:00
Mike McQuaid
f4496e85e5 audit: don't allow universal for new formulae.
We're frowning on these now so may as well turn that into code.
2017-01-15 02:31:11 -08:00
ilovezfs
9dca10f9dc audit: whitelist unstable versions already in core
also allow higher stable versions with the same version prefix
2017-01-13 18:59:23 -08:00
Mike McQuaid
346d68eb04 audit: check virtualenv and setuptools resource.
`virtualenv_install_with_resources` will automatically define and
install a `setuptools` resource so this is unnecessary.

References https://github.com/Homebrew/homebrew-core/pull/8570
2017-01-09 13:24:51 +00:00
Mike McQuaid
e7a81caaf4 Allow brew audit to fake a Safari user-agent.
This allows us to detect if homepages such as e.g. `aiccu` which
blocks `curl` are up or not.
2017-01-07 14:03:08 +00:00
Mike McQuaid
d7ab913f31 audit: deprecate env :std/:userpaths for strict.
This should apply only for new formulae but we should start gradually
phasing it out for older ones too.
2017-01-03 22:12:21 +00:00
Mike McQuaid
b3c6334d3c audit: use new curl_args form.
This will use Curl’s default user agent to reduce homepage errors and
provides a function that can be used for other audits to perform
similar tests on URLs.
2016-12-30 20:17:34 +00:00
Mike McQuaid
59180ec370 audit: improve reliability of homepage audit.
- Don't run on Yosemite where the system Curl is too old for some modern
  HTTPS homepages
- Try up to 3 times in case of transient failures.
2016-12-29 12:51:12 +00:00
Mike McQuaid
8ffe231f44 audit: don't allow openssl & libressl dependency.
Formulae should not depend on both OpenSSL and LibreSSL (even
optionally). This is to avoid descending into madness where every
formulae that could use LibreSSL has to have option and switching logic.

Homebrew has standardised on OpenSSL and will do so everywhere that
LibreSSL is not a hard requirement.
2016-12-29 11:46:51 +00:00
Mike McQuaid
cd13e306a8 Merge pull request #1693 from broder/homepage_check
Updated homepage 404 check to use explicit parameters and return the …
2016-12-23 19:14:08 +00:00
David Broder-Rodgers
3c566399cf Added check for insecure mirror URLs 2016-12-23 14:55:08 +00:00
Mike McQuaid
8f85eb64c4 audit: fix 32-bit check. 2016-12-20 14:26:53 +00:00
Mike McQuaid
ef6b55125c Merge pull request #1695 from MikeMcQuaid/audit-revision-map-nil
audit: handle a nil revision map.
2016-12-20 10:55:41 +00:00
Mike McQuaid
1d2390b2de Merge pull request #1698 from MikeMcQuaid/deprecate-32-bit
Deprecate 32-bit options.
2016-12-20 10:54:54 +00:00
Mike McQuaid
f98304026b Deprecate 32-bit options.
These were formerly supported but as it has been a very long time since
32-bit software was necessary on macOS these have been deprecated with
a `brew audit` warning and a future `odeprecated`.
2016-12-20 10:22:30 +00:00
David Broder-Rodgers
637aae48e4 Markups 2016-12-19 08:45:21 +00:00
Mike McQuaid
41a248786f audit: handle a nil revision map. 2016-12-18 15:46:02 -08:00
Mike McQuaid
339ff9400f audit: don't allow use of OS.mac?/OS.linux?.
Forbid their use in Homebrew/core which only supports macOS. This may
be added to more/all official taps in future.
2016-12-18 15:30:06 -08:00
David Broder-Rodgers
0a007fc983 Updated homepage 404 check to use explicit parameters and return the status code 2016-12-18 22:37:26 +00:00
Mike McQuaid
cf1fa0c5bc audit: flag use of "fails_with :llvm".
Also, add TODOs for deprecating this properly at a later point.
2016-12-13 02:10:11 +00:00
Mike McQuaid
1980af52de audit: allow deprecated options on new @ formulae.
As these may be migrations from another tap where we want to migrate
options across correctly.
2016-11-23 11:03:10 +00:00
William Woodruff
4a9601ab82
audit: check formula name against blacklisted names. 2016-11-20 00:40:54 -05:00
Mike McQuaid
5e073f1f40 Merge pull request #1528 from MikeMcQuaid/audit-devel-revision
audit: don't check devel version_scheme/revision.
2016-11-18 13:53:22 +00:00
Mike McQuaid
e4fb108079 audit: check for HOMEBREW_PREFIX test path usage.
This is also not allowed.

As seen in https://github.com/Homebrew/homebrew-core/pull/6996.
2016-11-18 09:02:39 +00:00
Mike McQuaid
b7f0edd1fd audit: don't check devel version_scheme/revision.
These are formulae-wide so doesn't make sense to iterate through these
for specs and get weird results.

As seem in https://github.com/Homebrew/homebrew-core/pull/6952.
2016-11-17 17:13:52 +00:00
Markus Reiter
e3be9c068b Update .rubocop_todo.yml. 2016-11-16 23:52:37 +01:00
Mike McQuaid
edf042ee97 Merge pull request #1522 from MikeMcQuaid/audit-one-previous-commit
audit: only check previous formula version.
2016-11-16 10:25:11 +00:00
Mike McQuaid
31caa8ef93 audit: only check previous formula version.
For calculating the stable/devel versions this should be sufficient as
it's looking at `origin/master` so for a e.g. unmerged pull request this
will stop complaining about mistakes outside the pull request itself.

This will silence all warnings for historic version mistakes (i.e.
before these audit checks were all enabled) which is normally a bad
thing but as this case would rely on modifying history to complete is a
good one.
2016-11-16 09:03:20 +00:00
Mike McQuaid
27ea94adb8 audit: check that there are any stable revisions.
Fixes the exception if `revision_map[formula.stable.version]` is `nil`.
2016-11-16 08:59:52 +00:00
Mike McQuaid
5e0b3d24e5 audit: fix "version should not decrease" (again).
- output the max version and current version to make the message more
  obvious.
- Don't compare the development spec version to the formula version and
  then complain the formula version is lower (it should always be!)
2016-11-15 09:02:50 +00:00