Commit 1b5a8458 authored by Chris Eidhof's avatar Chris Eidhof

Display a more helpful message when pod spec lint validates.

parent adcb74d0
...@@ -120,7 +120,7 @@ module Pod ...@@ -120,7 +120,7 @@ module Pod
def lint def lint
file = @name ? Pathname.new(@name) : Pathname.pwd.glob('*.podspec').first file = @name ? Pathname.new(@name) : Pathname.pwd.glob('*.podspec').first
spec = Specification.from_file(file) spec = Specification.from_file(file)
spec.validate! puts "This pod specification contains all required attributes." if spec.validate!
end end
end end
end end
......
...@@ -337,12 +337,16 @@ module Pod ...@@ -337,12 +337,16 @@ module Pod
allowed = [nil, :ios, :osx] allowed = [nil, :ios, :osx]
incorrect << ["`platform'", allowed] unless allowed.include?(platform.name) incorrect << ["`platform'", allowed] unless allowed.include?(platform.name)
unless missing.empty? && incorrect.empty? no_errors_found = missing.empty? && incorrect.empty?
unless no_errors_found
message = "The following #{(missing + incorrect).size == 1 ? 'attribute is' : 'attributes are'}:\n" message = "The following #{(missing + incorrect).size == 1 ? 'attribute is' : 'attributes are'}:\n"
message << "* missing: #{missing.join(", ")}" unless missing.empty? message << "* missing: #{missing.join(", ")}" unless missing.empty?
message << "* incorrect: #{incorrect.map { |x| "#{x[0]} (#{x[1..-1]})" }.join(", ")}" unless incorrect.empty? message << "* incorrect: #{incorrect.map { |x| "#{x[0]} (#{x[1..-1]})" }.join(", ")}" unless incorrect.empty?
raise Informative, message raise Informative, message
end end
no_errors_found
end end
# This is a convenience method which gets called after all pods have been # This is a convenience method which gets called after all pods have been
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment