diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index a1a7169f0..bdc2ac1f2 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -1,6 +1,6 @@ # This configuration was generated by # `rubocop --auto-gen-config` -# on 2019-07-01 18:50:42 +0200 using RuboCop version 0.72.0. +# on 2019-07-30 17:22:03 +0200 using RuboCop version 0.73.0. # 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 @@ -12,16 +12,16 @@ Metrics/BlockLength: Max: 63 -# Offense count: 24 +# Offense count: 25 Metrics/PerceivedComplexity: - Max: 15 + Max: 13 # Offense count: 1 RSpec/AnyInstance: Exclude: - 'spec/requests/stripe_cancellations_spec.rb' -# Offense count: 281 +# Offense count: 343 # Configuration parameters: AggregateFailuresByDefault. RSpec/MultipleExpectations: Max: 8 @@ -47,9 +47,8 @@ Rails/OutputSafety: - 'app/models/message.rb' - 'app/views/api/v0/articles/show.json.jbuilder' - 'app/views/articles/feed.rss.builder' - - 'app/views/podcast_episodes/show.html.erb' -# Offense count: 17 +# Offense count: 19 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, EnforcedStyle. # SupportedStyles: nested, compact @@ -62,7 +61,7 @@ Style/GuardClause: Exclude: - 'app/models/article.rb' -# Offense count: 2463 +# Offense count: 2642 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https diff --git a/Gemfile.lock b/Gemfile.lock index f17666c54..04f2743fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -645,12 +645,12 @@ GEM rainbow (>= 2.2.2, < 4.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 1.7) - rubocop-performance (1.4.0) + rubocop-performance (1.4.1) rubocop (>= 0.71.0) - rubocop-rails (2.2.0) + rubocop-rails (2.2.1) rack (>= 1.1) rubocop (>= 0.72.0) - rubocop-rspec (1.33.0) + rubocop-rspec (1.34.0) rubocop (>= 0.60.0) ruby-prof (0.18.0) ruby-progressbar (1.10.1) diff --git a/app/controllers/api/v0/follows_controller.rb b/app/controllers/api/v0/follows_controller.rb index 9b9e4d09b..145e3b498 100644 --- a/app/controllers/api/v0/follows_controller.rb +++ b/app/controllers/api/v0/follows_controller.rb @@ -3,7 +3,7 @@ module Api class FollowsController < ApplicationController def create return unless user_signed_in? - + user_ids = params[:users].map { |h| h["id"] } users = User.where(id: user_ids) users.each do |user| diff --git a/spec/labor/user_similarity_spec.rb b/spec/labor/user_similarity_spec.rb index 1d371625f..5024929d0 100644 --- a/spec/labor/user_similarity_spec.rb +++ b/spec/labor/user_similarity_spec.rb @@ -6,24 +6,24 @@ RSpec.describe UserSimilarity, vcr: {} do let(:dissimilar_user) { create(:user, summary: "I like Haskell and functional programming") } it "returns similar user" do - similar_score = UserSimilarity.new(user, similar_user).score - dissimilar_score = UserSimilarity.new(user, dissimilar_user).score + similar_score = described_class.new(user, similar_user).score + dissimilar_score = described_class.new(user, dissimilar_user).score expect(similar_score).to be > dissimilar_score end it "Is not affected by stop words" do user.summary = user.summary + " throughout yourself can indeed otherwise thru yourselves through yours by inc others" dissimilar_user.summary = dissimilar_user.summary + " throughout yourself can indeed otherwise thru yourselves through yours by inc others" - similar_score = UserSimilarity.new(user, similar_user).score - dissimilar_score = UserSimilarity.new(user, dissimilar_user).score + similar_score = described_class.new(user, similar_user).score + dissimilar_score = described_class.new(user, dissimilar_user).score expect(similar_score).to be > dissimilar_score end it "Is affected by non-stop words" do user.summary = "Hot dogs languages punk rock hello" dissimilar_user.summary = "Hot dogs languages punk rock hello " - similar_score = UserSimilarity.new(user, similar_user).score - dissimilar_score = UserSimilarity.new(user, dissimilar_user).score + similar_score = described_class.new(user, similar_user).score + dissimilar_score = described_class.new(user, dissimilar_user).score expect(similar_score).to be < dissimilar_score end end diff --git a/spec/liquid_tags/dev_comment_tag_spec.rb b/spec/liquid_tags/dev_comment_tag_spec.rb index c5ab7d237..e3a79e191 100644 --- a/spec/liquid_tags/dev_comment_tag_spec.rb +++ b/spec/liquid_tags/dev_comment_tag_spec.rb @@ -5,7 +5,7 @@ RSpec.describe DevCommentTag, type: :liquid_template do let(:article) { create(:article) } let(:comment) { create(:comment, commentable: article, body_markdown: "DevCommentTagTest", user: user) } - setup { Liquid::Template.register_tag("devcomment", DevCommentTag) } + setup { Liquid::Template.register_tag("devcomment", described_class) } def generate_comment_tag(id_code) Liquid::Template.parse("{% devcomment #{id_code} %}") diff --git a/spec/liquid_tags/link_tag_spec.rb b/spec/liquid_tags/link_tag_spec.rb index 9345b33e8..e89fe7599 100644 --- a/spec/liquid_tags/link_tag_spec.rb +++ b/spec/liquid_tags/link_tag_spec.rb @@ -9,10 +9,10 @@ RSpec.describe LinkTag, type: :liquid_template do let(:org_user) { create(:user, organization_id: org.id) } let(:org_article) do create(:article, user_id: org_user.id, title: "test this please", tags: "tag1 tag2 tag3", - organization_id: org.id) + organization_id: org.id) end let(:escaped_article) do - create(:article, user_id: user.id, title: "Hello & Hi <3