407 Commits

Author SHA1 Message Date
Xu Cheng
b52af53e71 various: use Tap abstraction
formula_rename and tap_migrations are now handled inside Tap.

Closes Homebrew/homebrew#49549.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-02-26 17:00:17 +08:00
Mike McQuaid
b06c6c74f9 audit: roughly double notability requirements.
Closes Homebrew/homebrew#48706.
2016-02-11 20:32:22 +00:00
Misty De Meo
7b81066038 Audit: Regexp.escape formula names
We allow certain special regex characters in formula names, and if
those aren't escaped when interpolating them into a regex, they'll be
interpreted as special regex characters.

This can cause regex compile errors on Ruby 1.8 (for example, with
"libxml++3", which has nested match characters), and more subtle
matching bugs in general.

Refs an issue surfaced in Homebrew/homebrew#48744.

Closes Homebrew/homebrew#49005.

Signed-off-by: Misty De Meo <mistydemeo@gmail.com>
2016-02-09 15:33:38 -08:00
Dominyk Tiller
58cf0ec2b9 audit: add check for insecure hackage urls 2016-02-04 14:57:55 +00:00
Baptiste Fontaine
cdd990f9d7 audit: use start_with? to check the name in the desc 2016-02-03 14:04:31 +01:00
Dominyk Tiller
557f6e33a9 audit: check resource placement 2016-01-31 00:39:29 +00:00
Baptiste Fontaine
e1875b7a43 audit: avoid false positive pkgshare problems 2016-01-25 17:19:51 +01:00
Baptiste Fontaine
e0c7b38aa7 audit: warn once about deprecated *Formula classes
GithubGistFormula inherits from ScriptFileFormula so a problem is added
for each one instead of the first only.
2016-01-25 01:26:24 +01:00
Xu Cheng
154d0850e7 audit_revision: only check 10 recent related commits
It helps to reduce overhead.

Closes Homebrew/homebrew#48108.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-17 14:52:15 +08:00
Xu Cheng
d4c7dedf12 audit: imporve revision check logic
* Check revision decrease against both stable and devel spec.
* Check revision reset only for stable spec if stable spec is available.
2016-01-17 14:52:14 +08: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
5f22586389 audit: check url/checksum/mirror outside of stable block
Closes Homebrew/homebrew#48033.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-14 13:35:36 +08:00
Dominyk Tiller
f4f2266923 audit: check for more unused shorthand
Adding a strict check for usage that should be using pkgshare.

Pulled onto two unique checks to provide a better problem message, with a
clearer solution, but open to thoughts.

 * Use pkgshare instead of (share/"example")
 * Use #{pkgshare} instead of #{share}/example

Closes Homebrew/homebrew#47900.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-01-11 09:49:54 +00:00
Xu Cheng
885022a5e3 add Keg#empty_installation?
Avoid using `FormulaAuditor` in `FormulaInstaller`.

Closes Homebrew/homebrew#47887.

Signed-off-by: Xu Cheng <xucheng@me.com>
2016-01-09 20:28:15 +08:00
Baptiste Fontaine
f11bea0153 audit: typo 2016-01-06 17:58:16 +01:00
Jason Tedor
4b2eb86bbf audit: allow whitelisting of versioned Kibana.
This commit modifies the whitelisting of the Kibama formula from the
npm audit check to allow the versioned Kibana formulae to receive the
same whitelisting.

Closes Homebrew/homebrew#47500.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-29 19:17:55 +00:00
Jason Tedor
076cbf55be kibana 4.3.0
Closes Homebrew/homebrew#46593.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-12-28 19:08:51 +00:00
Xu Cheng
0f60f76f26 lsyncd: use MACOS_FULL_VERSION
This commit partial reverts beed39e46fa021dd1c133c2c8eaaa81b524e68c7.

For users whose local brew is at around 2015-06-02 to 2015-06-11,
running `brew update` will emit following error:

  Error: undefined method 'full_version' for OS::Mac:Module

This is caused by the same bug described in Homebrew/homebrew#42553.

Let's use `MACOS_FULL_VERSION` for now to restore `brew update` compatibility
for these users.

TODO: revert this commit after core code and formulae separation.
2015-12-19 21:14:12 +08:00
Baptiste Fontaine
50f94e5233 audit: don't fail if there's no tap
Closes Homebrew/homebrew#47041.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-15 15:52:05 +01:00
Baptiste Fontaine
48b39ba1e7 audit: flag '--with{,out}-check' options
Closes Homebrew/homebrew#46794.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-12-09 11:29:47 +01:00
Xu Cheng
fe032e3e96 avoid using FORMULA_RENAMES directly 2015-12-09 16:56:59 +08:00
Xu Cheng
d948ec231d audit: tap is a Tap object now 2015-12-09 16:56:59 +08:00
Mike McQuaid
22b0abbfb8 audit: only run brew style when on Ruby 2.0. 2015-11-25 09:26:42 +00:00
Martin Afanasjew
cd267e0bce audit: check position of 'revision' and 'keg_only'
Closes Homebrew/homebrew#46178.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-11-23 04:56:27 +00:00
Martin Afanasjew
c55080abd5 audit: respect umask in formula file mode check
Closes Homebrew/homebrew#45837.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-11-16 20:07:23 +00:00
Xu Cheng
14af3e3515 audit: add godep and sphinx-doc to build time deps
Closes Homebrew/homebrew#46031.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-16 21:12:54 +08:00
Martin Afanasjew
8091b33f85 ruby 1.8: address syntax warnings in Homebrew core
Closes Homebrew/homebrew#45849.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-11-11 14:22:44 +08:00
Mike McQuaid
39a1ff2aa0 audit: don't flag Gnome devel releases < 1.0. 2015-11-01 09:26:43 -08:00
Baptiste Fontaine
a2e2553bd8 audit: flag any desc that starts with the formula name
The previous version didn’t work with descs like:

  "TheFormula serves a web page"
2015-10-30 17:56:55 +01:00
Baptiste Fontaine
18bda1c9b1 audit: uniformize the desc problems
Closes Homebrew/homebrew#45492.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-30 09:59:43 +01:00
Baptiste Fontaine
a5f6295b62 audit: flag descs starting with the formula name
Closes Homebrew/homebrew#45493.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-30 09:51:20 +01:00
Dominyk Tiller
2b9561b837 audit: add bottle modifier checks
* Checks for placement of the bottle modifier variable.

* Checks there isn't a bottle modifier and a bottle do block - The former makes
the latter redundant.

Closes Homebrew/homebrew#45146.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2015-10-24 00:25:46 +01:00
Baptiste Fontaine
e7ef3e36e2 audit: merge the template comments checks
Closes Homebrew/homebrew#45263.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-23 15:20:10 +02:00
Baptiste Fontaine
774a508d1a audit: warn about unknown bottle modifiers
This prevents typos like `bottle :uneeded` or `bottle :disable`

Closes Homebrew/homebrew#45264.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-23 19:44:19 +08:00
Baptiste Fontaine
abfaa59e06 MacOS: full_version added
Closes Homebrew/homebrew#44988.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-18 22:57:42 +08:00
Xu Cheng
8c4bd3dae2 audit: use ARGV.resolved_formula
There are audit rules which check cellar. Therefore, we need
`ARGV.resolved_formula` to get proper spec and prefix.

Closes Homebrew/homebrew#44781.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-10 01:34:43 +08:00
Xu Cheng
ee332c4550 handle TapFormulaWithOldnameAmbiguityError
Closes Homebrew/homebrew#44705.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-08 16:02:33 +08:00
Daniel Lee Harple
6b3b398858 audit: fix GitHub repository audit
In the data returned from the GitHub API, “watchers_count” is actually the
number of stars.

See https://developer.github.com/v3/activity/starring/#starring-vs-watching

Closes Homebrew/homebrew#44477.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-10-07 19:48:24 +08:00
Andrew Janke
4c80bf4324 audit: add check for 'head' and 'head do' both present
Closes Homebrew/homebrew#44626.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-10-07 09:41:24 +02:00
Xu Cheng
bd4525b64a mpich2 is renamed as mpich 2015-09-13 20:57:43 +08:00
Xu Cheng
002f8f2eb7 audit: handle tap aliases 2015-09-13 17:33:35 +08:00
Xu Cheng
67c3f8ff27 audit: cache formula names during audit_formula_name
Before `audit_formula_name: 15.094845999999986`
After `audit_formula_name: 0.5617120000000043`

Closes Homebrew/homebrew#43663.

Signed-off-by: Xu Cheng <xucheng@me.com>
2015-09-08 11:04:49 +08:00
Xu Cheng
e370f005c0 audit: simplify remote_official_taps 2015-09-08 11:04:49 +08:00
Daniel Lee Harple
4e5d92dc10 audit: spelling fix
Closes Homebrew/homebrew#43273.

Signed-off-by: Tim D. Smith <git@tim-smith.us>
2015-08-25 08:24:04 -07:00
Xu Cheng
a88c40b8c8 core file style update 2015-08-22 13:15:33 +08:00
Baptiste Fontaine
8ba0fb9fcf unnecessary calls to .select simplified
These are minor perf optimizations.

Closes Homebrew/homebrew#43028.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2015-08-18 00:18:22 +02:00
Viktor Szakats
0d4da4234a audit: enforce https on [*.]archive.org
Also:
* one minor regexp tweak

Closes Homebrew/homebrew#42761.

Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
2015-08-11 19:04:23 +01:00
Dominyk Tiller
64bcb5a07f audit: catch insecure bitbucket 2015-08-10 19:12:24 +01:00
Vlad Shablinsky
556ab3bcd6 audit: add rules for naming
- restrict old names as names of new formulae
- warn about dependencies on old names
2015-08-10 13:57:58 +01:00
Dominyk Tiller
970992d5bf audit: prune redundant code 2015-08-10 02:39:38 +01:00