aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorNikolaus Wittenstein2015-05-19 13:05:22 -0400
committerMike McQuaid2015-05-25 17:23:50 +0100
commit39498af1c6f56fa63d068dff26abfec3b4556df1 (patch)
tree311b6d099394c0d5361a4f8f808a6115d9b74fb8 /Library
parent148cafa9cdce93487be49669f658a48379b04c54 (diff)
downloadbrew-39498af1c6f56fa63d068dff26abfec3b4556df1.tar.bz2
audit looks for and validates 'desc'
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/audit.rb27
1 files changed, 27 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/audit.rb b/Library/Homebrew/cmd/audit.rb
index 7d0230ab2..923ea0cc1 100644
--- a/Library/Homebrew/cmd/audit.rb
+++ b/Library/Homebrew/cmd/audit.rb
@@ -244,6 +244,32 @@ class FormulaAuditor
end
end
+ def audit_desc
+ # For now, only check the description when using `--strict`
+ return unless @strict
+
+ desc = formula.desc
+
+ unless desc and desc.length > 0
+ problem "Formula should have a desc (Description)."
+ return
+ end
+
+ # Make sure the formula name plus description is no longer than 80 characters
+ linelength = formula.name.length + ": ".length + desc.length
+ if linelength > 80
+ problem "Description is too long. \"name: desc\" should be less than 80 characters (currently #{linelength})."
+ end
+
+ if desc =~ %r[[Cc]ommandline]
+ problem "It should be \"command-line\", not \"commandline\"."
+ end
+
+ if desc =~ %r[[Cc]ommand line]
+ problem "It should be \"command-line\", not \"command line\"."
+ end
+ end
+
def audit_homepage
homepage = formula.homepage
@@ -706,6 +732,7 @@ class FormulaAuditor
audit_file
audit_class
audit_specs
+ audit_desc
audit_homepage
audit_deps
audit_conflicts