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: ...@@ -40,7 +40,10 @@ Encoding:
# Having these make it easier to *not* forget to add one when adding a new # Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line. # value and you can simply copy the previous line.
TrailingComma: Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma
Style/TrailingCommaInLiteral:
EnforcedStyleForMultiline: comma EnforcedStyleForMultiline: comma
Style/MultilineOperationIndentation: Style/MultilineOperationIndentation:
...@@ -112,6 +115,10 @@ AmbiguousRegexpLiteral: ...@@ -112,6 +115,10 @@ AmbiguousRegexpLiteral:
Exclude: Exclude:
- spec/**/* - spec/**/*
Performance/RedundantMatch:
Exclude:
- spec/**/*
# Allow `object.should == object` syntax. # Allow `object.should == object` syntax.
Void: Void:
Exclude: Exclude:
......
# This configuration was generated by # This configuration was generated by
# `rubocop --auto-gen-config` # `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 # The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base. # one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new # Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again. # versions of RuboCop, may require this file to be generated again.
# Offense count: 2 # Offense count: 4
# Cop supports --auto-correct. # Cop supports --auto-correct.
# Configuration parameters: AlignWith, SupportedStyles, AutoCorrect. # Configuration parameters: AlignWith, SupportedStyles, AutoCorrect.
# SupportedStyles: keyword, variable, start_of_line
Lint/EndAlignment: Lint/EndAlignment:
Enabled: false 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 # Offense count: 1
Lint/NonLocalExitFromIterator: Lint/NonLocalExitFromIterator:
Exclude: Exclude:
- 'spec/unit/installer_spec.rb' - 'spec/unit/installer_spec.rb'
# Offense count: 3 # Offense count: 40
Lint/UselessAccessModifier: 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: 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/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/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 # Offense count: 1
# Configuration parameters: AllowURI, URISchemes. Style/NestedParenthesizedCalls:
Metrics/LineLength: Exclude:
Max: 281 - '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. # Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes. # Configuration parameters: EnforcedStyle, SupportedStyles, AllowInnerSlashes.
# SupportedStyles: slashes, percent_r, mixed
Style/RegexpLiteral: Style/RegexpLiteral:
Exclude: Exclude:
- 'lib/cocoapods/installer/file_references_installer.rb' - '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/sandbox/path_list.rb'
- 'lib/cocoapods/sources_manager.rb' - 'lib/cocoapods/sources_manager.rb'
- 'lib/cocoapods/validator.rb' - 'lib/cocoapods/validator.rb'
...@@ -42,3 +205,33 @@ Style/RegexpLiteral: ...@@ -42,3 +205,33 @@ Style/RegexpLiteral:
- 'spec/unit/external_sources/path_source_spec.rb' - 'spec/unit/external_sources/path_source_spec.rb'
- 'spec/unit/external_sources/podspec_source_spec.rb' - 'spec/unit/external_sources/podspec_source_spec.rb'
- 'spec/unit/resolver_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 ...@@ -123,8 +123,6 @@ GEM
tzinfo (~> 1.1) tzinfo (~> 1.1)
addressable (2.3.6) addressable (2.3.6)
ast (2.2.0) ast (2.2.0)
astrolabe (1.3.1)
parser (~> 2.2)
awesome_print (1.6.1) awesome_print (1.6.1)
bacon (1.2.0) bacon (1.2.0)
clintegracon (0.8.1) clintegracon (0.8.1)
...@@ -169,7 +167,7 @@ GEM ...@@ -169,7 +167,7 @@ GEM
nap (1.1.0) nap (1.1.0)
netrc (0.7.8) netrc (0.7.8)
notify (0.5.2) notify (0.5.2)
parser (2.3.0.2) parser (2.3.0.6)
ast (~> 2.2) ast (~> 2.2)
powerpack (0.1.1) powerpack (0.1.1)
prettybacon (0.0.2) prettybacon (0.0.2)
...@@ -178,19 +176,19 @@ GEM ...@@ -178,19 +176,19 @@ GEM
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.8.1) method_source (~> 0.8.1)
slop (~> 3.4) slop (~> 3.4)
rainbow (2.0.0) rainbow (2.1.0)
rake (10.4.2) rake (10.4.2)
rb-fsevent (0.9.4) rb-fsevent (0.9.4)
rb-inotify (0.9.5) rb-inotify (0.9.5)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rb-kqueue (0.2.3) rb-kqueue (0.2.3)
ffi (>= 0.5.0) ffi (>= 0.5.0)
rubocop (0.34.2) rubocop (0.37.2)
astrolabe (~> 1.3) parser (>= 2.3.0.4, < 3.0)
parser (>= 2.2.2.5, < 3.0)
powerpack (~> 0.1) powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0) 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-graphviz (1.2.2)
ruby-prof (0.15.2) ruby-prof (0.15.2)
ruby-progressbar (1.7.5) ruby-progressbar (1.7.5)
...@@ -203,6 +201,7 @@ GEM ...@@ -203,6 +201,7 @@ GEM
tins (1.8.1) tins (1.8.1)
tzinfo (1.2.2) tzinfo (1.2.2)
thread_safe (~> 0.1) thread_safe (~> 0.1)
unicode-display_width (0.3.1)
webmock (1.20.4) webmock (1.20.4)
addressable (>= 2.3.6) addressable (>= 2.3.6)
crack (>= 0.3.2) crack (>= 0.3.2)
......
...@@ -198,7 +198,7 @@ begin ...@@ -198,7 +198,7 @@ begin
desc 'Rebuilds integration fixtures' desc 'Rebuilds integration fixtures'
task :rebuild_integration_fixtures do 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.') puts red('[!] Mercurial (`hg`) must be installed to rebuild the integration fixtures.')
exit 1 exit 1
end end
......
...@@ -37,7 +37,7 @@ module Pod ...@@ -37,7 +37,7 @@ module Pod
def validate! def validate!
super super
help! 'A name for the Pod is required.' unless @name 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] == '.' help! "The Pod name cannot begin with a '.'" if @name[0, 1] == '.'
end end
......
...@@ -135,13 +135,13 @@ module Pod ...@@ -135,13 +135,13 @@ module Pod
!lockfile_roots.include?(pod) !lockfile_roots.include?(pod)
end end
if missing_pods.length > 0 unless missing_pods.empty?
if missing_pods.length > 1 message = if missing_pods.length > 1
message = "Pods `#{missing_pods.join('`, `')}` are not " \ "Pods `#{missing_pods.join('`, `')}` are not " \
'installed and cannot be updated' 'installed and cannot be updated'
else else
message = "The `#{missing_pods.first}` Pod is not installed " \ "The `#{missing_pods.first}` Pod is not installed " \
'and cannot be updated' 'and cannot be updated'
end end
raise Informative, message raise Informative, message
end end
......
...@@ -43,7 +43,7 @@ module Pod ...@@ -43,7 +43,7 @@ module Pod
# #
def podspec_uri def podspec_uri
declared_path = params[:podspec].to_s declared_path = params[:podspec].to_s
if declared_path.match(%r{^.+://}) if declared_path =~ %r{^.+://}
declared_path declared_path
else else
normalized_podspec_path(declared_path) normalized_podspec_path(declared_path)
......
# rubocop:disable LineLength
module Pod module Pod
module Generator module Generator
class CopyResourcesScript class CopyResourcesScript
......
...@@ -552,12 +552,10 @@ module Pod ...@@ -552,12 +552,10 @@ module Pod
# #
def prepare_pods_project def prepare_pods_project
UI.message '- Creating Pods project' do UI.message '- Creating Pods project' do
object_version = aggregate_targets.map(&:user_project).compact.map { |p| p.object_version.to_i }.min @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)
if object_version else
@pods_project = Pod::Project.new(sandbox.project_path, false, object_version) Pod::Project.new(sandbox.project_path)
else
@pods_project = Pod::Project.new(sandbox.project_path)
end end
analysis_result.all_user_build_configurations.each do |name, type| analysis_result.all_user_build_configurations.each do |name, type|
......
...@@ -470,10 +470,10 @@ module Pod ...@@ -470,10 +470,10 @@ module Pod
def fetch_external_source(dependency, use_lockfile_options) def fetch_external_source(dependency, use_lockfile_options)
checkout_options = lockfile.checkout_options_for_pod_named(dependency.root_name) if lockfile checkout_options = lockfile.checkout_options_for_pod_named(dependency.root_name) if lockfile
if checkout_options && use_lockfile_options source = if checkout_options && use_lockfile_options
source = ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file) ExternalSources.from_params(checkout_options, dependency, podfile.defined_in_file)
else else
source = ExternalSources.from_dependency(dependency, podfile.defined_in_file) ExternalSources.from_dependency(dependency, podfile.defined_in_file)
end end
source.can_cache = installation_options.clean? source.can_cache = installation_options.clean?
source.fetch(sandbox) source.fetch(sandbox)
......
...@@ -94,12 +94,12 @@ module Pod ...@@ -94,12 +94,12 @@ module Pod
def scope_by_specs def scope_by_specs
root_spec = variants.first.root_spec root_spec = variants.first.root_spec
specs = [root_spec] specs = [root_spec]
if root_spec.default_subspecs.empty? specs += if root_spec.default_subspecs.empty?
specs += root_spec.subspecs.compact root_spec.subspecs.compact
else 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}") root_spec.subspec_by_name("#{root_spec.name}/#{subspec_name}")
end end
end end
default_specs = Set.new(specs) default_specs = Set.new(specs)
grouped_variants = group_by(&:specs) grouped_variants = group_by(&:specs)
......
...@@ -24,12 +24,12 @@ module Pod ...@@ -24,12 +24,12 @@ module Pod
create_info_plist_file create_info_plist_file
create_module_map create_module_map
create_umbrella_header do |generator| create_umbrella_header do |generator|
if header_mappings_dir generator.imports += if header_mappings_dir
generator.imports += target.file_accessors.flat_map(&:public_headers).map do |pathname| target.file_accessors.flat_map(&:public_headers).map do |pathname|
pathname.relative_path_from(header_mappings_dir) pathname.relative_path_from(header_mappings_dir)
end end
else else
generator.imports += target.file_accessors.flat_map(&:public_headers).map(&:basename) target.file_accessors.flat_map(&:public_headers).map(&:basename)
end end
end end
end end
......
...@@ -218,12 +218,12 @@ module Pod ...@@ -218,12 +218,12 @@ module Pod
build_phases.find { |phase| phase.name == prefixed_phase_name } || build_phases.find { |phase| phase.name == prefixed_phase_name } ||
build_phases.find { |phase| phase.name == phase_name }.tap { |p| p.name = prefixed_phase_name if p } || build_phases.find { |phase| phase.name == phase_name }.tap { |p| p.name = prefixed_phase_name if p } ||
target.project.new(phase_class).tap do |phase| target.project.new(phase_class).tap do |phase|
UI.message("Adding Build Phase '#{prefixed_phase_name}' to project.") do UI.message("Adding Build Phase '#{prefixed_phase_name}' to project.") do
phase.name = prefixed_phase_name phase.name = prefixed_phase_name
phase.show_env_vars_in_log = '0' phase.show_env_vars_in_log = '0'
target.build_phases << phase target.build_phases << phase
end
end end
end
end end
end end
end end
......
...@@ -49,7 +49,7 @@ module Pod ...@@ -49,7 +49,7 @@ module Pod
phase = target.shell_script_build_phases.find { |bp| bp.name == phase_name } phase = target.shell_script_build_phases.find { |bp| bp.name == phase_name }
phase.shell_script = %("${SRCROOT}/../Pods/Pods-resources.sh"\n) phase.shell_script = %("${SRCROOT}/../Pods/Pods-resources.sh"\n)
@target_integrator.integrate! @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 end
it 'adds references to the Pods static libraries to the Frameworks group' do it 'adds references to the Pods static libraries to the Frameworks group' do
...@@ -85,7 +85,7 @@ module Pod ...@@ -85,7 +85,7 @@ module Pod
target = @target_integrator.send(:native_targets).first target = @target_integrator.send(:native_targets).first
phase_name = @phase_prefix + Installer::UserProjectIntegrator::TargetIntegrator::COPY_PODS_RESOURCES_PHASE_NAME 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 = 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 end
it 'adds a Check Manifest.lock build phase to each target' do 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