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

Upgrade to Ruby 2.6 #671

Merged
merged 8 commits into from
Feb 6, 2021
Merged
Show file tree
Hide file tree
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
5 changes: 2 additions & 3 deletions .github/workflows/Specs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ jobs:
specs:
strategy:
matrix:
os: [ubuntu-16.04]
ruby: [2.3.3, 2.4, 2.5, 2.6, 2.7, 3.0]
os: [ubuntu-20.04]
ruby: [2.6, 2.7, 3.0]
include:
- os: macos-10.15
ruby: system
Expand All @@ -30,7 +30,6 @@ jobs:

- name: Run bundle install
run: |
gem install bundler -v "~> 1.17"
igor-makarov marked this conversation as resolved.
Show resolved Hide resolved
bundle config path vendor/bundle
bundle install --jobs 4 --retry 3 --without debugging documentation

Expand Down
7 changes: 6 additions & 1 deletion .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,17 @@ inherit_from:
#- Core -----------------------------------------------------------------------

AllCops:
TargetRubyVersion: 2.6
# RuboCop has a bunch of cops enabled by default. This setting tells RuboCop
# to ignore them, so only the ones explicitly set in this file are enabled.
DisabledByDefault: true
SuggestExtensions: false
Exclude:
- spec/fixtures/**/*
- vendor/bundle/**/*
- lib/cocoapods-core/vendor/**/*

FileName:
Naming/FileName:
Exclude:
- lib/cocoapods-core.rb

Expand Down
59 changes: 33 additions & 26 deletions .rubocop_cocoapods.yml
Original file line number Diff line number Diff line change
@@ -1,67 +1,74 @@
require:
jasl marked this conversation as resolved.
Show resolved Hide resolved
- rubocop-performance

AllCops:
Include:
- ./Rakefile
- ./Gemfile
- ./*.gemspec
- lib/**/*.rb
- spec/**/*.rb
- Rakefile
- Gemfile
- "*.gemspec"
Exclude:
- ./spec/fixtures/**/*
- ./vendor/bundle/**/*
- spec/fixtures/**/*
- vendor/bundle/**/*

# At the moment not ready to be used
# https://github.com/bbatsov/rubocop/issues/947
Documentation:
Style/Documentation:
Enabled: false

#- CocoaPods -----------------------------------------------------------------#

# We adopted raise instead of fail.
SignalException:
Style/SignalException:
EnforcedStyle: only_raise

# They are idiomatic
AssignmentInCondition:
Lint/AssignmentInCondition:
Enabled: false

# Allow backticks
AsciiComments:
Style/AsciiComments:
Enabled: false

# Indentation clarifies logic branches in implementations
IfUnlessModifier:
Style/IfUnlessModifier:
Enabled: false

# No enforced convention here.
SingleLineBlockParams:
Style/SingleLineBlockParams:
Enabled: false

# We only add the comment when needed.
Encoding:
Style/Encoding:
Enabled: false

# Having these make it easier to *not* forget to add one when adding a new
# value and you can simply copy the previous line.
Style/TrailingCommaInArguments:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInLiteral:
Style/TrailingCommaInArrayLiteral:
EnforcedStyleForMultiline: comma

Style/TrailingCommaInHashLiteral:
EnforcedStyleForMultiline: comma

Style/MultilineOperationIndentation:
Layout/MultilineOperationIndentation:
EnforcedStyle: indented

# Clashes with CLAide Command#validate!
GuardClause:
Style/GuardClause:
Enabled: false

# Not always desirable: lib/claide/command/plugins_helper.rb:12:15
Next:
Style/Next:
Enabled: false

# Autocorrect makes this cop much more useful, taking away needless guessing
Lint/EndAlignment:
Layout/EndAlignment:
AutoCorrect: true


# Arbitrary max lengths for classes simply do not work and enabling this will
# lead to a never ending stream of annoyance and changes.
Metrics/ClassLength:
Expand Down Expand Up @@ -98,16 +105,16 @@ Metrics/PerceivedComplexity:

#- CocoaPods support for Ruby 1.8.7 ------------------------------------------#

HashSyntax:
Style/HashSyntax:
EnforcedStyle: hash_rockets

Lambda:
Style/Lambda:
Enabled: false

DotPosition:
Layout/DotPosition:
EnforcedStyle: trailing

EachWithObject:
Style/EachWithObject:
Enabled: false

Style/SpecialGlobalVars:
Expand All @@ -116,7 +123,7 @@ Style/SpecialGlobalVars:
#- CocoaPods specs -----------------------------------------------------------#

# Allow for `should.match /regexp/`.
AmbiguousRegexpLiteral:
Lint/AmbiguousRegexpLiteral:
Exclude:
- spec/**/*

Expand All @@ -125,14 +132,14 @@ Performance/RedundantMatch:
- spec/**/*

# Allow `object.should == object` syntax.
Void:
Lint/Void:
Exclude:
- spec/**/*

ClassAndModuleChildren:
Style/ClassAndModuleChildren:
Exclude:
- spec/**/*

UselessComparison:
Lint/BinaryOperatorWithIdenticalOperands:
Exclude:
- spec/**/*
13 changes: 8 additions & 5 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
# Note that changes in the inspected code, or installation of new
# versions of RuboCop, may require this file to be generated again.

require:
- rubocop-performance

# Offense count: 5
Lint/IneffectiveAccessModifier:
Exclude:
Expand Down Expand Up @@ -34,7 +37,7 @@ Lint/UselessAccessModifier:
# Offense count: 474
# Configuration parameters: AllowHeredoc, AllowURI, URISchemes.
# URISchemes: http, https
Metrics/LineLength:
Layout/LineLength:
Max: 175

# Offense count: 2
Expand Down Expand Up @@ -77,7 +80,7 @@ Style/ConditionalAssignment:
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
Style/ExtraSpacing:
Layout/ExtraSpacing:
Exclude:
- 'spec/specification/dsl/attribute_support_spec.rb'

Expand All @@ -89,15 +92,15 @@ Style/IfInsideElse:
# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: IndentationWidth.
Style/IndentAssignment:
Layout/AssignmentIndentation:
Exclude:
- 'spec/specification/linter/result_spec.rb'

# Offense count: 1
# Cop supports --auto-correct.
# Configuration parameters: EnforcedStyle, SupportedStyles, IndentationWidth.
# SupportedStyles: aligned, indented
Style/MultilineMethodCallIndentation:
Layout/MultilineMethodCallIndentation:
Enabled: false

# Offense count: 4
Expand Down Expand Up @@ -129,6 +132,6 @@ Style/RedundantSelf:

# Offense count: 2
# Cop supports --auto-correct.
Style/UnneededInterpolation:
Style/RedundantInterpolation:
Exclude:
- 'lib/cocoapods-core/yaml_helper.rb'
3 changes: 2 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ group :development do
gem 'webmock'
gem 'webrick', '~> 1.7.0'

gem 'rubocop', '~> 0.38.0'
gem 'rubocop', '~> 1.8', :require => false
gem 'rubocop-performance', :require => false
end

group :debugging do
Expand Down
63 changes: 37 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,37 @@ PATH
remote: .
specs:
cocoapods-core (1.10.1)
activesupport (> 5.0, < 6)
activesupport (>= 5.0, < 7)
addressable (~> 2.6)
algoliasearch (~> 1.0)
concurrent-ruby (~> 1.1)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
netrc (~> 0.11)
public_suffix
public_suffix (~> 4.0)
typhoeus (~> 1.0)

GEM
remote: https://rubygems.org/
specs:
activesupport (5.2.4.4)
activesupport (6.1.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
tzinfo (~> 1.1)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
zeitwerk (~> 2.3)
addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0)
algoliasearch (1.27.5)
httpclient (~> 2.8, >= 2.8.3)
json (>= 1.5.1)
ast (2.4.0)
ast (2.4.1)
awesome_print (1.8.0)
bacon (1.2.0)
coderay (1.1.3)
concurrent-ruby (1.1.7)
crack (0.4.4)
crack (0.4.5)
rexml
ethon (0.12.0)
ffi (>= 1.3.0)
ffi (1.14.2)
Expand All @@ -57,43 +59,51 @@ GEM
nap (1.1.0)
netrc (0.11.0)
notify (0.5.2)
parser (2.7.1.3)
ast (~> 2.4.0)
powerpack (0.1.2)
parallel (1.20.1)
parser (3.0.0.0)
ast (~> 2.4.1)
prettybacon (0.0.2)
bacon (~> 1.2)
pry (0.13.1)
coderay (~> 1.1)
method_source (~> 1.0)
public_suffix (4.0.6)
rainbow (2.2.2)
rake
rainbow (3.0.0)
rake (12.3.3)
rb-fsevent (0.10.4)
rb-inotify (0.10.1)
ffi (~> 1.0)
rb-kqueue (0.2.5)
ffi (>= 0.5.0)
regexp_parser (2.0.3)
rexml (3.2.4)
rubocop (0.38.0)
parser (>= 2.3.0.6, < 3.0)
powerpack (~> 0.1)
rainbow (>= 1.99.1, < 3.0)
rubocop (1.8.1)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.2.0, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (~> 1.0, >= 1.0.1)
ruby-progressbar (1.10.1)
thread_safe (0.3.6)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.4.0)
parser (>= 2.7.1.5)
rubocop-performance (1.9.2)
rubocop (>= 0.90.0, < 2.0)
rubocop-ast (>= 0.4.0)
ruby-progressbar (1.11.0)
typhoeus (1.4.0)
ethon (>= 0.9.0)
tzinfo (1.2.9)
thread_safe (~> 0.1)
unicode-display_width (1.7.0)
tzinfo (2.0.4)
concurrent-ruby (~> 1.0)
unicode-display_width (2.0.0)
vcr (6.0.0)
webmock (3.11.0)
webmock (3.11.1)
addressable (>= 2.3.6)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.7.0)
zeitwerk (2.4.2)

PLATFORMS
ruby
Expand All @@ -110,10 +120,11 @@ DEPENDENCIES
rake (~> 12.0)
rb-fsevent
rexml (~> 3.2.4)
rubocop (~> 0.38.0)
rubocop (~> 1.8)
rubocop-performance
vcr
webmock
webrick (~> 1.7.0)

BUNDLED WITH
1.17.3
2.2.3
igor-makarov marked this conversation as resolved.
Show resolved Hide resolved
13 changes: 4 additions & 9 deletions cocoapods-core.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,22 +19,17 @@ Gem::Specification.new do |s|
s.files = Dir["lib/**/*.rb"] + %w{ README.md LICENSE }
s.require_paths = %w{ lib }

# 6.0 requires Ruby 2.5.0
s.add_runtime_dependency 'activesupport', '> 5.0', '< 6'
s.add_runtime_dependency 'activesupport', '>= 5.0', '< 7'
s.add_runtime_dependency 'nap', '~> 1.0'
s.add_runtime_dependency 'fuzzy_match', '~> 2.0.4'
s.add_runtime_dependency 'algoliasearch', '~> 1.0'
s.add_runtime_dependency 'concurrent-ruby', '~> 1.1'
s.add_runtime_dependency 'typhoeus', '~> 1.0'
s.add_runtime_dependency 'netrc', '~> 0.11'
s.add_runtime_dependency "addressable", '~> 2.6'
s.add_runtime_dependency "public_suffix"
s.add_runtime_dependency 'addressable', '~> 2.6'
s.add_runtime_dependency 'public_suffix', '~> 4.0'

s.add_development_dependency 'bacon', '~> 1.1'

## Make sure you can build the gem on older versions of RubyGems too:
s.rubygems_version = "1.6.2"
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.required_ruby_version = '>= 2.3.3'
s.specification_version = 3 if s.respond_to? :specification_version
s.required_ruby_version = '>= 2.6'
end
Loading