# It checks that every file pattern specified in a spec yields
# at least one file. It requires the pods to be already present
# in the current working directory under Pods/spec.name.
#
# @return [Array<String>]
#
defcheck_file_patterns
error"The sources did not match any file"if!spec.source_files.empty?&&@pod.source_files.empty?
error"The resources did not match any file"if!spec.resources.empty?&&@pod.resource_files.empty?
error"The preserve_paths did not match any file"if!spec.preserve_paths.empty?&&@pod.preserve_files.empty?
error"The exclude_header_search_paths did not match any file"if!spec.exclude_header_search_paths.empty?&&@pod.headers_excluded_from_search_paths.empty?
messages<<"Missing or invalid source: #{spec.source}"unlesssource_valid?
messages<<"The summary should be short use `description` (max 140 characters)."ifspec.summary&&spec.summary.length>140
# attributes with multiplatform values
returnmessagesunlessplatform_valid?
messages<<"The spec appears to be empty (no source files, resources, or preserve paths)"ifspec.source_files.empty?&&spec.subspecs.empty?&&spec.resources.empty?&&spec.preserve_paths.empty?
messages<<"The summary is not meaningful"ifspec.summary=~/A short description of/
messages<<"The description is not meaningful"ifspec.description&&spec.description=~/An optional longer description of/
messages<<"The summary should end with a dot"ifspec.summary!~/.*\./
messages<<"The description should end with a dot"ifspec.description!~/.*\./&&spec.description!=spec.summary
messages<<"The summary should end with a dot"ifspec.summary!~/.*\./
messages<<"Comments must be deleted"iftext.scan(/^\s*#/).length>24
messages<<"Warnings must not be disabled (`-Wno' compiler flags)"ifspec.compiler_flags.split(' ').any?{|flag|flag.start_with?('-Wno')}
if(git_source=source[:git])
messages<<"Git sources should specify either a tag or a commit"unlesssource[:commit]||source[:tag]
ifspec.version.to_s!='0.0.1'
messages<<"The version of the spec should be part of the git tag (not always applicable)"ifsource[:tag]&&!source[:tag].include?(spec.version.to_s)
messages<<"Git sources without tag should be marked as 0.0.1 (not always applicable)"if!source[:tag]
end
ifgit_source.include?('github.com')
messages<<"Github repositories should end in `.git'"unlessgit_source.end_with?('.git')
messages<<"Github repositories should use `https' link"unlessgit_source.start_with?('https://github.com')||git_source.start_with?('git://gist.github.com')
end
end
messages
end
# It creates a podfile in memory and builds a library containing
# the pod for all available platfroms with xcodebuild.
||l.include?('note: ')&&(l!~/expanded from macro/)
end
selected_lines.mapdo|l|
new=l.gsub(/\/tmp\/CocoaPods\/Lint\/Pods\//,'')# Remove the unnecessary tmp path
new.gsub!(/^ */,' ')# Remove indentation
"XCODEBUILD > "<<new# Mark
end
end
# It checks that every file pattern specified in a spec yields
# at least one file. It requires the pods to be alredy present
# in the current working directory under Pods/spec.name.
#
# @return [Array<String>]
#
deffile_patterns_errors
messages=[]
messages<<"The sources did not match any file"if!spec.source_files.empty?&&@pod.source_files.empty?
messages<<"The resources did not match any file"if!spec.resources.empty?&&@pod.resource_files.empty?
messages<<"The preserve_paths did not match any file"if!spec.preserve_paths.empty?&&@pod.preserve_files.empty?
messages<<"The exclude_header_search_paths did not match any file"if!spec.exclude_header_search_paths.empty?&&@pod.headers_excluded_from_search_paths.empty?