Commit 2243c015 authored by Samuel E. Giddins's avatar Samuel E. Giddins

Merge pull request #4977 from CocoaPods/seg-rubocop-0-37

[Bundle] Update RuboCop
parents 6a4aded5 79b20ae4
......@@ -40,7 +40,10 @@ Encoding:
# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
TrailingComma:
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma
Style/MultilineOperationIndentation:
......@@ -112,6 +115,10 @@ AmbiguousRegexpLiteral:
Exclude:
- spec/**/*
Performance/RedundantMatch:
Exclude:
- spec/**/*
# Allow `object.should == object` syntax.
Void:
Exclude:
......
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2015-09-25 20:32:21 -0500 using RuboCop version 0.34.2.
# on 2016-03-03 16:16:26 -0600 using RuboCop version 0.37.2.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.
# Offense count: 2
# Offense count: 4
# Cop supports --auto-correct.
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
# SupportedStyles: keyword, variable, start_of_line
Lint/EndAlignment:
Enabled: false
# Offense count: 11
Lint/IneffectiveAccessModifier:
Exclude:
- 'lib/cocoapods/command.rb'
- 'lib/cocoapods/downloader.rb'
- 'lib/cocoapods/executable.rb'
- 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
# Offense count: 1
Lint/NonLocalExitFromIterator:
Exclude:
- 'spec/unit/installer_spec.rb'
# Offense count: 3
# Offense count: 40
Lint/UselessAccessModifier:
Enabled: false
# Offense count: 1853
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Max: 279
# Offense count: 5
# Cop supports --auto-correct.
Performance/Casecmp:
Exclude:
- 'lib/cocoapods/installer/analyzer/locking_dependency_analyzer.rb'
- 'lib/cocoapods/installer/installation_options.rb'
- 'lib/cocoapods/open-uri.rb'
- 'lib/cocoapods/project.rb'
- 'lib/cocoapods/sandbox/path_list.rb'
# Offense count: 3
# Cop supports --auto-correct.
Performance/RedundantBlockCall:
Exclude:
- 'lib/cocoapods/downloader/cache.rb'
- 'lib/cocoapods/installer/analyzer/pod_variant_set.rb'
- 'spec/unit/validator_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
Performance/RedundantMatch:
Exclude:
- 'spec/**/*'
- 'lib/cocoapods/command/lib.rb'
- 'lib/cocoapods/external_sources/podspec_source.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: MaxKeyValuePairs.
Performance/RedundantMerge:
Exclude:
- 'lib/cocoapods/installer/target_installer.rb'
# Offense count: 1
# Cop supports --auto-correct.
Performance/StringReplacement:
Exclude:
- 'spec/functional/command/spec_spec.rb'
# Offense count: 23
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: prefer_alias, prefer_alias_method
Style/Alias:
Exclude:
- 'lib/cocoapods/config.rb'
- 'lib/cocoapods/downloader/request.rb'
- 'lib/cocoapods/external_sources/abstract_external_source.rb'
- 'lib/cocoapods/installer.rb'
- 'lib/cocoapods/installer/analyzer.rb'
- 'lib/cocoapods/installer/analyzer/pod_variant.rb'
- 'lib/cocoapods/installer/analyzer/sandbox_analyzer.rb'
- 'lib/cocoapods/installer/installation_options.rb'
- 'lib/cocoapods/installer/pod_source_installer.rb'
- 'lib/cocoapods/target.rb'
- 'lib/cocoapods/user_interface.rb'
- 'lib/cocoapods/validator.rb'
- 'spec/spec_helper.rb'
- 'spec/spec_helper/user_interface.rb'
- 'spec/unit/validator_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles.
# SupportedStyles: with_first_parameter, with_fixed_indentation
Style/AlignParameters:
Exclude:
- 'lib/cocoapods/project.rb'
# Offense count: 7
# Cop supports --auto-correct.
# Configuration parameters: SingleLineConditionsOnly.
Style/ConditionalAssignment:
Exclude:
- 'lib/cocoapods/command/init.rb'
- 'lib/cocoapods/command/repo/push.rb'
- 'lib/cocoapods/external_sources/abstract_external_source.rb'
- 'lib/cocoapods/sandbox/file_accessor.rb'
- 'lib/cocoapods/sandbox/path_list.rb'
- 'lib/cocoapods/sources_manager.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Style/ExtraSpacing:
Exclude:
- 'spec/unit/sandbox/path_list_spec.rb'
# Offense count: 1
Style/IfInsideElse:
Exclude:
- 'lib/cocoapods/generator/xcconfig/aggregate_xcconfig.rb'
# Offense count: 24
# Cop supports --auto-correct.
# Configuration parameters: SupportedStyles, IndentationWidth.
# SupportedStyles: special_inside_parentheses, consistent, align_brackets
Style/IndentArray:
EnforcedStyle: consistent
# Offense count: 27
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineMethodCallIndentation:
Enabled: false
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineOperationIndentation:
Enabled: false
# Offense count: 16
# Cop supports --auto-correct.
Style/MutableConstant:
Exclude:
- 'bin/sandbox-pod'
- 'lib/cocoapods/command/inter_process_communication.rb'
- 'lib/cocoapods/command/lib.rb'
- 'lib/cocoapods/config.rb'
- 'lib/cocoapods/generator/copy_resources_script.rb'
- 'lib/cocoapods/installer.rb'
- 'lib/cocoapods/installer/target_installer/pod_target_installer.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
- 'lib/cocoapods/project.rb'
- 'spec/unit/installer/user_project_integrator/target_integrator/xcconfig_integrator_spec.rb'
# Offense count: 1511
# Configuration parameters: AllowURI, URISchemes.
Metrics/LineLength:
Max: 281
# Offense count: 1
Style/NestedParenthesizedCalls:
Exclude:
- 'spec/unit/installer/analyzer_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowSafeAssignment.
Style/ParenthesesAroundCondition:
Exclude:
- 'lib/cocoapods/command/inter_process_communication.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantParentheses:
Exclude:
- 'lib/cocoapods/sources_manager.rb'
- 'spec/unit/sandbox_spec.rb'
# Offense count: 2
# Cop supports --auto-correct.
Style/RedundantSelf:
Exclude:
- 'lib/cocoapods/command.rb'
# Offense count: 12
# Offense count: 16
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral:
Exclude:
- 'lib/cocoapods/installer/file_references_installer.rb'
- 'lib/cocoapods/installer/user_project_integrator/target_integrator/xcconfig_integrator.rb'
- 'lib/cocoapods/sandbox/path_list.rb'
- 'lib/cocoapods/sources_manager.rb'
- 'lib/cocoapods/validator.rb'
......@@ -42,3 +205,33 @@ Style/RegexpLiteral:
- 'spec/unit/external_sources/path_source_spec.rb'
- 'spec/unit/external_sources/podspec_source_spec.rb'
- 'spec/unit/resolver_spec.rb'
# Offense count: 1
# Cop supports --auto-correct.
Style/SpaceAroundKeyword:
Exclude:
- 'lib/cocoapods/project.rb'
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment.
Style/SpaceAroundOperators:
Exclude:
- 'spec/unit/external_sources_spec.rb'
# Offense count: 5
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Exclude:
- 'lib/cocoapods/command/spec/create.rb'
- 'lib/cocoapods/user_interface.rb'
- 'lib/cocoapods/validator.rb'
- 'spec/spec_helper/temporary_repos.rb'
# Offense count: 4
Style/ZeroLengthPredicate:
Exclude:
- 'lib/cocoapods/command/init.rb'
- 'lib/cocoapods/command/project.rb'
- 'lib/cocoapods/installer/podfile_validator.rb'
- 'lib/cocoapods/sources_manager.rb'
......@@ -123,8 +123,6 @@ GEM
tzinfo (~> 1.1)
addressable (2.3.6)
ast (2.2.0)
astrolabe (1.3.1)
parser (~> 2.2)
awesome_print (1.6.1)
bacon (1.2.0)
clintegracon (0.8.1)
......@@ -169,7 +167,7 @@ GEM
nap (1.1.0)
netrc (0.7.8)
notify (0.5.2)
parser (2.3.0.2)
parser (2.3.0.6)
ast (~> 2.2)
powerpack (0.1.1)
prettybacon (0.0.2)
......@@ -178,19 +176,19 @@ GEM
coderay (~> 1.1.0)
method_source (~> 0.8.1)
slop (~> 3.4)
rainbow (2.0.0)
rainbow (2.1.0)
rake (10.4.2)
rb-fsevent (0.9.4)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
rb-kqueue (0.2.3)
ffi (>= 0.5.0)
rubocop (0.34.2)
astrolabe (~> 1.3)
parser (>= 2.2.2.5, < 3.0)
rubocop (0.37.2)
parser (>= 2.3.0.4, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
ruby-progressbar (~> 1.4)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 0.3)
ruby-graphviz (1.2.2)
ruby-prof (0.15.2)
ruby-progressbar (1.7.5)
......@@ -203,6 +201,7 @@ GEM
tins (1.8.1)
tzinfo (1.2.2)
thread_safe (~> 0.1)
unicode-display_width (0.3.1)
webmock (1.20.4)
addressable (>= 2.3.6)
crack (>= 0.3.2)
......
......@@ -198,7 +198,7 @@ begin
desc 'Rebuilds integration fixtures'
task :rebuild_integration_fixtures do
if `which hg` && !$?.success?
unless system('which hg')
puts red('[!] Mercurial (`hg`) must be installed to rebuild the integration fixtures.')
exit 1
end
......
......@@ -37,7 +37,7 @@ module Pod
def validate!
super
help! 'A name for the Pod is required.' unless @name
help! 'The Pod name cannot contain spaces.' if @name.match(/\s/)
help! 'The Pod name cannot contain spaces.' if @name =~ /\s/
help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
end
......
......@@ -135,12 +135,12 @@ module Pod
!lockfile_roots.include?(pod)
end
if missing_pods.length > 0
if missing_pods.length > 1
message = "Pods `#{missing_pods.join('`, `')}` are not " \
unless missing_pods.empty?
message = if missing_pods.length > 1
"Pods `#{missing_pods.join('`, `')}` are not " \
'installed and cannot be updated'
else
message = "The `#{missing_pods.first}` Pod is not installed " \
"The `#{missing_pods.first}` Pod is not installed " \
'and cannot be updated'
end
raise Informative, message
......
......@@ -43,7 +43,7 @@ module Pod
#
def podspec_uri
declared_path = params[:podspec].to_s
if declared_path.match(%r{^.+://})
if declared_path =~ %r{^.+://}
declared_path
else
normalized_podspec_path(declared_path)
......
# rubocop:disable LineLength
module Pod
module Generator
class CopyResourcesScript
......
......@@ -552,12 +552,10 @@ module Pod
#
def prepare_pods_project
UI.message '- Creating Pods project' do
object_version = aggregate_targets.map(&:user_project).compact.map { |p| p.object_version.to_i }.min
if object_version
@pods_project = Pod::Project.new(sandbox.project_path, false, object_version)
@pods_project = if object_version = aggregate_targets.map(&:user_project).compact.map { |p| p.object_version.to_i }.min
Pod::Project.new(sandbox.project_path, false, object_version)
else
@pods_project = Pod::Project.new(sandbox.project_path)
Pod::Project.new(sandbox.project_path)
end
analysis_result.all_user_build_configurations.each do |name, type|
......
......@@ -470,10 +470,10 @@ module Pod
def fetch_external_source(dependency, use_lockfile_options)
checkout_options = lockfile.checkout_options_for_pod_named(dependency.root_name) if lockfile
if checkout_options && use_lockfile_options
source = ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file)
source = if checkout_options && use_lockfile_options
ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file)
else
source = ExternalSources.from_dependency(dependency, podfile.defined_in_file)
ExternalSources.from_dependency(dependency, podfile.defined_in_file)
end
source.can_cache = installation_options.clean?
source.fetch(sandbox)
......
......@@ -94,10 +94,10 @@ module Pod
def scope_by_specs
root_spec = variants.first.root_spec
specs = [root_spec]
if root_spec.default_subspecs.empty?
specs += root_spec.subspecs.compact
specs += if root_spec.default_subspecs.empty?
root_spec.subspecs.compact
else
specs += root_spec.default_subspecs.map do |subspec_name|
root_spec.default_subspecs.map do |subspec_name|
root_spec.subspec_by_name("#{root_spec.name}/#{subspec_name}")
end
end
......
......@@ -24,12 +24,12 @@ module Pod
create_info_plist_file
create_module_map
create_umbrella_header do |generator|
if header_mappings_dir
generator.imports += target.file_accessors.flat_map(&:public_headers).map do |pathname|
generator.imports += if header_mappings_dir
target.file_accessors.flat_map(&:public_headers).map do |pathname|
pathname.relative_path_from(header_mappings_dir)
end
else
generator.imports += target.file_accessors.flat_map(&:public_headers).map(&:basename)
target.file_accessors.flat_map(&:public_headers).map(&:basename)
end
end
end
......
......@@ -49,7 +49,7 @@ module Pod
phase = target.shell_script_build_phases.find { |bp| bp.name == phase_name }
phase.shell_script = %("${SRCROOT}/../Pods/Pods-resources.sh"\n)
@target_integrator.integrate!
phase.shell_script.strip.should == "\"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh\""
phase.shell_script.strip.should == '"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh"'
end
it 'adds references to the Pods static libraries to the Frameworks group' do
......@@ -85,7 +85,7 @@ module Pod
target = @target_integrator.send(:native_targets).first
phase_name = @phase_prefix + Installer::UserProjectIntegrator::TargetIntegrator::COPY_PODS_RESOURCES_PHASE_NAME
phase = target.shell_script_build_phases.find { |bp| bp.name == phase_name }
phase.shell_script.strip.should == "\"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh\""
phase.shell_script.strip.should == '"${SRCROOT}/../Pods/Target Support Files/Pods/Pods-resources.sh"'
end
it 'adds a Check Manifest.lock build phase to each target' do
......
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