Skip to content

Commit

Permalink
Merge pull request #38 from Kapin/linter-improvements
Browse files Browse the repository at this point in the history
Fix incorrect errors when linting specs
  • Loading branch information
kapin committed Nov 6, 2013
2 parents 26f43e2 + df6f5f5 commit c80e75a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/cocoapods-core/specification/linter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def _validate_source(s)
error 'The commit of a Git source cannot be `HEAD`.' if commit && commit.downcase =~ /head/
warning 'The version should be included in the Git tag.' if tag && !tag.include?(version)
warning "Github repositories should end in `.git`." if github && !git.end_with?('.git')
warning "Github repositories should use `https` link." if github && !git.start_with?('https://github.com') && !git.start_with?('git://gist.github.com')
warning "Github repositories should use `https` link." if github && !git.start_with?('https://github.com') && !git.start_with?('https://gist.github.com')

if version == '0.0.1'
error 'Git sources should specify either a commit or a tag.' if commit.nil? && tag.nil?
Expand Down Expand Up @@ -302,11 +302,11 @@ def check_tmp_arc_not_nil
# Check empty subspec attributes
#
def check_if_spec_is_empty
methods = %w[ source_files resources preserve_paths dependencies ]
methods = %w[ source_files resources preserve_paths dependencies vendored_libraries ]
empty_patterns = methods.all? { |m| consumer.send(m).empty? }
empty = empty_patterns && consumer.spec.subspecs.empty?
if empty
error "The #{consumer.spec} spec is empty (no source files, resources, preserve paths, dependencies or subspecs)."
error "The #{consumer.spec} spec is empty (no source files, resources, preserve paths, vendored_libraries, dependencies or subspecs)."
end
end

Expand Down
1 change: 1 addition & 0 deletions spec/specification/linter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ def message_should_include(*values)
consumer.any_instance.stubs(:preserve_paths).returns([])
consumer.any_instance.stubs(:subspecs).returns([])
consumer.any_instance.stubs(:dependencies).returns([])
consumer.any_instance.stubs(:vendored_libraries).returns([])
@linter.lint
message = @linter.results.first.message
message.should.include('spec is empty')
Expand Down

0 comments on commit c80e75a

Please sign in to comment.