Skip to content
Browse files

[Linter] Promote long summary warning to an error.

  • Loading branch information...
1 parent 90174ca commit 0360ab89b47597b1c7d9f1616f074e4443f674e0 @fabiopelosin fabiopelosin committed Sep 19, 2012
View
5 lib/cocoapods/command/linter.rb
@@ -166,10 +166,11 @@ def podspec_errors
messages << "Unrecognized platfrom" unless platform_valid?
messages << "Missing name" unless spec.name
messages << "Missing version" unless spec.version
- messages << "Missing summary" unless spec.summary
+ messages << "Missing summary" unless spec.summary || spec.summary.empty?
messages << "Missing homepage" unless spec.homepage
messages << "Missing author(s)" unless spec.authors
messages << "Missing or invalid source: #{spec.source}" unless source_valid?
+ messages << "The summary should be short use `description` (max 140 characters)." if spec.summary && spec.summary.length > 140
# attributes with multiplatform values
return messages unless platform_valid?
@@ -223,13 +224,11 @@ def podspec_warnings
messages << "Missing license type" unless license[:type]
messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/
- messages << "The summary is required" if spec.summary.empty?
messages << "The summary is not meaningful" if spec.summary =~ /A short description of/
messages << "The description is not meaningful" if spec.description && spec.description =~ /An optional longer description of/
messages << "The summary should end with a dot" if spec.summary !~ /.*\./
messages << "The description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
messages << "The summary should end with a dot" if spec.summary !~ /.*\./
- messages << "The summary should be short use `description` (max 140 characters)." if spec.summary.length > 140
messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24
messages << "Warnings must not be disabled (`-Wno' compiler flags)" if spec.compiler_flags.split(' ').any? {|flag| flag.start_with?('-Wno') }
View
4 lib/cocoapods/dependency.rb
@@ -177,10 +177,10 @@ def store_podspec(sandbox, podspec)
output_path = sandbox.root + "Local Podspecs/#{name}.podspec"
output_path.dirname.mkpath
if podspec.is_a?(String)
- raise Informative, "No podspec found for `#{name}' in `#{description}'" unless podspec.include?('Spec.new')
+ raise Informative, "No podspec found for `#{name}' in #{description}" unless podspec.include?('Spec.new')
output_path.open('w') { |f| f.puts(podspec) }
else
- raise Informative, "No podspec found for `#{name}' in `#{description}'" unless podspec.exist?
+ raise Informative, "No podspec found for `#{name}' in #{description}" unless podspec.exist?
FileUtils.copy(podspec, output_path)
end
end
View
3 spec/functional/command/repo_spec.rb
@@ -7,7 +7,6 @@
extend SpecHelper::TemporaryRepos
it "runs with correct parameters" do
- lambda { run_command('repo', 'add', 'NAME', 'URL') }.should.not.raise
lambda { run_command('repo', 'update') }.should.not.raise
lambda { run_command('repo', 'lint', temporary_directory.to_s) }.should.not.raise
end
@@ -18,7 +17,7 @@
end
it "adds a spec-repo" do
- add_repo('private', fixture('spec-repos/master'))
+ run_command('repo', 'add', 'private', fixture('spec-repos/master'))
git_config('private', 'remote.origin.url').should == fixture('spec-repos/master').to_s
end
View
2 spec/spec_helper/temporary_repos.rb
@@ -32,7 +32,7 @@ def add_repo(name, from)
command.run
Dir.chdir(command.dir) do
`git checkout -b test >/dev/null 2>&1`
- `git branch --set-upstream test origin/test >/dev/null 2>&1`
+ `git branch --set-upstream test origin/master >/dev/null 2>&1`
end
command
end

0 comments on commit 0360ab8

Please sign in to comment.
Something went wrong with that request. Please try again.