aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb21
-rw-r--r--Library/Homebrew/cmd/create.rb2
-rw-r--r--Library/Homebrew/dev-cmd/test-bot.rb2
3 files changed, 16 insertions, 9 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 5171ec711..5827c054c 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -1,15 +1,19 @@
-#: * `audit` [`--strict`] [`--online`] [`--display-cop-names`] [`--display-filename`] [<formulae>]:
+#: * `audit` [`--strict`] [`--online`] [`--new-formula`] [`--display-cop-names`] [`--display-filename`] [<formulae>]:
#: Check <formulae> for Homebrew coding style violations. This should be
#: run before submitting a new formula.
#:
#: If no <formulae> are provided, all of them are checked.
#:
#: If `--strict` is passed, additional checks are run, including RuboCop
-#: style checks. This should be used when creating new formulae.
+#: style checks.
#:
#: If `--online` is passed, additional slower checks that require a network
-#: connection are run. This should be used when creating for new formulae.
-#:
+#: connection are run.
+#
+#: If `--new-formula` is passed, various additional checks are run that check
+#: if a new formula is eligable for Homebrew. This should be used when creating
+#: new formulae and implies `--strict` and `--online`.
+#
#: If `--display-cop-names` is passed, the RuboCop cop name for each violation
#: is included in the output.
#:
@@ -43,9 +47,10 @@ module Homebrew
formula_count = 0
problem_count = 0
- strict = ARGV.include? "--strict"
+ new_formula = ARGV.include? "--new-formula"
+ strict = new_formula || ARGV.include?("--strict")
style = strict && RUBY_2_OR_LATER
- online = ARGV.include? "--online"
+ online = new_formula || ARGV.include?("--online")
ENV.activate_extensions!
ENV.setup_build_environment
@@ -63,7 +68,7 @@ module Homebrew
end
ff.each do |f|
- options = { :strict => strict, :online => online }
+ options = { :new_formula => new_formula, :strict => strict, :online => online }
options[:style_offenses] = style_results.file_offenses(f.path) if style
fa = FormulaAuditor.new(f, options)
fa.audit
@@ -150,6 +155,7 @@ class FormulaAuditor
def initialize(formula, options = {})
@formula = formula
+ @new_formula = !!options[:new_formula]
@strict = !!options[:strict]
@online = !!options[:online]
# Accept precomputed style offense results, for efficiency
@@ -534,6 +540,7 @@ class FormulaAuditor
def audit_github_repository
return unless @online
+ return unless @new_formula
regex = %r{https?://github\.com/([^/]+)/([^/]+)/?.*}
_, user, repo = *regex.match(formula.stable.url) if formula.stable
diff --git a/Library/Homebrew/cmd/create.rb b/Library/Homebrew/cmd/create.rb
index ed71a6d39..9be990318 100644
--- a/Library/Homebrew/cmd/create.rb
+++ b/Library/Homebrew/cmd/create.rb
@@ -85,7 +85,7 @@ module Homebrew
fc.generate!
- puts "Please `brew audit --strict #{fc.name}` before submitting, thanks."
+ puts "Please `brew audit --new-formula #{fc.name}` before submitting, thanks."
exec_editor fc.path
end
diff --git a/Library/Homebrew/dev-cmd/test-bot.rb b/Library/Homebrew/dev-cmd/test-bot.rb
index c7309b114..0c1beeca2 100644
--- a/Library/Homebrew/dev-cmd/test-bot.rb
+++ b/Library/Homebrew/dev-cmd/test-bot.rb
@@ -445,7 +445,7 @@ module Homebrew
fetch_args << "--force" if ARGV.include? "--cleanup"
audit_args = [formula_name]
- audit_args << "--strict" << "--online" if @added_formulae.include? formula_name
+ audit_args << "--new-formula" if @added_formulae.include? formula_name
if formula.stable
unless satisfied_requirements?(formula, :stable)