diff --git a/.rubocop.yml b/.rubocop.yml index aab259979..e0af6bc54 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -14,6 +14,7 @@ AllCops: - db/migrate/*.rb - node_modules/**/* - tmp/**/* + - vendor/**/* DisplayStyleGuide: true ExtraDetails: true TargetRubyVersion: 2.7 diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index f858c462b..10f9f1800 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -6,13 +6,13 @@ require: # This configuration was generated by # `rubocop --auto-gen-config` -# on 2020-05-22 10:44:28 +0200 using RuboCop version 0.84.0. +# on 2020-05-28 18:37:09 +0200 using RuboCop version 0.84.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 # versions of RuboCop, may require this file to be generated again. -# Offense count: 268 +# Offense count: 273 # Configuration parameters: IgnoredMethods. Metrics/AbcSize: Max: 64 @@ -40,7 +40,7 @@ RSpec/ExampleLength: - 'spec/models/comment_spec.rb' - 'spec/requests/display_ad_events_spec.rb' -# Offense count: 855 +# Offense count: 866 RSpec/MultipleExpectations: Max: 12 @@ -74,23 +74,15 @@ Rails/OutputSafety: - 'app/models/display_ad.rb' - 'app/models/message.rb' -# Offense count: 17 +# Offense count: 7 # Configuration parameters: Include. # Include: app/models/**/*.rb Rails/UniqueValidationWithoutIndex: Exclude: - 'app/models/article.rb' - - 'app/models/badge_achievement.rb' - - 'app/models/chat_channel.rb' - - 'app/models/chat_channel_membership.rb' - - 'app/models/collection.rb' - 'app/models/comment.rb' - - 'app/models/data_update_script.rb' - 'app/models/follow.rb' - - 'app/models/github_repo.rb' - 'app/models/notification.rb' - - 'app/models/organization.rb' - - 'app/models/response_template.rb' # Offense count: 33 # Cop supports --auto-correct. @@ -106,7 +98,7 @@ Style/SingleLineBlockParams: Exclude: - 'app/labor/markdown_fixer.rb' -# Offense count: 534 +# Offense count: 533 # Cop supports --auto-correct. # Configuration parameters: AutoCorrect, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns. # URISchemes: http, https diff --git a/app/liquid_tags/github_tag/github_readme_tag.rb b/app/liquid_tags/github_tag/github_readme_tag.rb index e812b7f00..031dff499 100644 --- a/app/liquid_tags/github_tag/github_readme_tag.rb +++ b/app/liquid_tags/github_tag/github_readme_tag.rb @@ -41,7 +41,7 @@ class GithubTag validate_options!(*options) - path.gsub!(%r{/\z}, "") # remove optional trailing forward slash + path.delete_suffix!("/") # remove optional trailing forward slash repository_path = URI.parse(path) repository_path.query = repository_path.fragment = nil diff --git a/spec/lib/data_update_scripts/re_index_feed_content_and_users_to_elasticsearch_spec.rb b/spec/lib/data_update_scripts/re_index_feed_content_and_users_to_elasticsearch_spec.rb index b580d0755..4e7cf15eb 100644 --- a/spec/lib/data_update_scripts/re_index_feed_content_and_users_to_elasticsearch_spec.rb +++ b/spec/lib/data_update_scripts/re_index_feed_content_and_users_to_elasticsearch_spec.rb @@ -1,5 +1,4 @@ # rubocop:disable RSpec/ExampleLength -# rubocop:disable RSpec/MultipleExpectations require "rails_helper" require Rails.root.join("lib/data_update_scripts/20200519142908_re_index_feed_content_and_users_to_elasticsearch.rb") @@ -33,4 +32,3 @@ describe DataUpdateScripts::ReIndexFeedContentAndUsersToElasticsearch do end end # rubocop:enable RSpec/ExampleLength -# rubocop:enable RSpec/MultipleExpectations diff --git a/spec/system/user/view_user_index_spec.rb b/spec/system/user/view_user_index_spec.rb index 6acc83a34..0de22353c 100644 --- a/spec/system/user/view_user_index_spec.rb +++ b/spec/system/user/view_user_index_spec.rb @@ -3,7 +3,7 @@ require "rails_helper" RSpec.describe "User index", type: :system do let!(:user) { create(:user, username: "user3000") } let!(:article) { create(:article, user: user) } - let!(:other_article) { create(:article, title: rand(10000000).to_s) } + let!(:other_article) { create(:article, title: rand(10_000_000).to_s) } let!(:comment) { create(:comment, user: user, commentable: other_article) } let(:organization) { create(:organization) }