Commit 0a5cd240 authored by Fabio Pelosin's avatar Fabio Pelosin

[Linter] Detect warning disabling compiler flags.

parent dc04fc22
...@@ -218,14 +218,15 @@ module Pod ...@@ -218,14 +218,15 @@ module Pod
source = spec.source || {} source = spec.source || {}
text = @file.read text = @file.read
messages = [] messages = []
messages << "Missing license type" unless license[:type] messages << "Missing license type" unless license[:type]
messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/ messages << "Sample license type" if license[:type] && license[:type] =~ /\(example\)/
messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/ messages << "Invalid license type" if license[:type] && license[:type] =~ /\n/
messages << "The summary is not meaningful" if spec.summary =~ /A short description of/ 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 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 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 description should end with a dot" if spec.description !~ /.*\./ && spec.description != spec.summary
messages << "Comments must be deleted" if text.scan(/^\s*#/).length > 24 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') }
if (git_source = source[:git]) if (git_source = source[:git])
messages << "Git sources should specify either a tag or a commit" unless source[:commit] || source[:tag] messages << "Git sources should specify either a tag or a commit" unless source[:commit] || source[:tag]
......
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