Bump rubocop from 1.18.4 to 1.19.0 (#14489)

* Bump rubocop from 1.18.4 to 1.19.0

Bumps [rubocop](https://github.com/rubocop/rubocop) from 1.18.4 to 1.19.0.
- [Release notes](https://github.com/rubocop/rubocop/releases)
- [Changelog](https://github.com/rubocop/rubocop/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rubocop/rubocop/compare/v1.18.4...v1.19.0)

---
updated-dependencies:
- dependency-name: rubocop
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Rubocop autofixes

* Manually fix some Rubocop warnings/errors

* How about another coffee, Michael?

* Maybe Rubocop needs a coffee too

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Michael Kohl <citizen428@forem.com>
This commit is contained in:
dependabot[bot] 2021-08-13 13:14:59 +07:00 committed by GitHub
parent 80096f63a7
commit f0093c5338
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
15 changed files with 18 additions and 14 deletions

View file

@ -147,7 +147,7 @@ group :development, :test do
gem "knapsack_pro", "~> 3.0.0" # Help parallelize Ruby spec builds
gem "pry-byebug", "~> 3.8" # Combine 'pry' with 'byebug'. Adds 'step', 'next', 'finish', 'continue' and 'break' commands to control execution
gem "rspec-rails", "~> 5.0" # rspec-rails is a testing framework for Rails 3+
gem "rubocop", "~> 1.18", require: false # Automatic Ruby code style checking tool
gem "rubocop", "~> 1.19", require: false # Automatic Ruby code style checking tool
gem "rubocop-performance", "~> 1.11", require: false # A collection of RuboCop cops to check for performance optimizations in Ruby code
gem "rubocop-rails", "~> 2.11", require: false # Automatic Rails code style checking tool
gem "rubocop-rspec", "~> 2.4", require: false # Code style checking for RSpec files

View file

@ -650,16 +650,16 @@ GEM
rspec-retry (0.6.2)
rspec-core (> 3.3)
rspec-support (3.10.2)
rubocop (1.18.4)
rubocop (1.19.0)
parallel (~> 1.10)
parser (>= 3.0.0.0)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml
rubocop-ast (>= 1.8.0, < 2.0)
rubocop-ast (>= 1.9.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 1.4.0, < 3.0)
rubocop-ast (1.8.0)
rubocop-ast (1.10.0)
parser (>= 3.0.1.1)
rubocop-performance (1.11.4)
rubocop (>= 1.7.0, < 2.0)
@ -956,7 +956,7 @@ DEPENDENCIES
rpush-redis (~> 1.1)
rspec-rails (~> 5.0)
rspec-retry (~> 0.6)
rubocop (~> 1.18)
rubocop (~> 1.19)
rubocop-performance (~> 1.11)
rubocop-rails (~> 2.11)
rubocop-rspec (~> 2.4)

View file

@ -22,7 +22,7 @@ module ValidRequest
end
end
def _compute_redirect_to_location(request, options) #:nodoc:
def _compute_redirect_to_location(request, options) # :nodoc:
case options
# Yet another monkeypatch required to send proper protocol out.
# In this case we make sure the redirect ends in the app protocol.

View file

@ -60,7 +60,6 @@ class GithubTag
def fetch_readme(repository_path, repository_url)
readme_html = Github::OauthClient.new.readme(repository_path, accept: "application/vnd.github.html")
readme = Github::OauthClient.new.readme(repository_path)
clean_relative_path!(readme_html, repository_url)
rescue Github::Errors::NotFound
nil

View file

@ -59,7 +59,7 @@ class Tweet < ApplicationRecord
status = if status.retweeted_status.present?
TwitterClient::Client.status(status.retweeted_status.id.to_s)
else
status
status # rubocop:disable Style/RedundantSelfAssignmentBranch
end
params = { twitter_id_code: status.id.to_s }

View file

@ -10,7 +10,7 @@ module Notifications
# we explicitly symbolize_keys because FollowData.new will fail otherwise with an error of
# ":followable_id is missing in Hash input". FollowData expects a symbol, not a string.
follow_data.symbolize_keys!
follow_data = follow_data.is_a?(FollowData) ? follow_data : FollowData.new(follow_data)
follow_data = FollowData.new(follow_data) unless follow_data.is_a?(FollowData)
@followable_id = follow_data.followable_id # fetch(:followable_id)
@followable_type = follow_data.followable_type # fetch(:followable_type)
@follower_id = follow_data.follower_id # fetch(:follower_id)

View file

@ -2,6 +2,7 @@ class BaseUploader < CarrierWave::Uploader::Base
include CarrierWave::BombShelter # limits size to 4096x4096
include CarrierWave::MiniMagick # adds processing operations
EXTENSION_ALLOWLIST = %w[jpg jpeg jpe gif png ico bmp dng].freeze
FRAME_MAX = 500
FRAME_STRIP_MAX = 150
@ -14,11 +15,11 @@ class BaseUploader < CarrierWave::Uploader::Base
end
def extension_allowlist
%w[jpg jpeg jpe gif png ico bmp dng]
EXTENSION_ALLOWLIST
end
def size_range
1..25.megabytes
1..(25.megabytes)
end
protected

View file

@ -4,7 +4,7 @@ class ProfileImageUploader < BaseUploader
end
def size_range
1..2.megabytes
1..(2.megabytes)
end
protected

View file

@ -12,7 +12,7 @@ class SettingsModelGenerator < Rails::Generators::NamedBase
@migrations = false
def self.next_migration_number(dirname) #:nodoc:
def self.next_migration_number(dirname) # :nodoc:
if ActiveRecord::Base.timestamped_migrations
if @migrations
(current_migration_number(dirname) + 1)

View file

@ -63,6 +63,7 @@ RSpec.describe Profile, type: :model do
profile.website_url = nil
expect(profile).to be_valid
end
it "is valid with a complete url" do
profile.website_url = "https://dev.to"
expect(profile).to be_valid

View file

@ -1,5 +1,6 @@
require "rails_helper"
# rubocop:disable RSpec/NestedGroups
RSpec.describe "Stories::TaggedArticlesIndex", type: :request do
%i[enable disable].each do |method|
context "when :optimize_article_tag_query is #{method}d" do
@ -92,7 +93,8 @@ RSpec.describe "Stories::TaggedArticlesIndex", type: :request do
it "shows meta keywords if set" do
allow(Settings::General).to receive(:meta_keywords).and_return({ tag: "software engineering, ruby" })
get "/t/#{tag.name}"
expect(response.body).to include("<meta name=\"keywords\" content=\"software engineering, ruby, #{tag.name}\">")
expect(response.body)
.to include("<meta name=\"keywords\" content=\"software engineering, ruby, #{tag.name}\">")
end
it "does not show meta keywords if not set" do
@ -223,3 +225,4 @@ RSpec.describe "Stories::TaggedArticlesIndex", type: :request do
end
end
end
# rubocop:enable RSpec/NestedGroups

Binary file not shown.

BIN
vendor/cache/rubocop-1.19.0.gem vendored Normal file

Binary file not shown.

BIN
vendor/cache/rubocop-ast-1.10.0.gem vendored Normal file

Binary file not shown.

Binary file not shown.