416 Commits

Author SHA1 Message Date
Andrew Janke
a3b70d38a7 brew-audit: pull style checks in to main audit output
This collects all violations for each formula in a single place, instead
of doing `brew style` outputs for all formulae first, and then the other
audit checks.

Closes #112.

Signed-off-by: Andrew Janke <andrew@apjanke.net>
2016-04-21 14:45:33 -04:00
Cory Donnelly
bad28dc546 audit.rb: Base desc length check on short name
Currently, brew audit --strict includes the name of the tap when calculating the
length of a formula's description. This makes it difficult to pass the audit for
formulas in taps with lengthy names. In #47033 @jawshooah called out head-only
or devel-only taps specifically, but this is an issue elsewhere. For example:

homebrew/versions/elasticsearch20: Distributed search & analytics engine (72)

This commit updates audit.rb to use formula.name rather than formula.full_name.

Closes #47033 -- Audit shouldn't include tap name in description length
2016-04-16 16:14:15 +02:00
Max Nordlund
fa1fd70a37 Add all the top level comments 2016-04-10 22:59:25 +02:00
Dominyk Tiller
a9c0361a1d audit: require plist_options when using plist
Closes #19.

Signed-off-by: Dominyk Tiller <dominyktiller@gmail.com>
2016-04-05 23:57:53 +01:00
Dominyk Tiller
149334d88d audit: check plist placement 2016-04-05 23:57:53 +01:00
Xu Cheng
d0b713c396 Revert "lsyncd: use MACOS_FULL_VERSION"
This reverts commit 0f60f76f26ca9fe26e1c10c72905a878a58e3c96.
2016-04-03 23:19:38 +08:00
Xu Cheng
5bb8e8985d audit/test-bot/pull: fix for core/formula separation
All formulae are in taps now.
2016-04-02 21:51:36 +08:00
Baptiste Fontaine
236a18debe audit: fix crash when HOMEBREW_NO_GITHUB_API is set
Running brew audit --strict --online on a formula with a GitHub
homepage/url would crash if HOMEBREW_NO_GITHUB_API is set because
GitHub.repository returns `nil` and the audit code assumes it always
returns a hash.

Closes Homebrew/homebrew#50054.

Signed-off-by: Baptiste Fontaine <batifon@yahoo.fr>
2016-03-14 19:39:15 +08:00
Xu Cheng
28f3dae8cd rename CoreFormulaRepository to CoreTap
Core tap will be separated from core code in the near future.
It makes sense to rename it to CoreTap.
2016-03-07 19:43:46 +08:00
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