Commit b1a5f6e7 authored by Fabio Pelosin's avatar Fabio Pelosin

[Repo#lint] Added only-errors option.

parent 84f62600
...@@ -23,6 +23,10 @@ module Pod ...@@ -23,6 +23,10 @@ module Pod
lint all the spec-repos known to CocoaPods.} lint all the spec-repos known to CocoaPods.}
end end
def self.options
[["--only-errors", "Lint presents only the errors"]].concat(super)
end
extend Executable extend Executable
executable :git executable :git
...@@ -33,8 +37,11 @@ module Pod ...@@ -33,8 +37,11 @@ module Pod
raise Informative, "#{@action == 'add' ? 'Adding' : 'Updating the remote of'} a repo needs a `name' and a `url'." raise Informative, "#{@action == 'add' ? 'Adding' : 'Updating the remote of'} a repo needs a `name' and a `url'."
end end
@branch = argv.arguments[3] @branch = argv.arguments[3]
when 'update', 'lint' when 'update'
@name = argv.arguments[1] @name = argv.arguments[1]
when 'lint'
@name = argv.arguments[1]
@only_errors = argv.option('--only-errors')
else else
super super
end end
...@@ -92,7 +99,7 @@ module Pod ...@@ -92,7 +99,7 @@ module Pod
linter.lint linter.lint
unless linter.result_type == :success if (!@only_errors && linter.result_type != :success) || linter.result_type == :error
case linter.result_type case linter.result_type
when :error when :error
invalid_count += 1 invalid_count += 1
...@@ -102,8 +109,10 @@ module Pod ...@@ -102,8 +109,10 @@ module Pod
end end
puts " -> ".send(color) << linter.spec_name puts " -> ".send(color) << linter.spec_name
print_messages('ERROR', linter.errors) print_messages('ERROR', linter.errors)
print_messages('WARN', linter.warnings) unless @only_errors
print_messages('NOTE', linter.notes) print_messages('WARN', linter.warnings)
print_messages('NOTE', linter.notes)
end
puts unless config.silent? puts unless config.silent?
end end
end end
......
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