From 0a58d2615bd2927e8f7aad4e813b8ab811923456 Mon Sep 17 00:00:00 2001 From: Takayama Fumihiko Date: Sun, 3 Apr 2016 15:30:13 +0900 Subject: [PATCH] fix lint --- util/lint/xcodeproj.rb | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/util/lint/xcodeproj.rb b/util/lint/xcodeproj.rb index 2cf850b..af6994b 100755 --- a/util/lint/xcodeproj.rb +++ b/util/lint/xcodeproj.rb @@ -6,20 +6,23 @@ def check_value(name, value, configuration = nil) return if ARGV.include?(name) + + root = configuration.nil? + if configuration.nil? then print " check #{name}\n" configuration = $configuration end - isexist = false + exists = false configuration.each do |k,v| if v.kind_of?(Enumerable) then if check_value(name, value, v) then - isexist = true + exists = true end else if name == k then - isexist = true + exists = true if value.nil? then print "[ERROR] Appear name: #{name}\n" exit 1 @@ -31,12 +34,12 @@ def check_value(name, value, configuration = nil) end end - if configuration.nil? and (not isexist) then + if root and (not value.nil?) and (not exists) then print "[ERROR] No setting: #{name}\n" exit 1 end - isexist + exists end check_value('objectVersion', '46')