Commit 7d5581ad authored by Fabio Pelosin's avatar Fabio Pelosin

[Linter] No-clean option.

parent 809745bd
...@@ -20,7 +20,8 @@ module Pod ...@@ -20,7 +20,8 @@ module Pod
def self.options def self.options
[ ["--quick", "Lint skips checks that would require to donwload and build the spec"], [ ["--quick", "Lint skips checks that would require to donwload and build the spec"],
["--only-errors", "Lint validates even if warnings are present"] ].concat(super) ["--only-errors", "Lint validates even if warnings are present"],
["--no-clean", "Lint leaves the build directory intact for inspection"] ].concat(super)
end end
def initialize(argv) def initialize(argv)
...@@ -32,6 +33,7 @@ module Pod ...@@ -32,6 +33,7 @@ module Pod
elsif @action == 'lint' elsif @action == 'lint'
@quick = argv.option('--quick') @quick = argv.option('--quick')
@only_errors = argv.option('--only-errors') @only_errors = argv.option('--only-errors')
@no_clean = argv.option('--no-clean')
@repo_or_podspec = argv.shift_argument unless argv.empty? @repo_or_podspec = argv.shift_argument unless argv.empty?
super unless argv.size <= 1 super unless argv.size <= 1
else else
...@@ -83,6 +85,7 @@ module Pod ...@@ -83,6 +85,7 @@ module Pod
linter = Linter.new(spec) linter = Linter.new(spec)
linter.lenient = @only_errors linter.lenient = @only_errors
linter.quick = @quick || is_repo? linter.quick = @quick || is_repo?
linter.no_clean = @no_clean
invalid_count += 1 unless linter.lint invalid_count += 1 unless linter.lint
# This overwrites the previously printed text # This overwrites the previously printed text
...@@ -152,7 +155,7 @@ module Pod ...@@ -152,7 +155,7 @@ module Pod
# TODO: Add check to ensure that attributes inherited by subspecs are not duplicated ? # TODO: Add check to ensure that attributes inherited by subspecs are not duplicated ?
attr_accessor :quick, :lenient attr_accessor :quick, :lenient, :no_clean
attr_reader :spec, :file attr_reader :spec, :file
attr_reader :errors, :warnings, :notes attr_reader :errors, :warnings, :notes
...@@ -250,7 +253,7 @@ module Pod ...@@ -250,7 +253,7 @@ module Pod
end end
def tear_down_lint_environment def tear_down_lint_environment
tmp_dir.rmtree tmp_dir.rmtree unless no_clean
Config.instance = @original_config Config.instance = @original_config
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