Commit 0360ab89 authored by Fabio Pelosin's avatar Fabio Pelosin

[Linter] Promote long summary warning to an error.

parent 90174caa
......@@ -166,10 +166,11 @@ module Pod
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 @@ module Pod
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') }
......
......@@ -177,10 +177,10 @@ module Pod
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
......
......@@ -7,7 +7,6 @@ describe "Pod::Command::Repo" do
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 @@ describe "Pod::Command::Repo" do
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
......
......@@ -32,7 +32,7 @@ module SpecHelper
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
......
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