Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

--fail-on-warnings was not applying properly #54

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions lib/metadata_json_lint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ def parse(metadata)

if !parsed['tags'].nil? && !parsed['tags'].is_a?(Array)
puts "Warning: Tags must be in an array. Currently it's a #{parsed['tags'].class}."
error_state = true
error_state = true if options[:fail_on_warnings]
end

return unless error_state
Expand Down Expand Up @@ -141,7 +141,7 @@ def invalid_dependencies?(deps)
next unless dep['version_requirement'].nil? || open_ended?(dep['version_requirement'])
puts "Warning: Dependency #{dep['name']} has an open " \
"ended dependency version requirement #{dep['version_requirement']}"
error_state = true if options[:strict_dependencies]
error_state = true if options[:strict_dependencies]
rescue ArgumentError => e
# Raised when the version_requirement provided could not be parsed
puts "Invalid 'version_requirement' field in metadata.json: #{e}"
Expand All @@ -153,7 +153,7 @@ def invalid_dependencies?(deps)
next unless dep['version_range']
puts "Warning: Dependency #{dep['name']} has a 'version_range' attribute " \
'which is no longer used by the forge.'
error_state = true
error_state = true || options[:fail_on_warnings]
end
error_state
end
Expand Down