Bump rubocop-rails from 2.9.1 to 2.10.0 (#13655)
* Bump rubocop-rails from 2.9.1 to 2.10.0 Bumps [rubocop-rails](https://github.com/rubocop/rubocop-rails) from 2.9.1 to 2.10.0. - [Release notes](https://github.com/rubocop/rubocop-rails/releases) - [Changelog](https://github.com/rubocop/rubocop-rails/blob/master/CHANGELOG.md) - [Commits](https://github.com/rubocop/rubocop-rails/compare/v2.9.1...v2.10.0) Signed-off-by: dependabot[bot] <support@github.com> * Add new cops and fix violations Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: rhymes <rhymes@hey.com>
This commit is contained in:
parent
cf538f83c8
commit
9066de9b65
7 changed files with 28 additions and 5 deletions
21
.rubocop.yml
21
.rubocop.yml
|
|
@ -751,6 +751,10 @@ Rails/DefaultScope:
|
|||
StyleGuide: 'https://rails.rubystyle.guide#avoid-default-scope'
|
||||
Enabled: true
|
||||
|
||||
Rails/EnvironmentVariableAccess:
|
||||
Description: 'Do not access `ENV` directly after initialization.'
|
||||
Enabled: false
|
||||
|
||||
Rails/FilePath:
|
||||
EnforcedStyle: slashes
|
||||
|
||||
|
|
@ -805,6 +809,18 @@ Rails/RenderPlainText:
|
|||
StyleGuide: 'https://rails.rubystyle.guide/#plain-text-rendering'
|
||||
Enabled: true
|
||||
|
||||
# TODO: enable this once all loader related deprecations on console/server startup are dealt with
|
||||
Rails/RequireDependency:
|
||||
Description: 'Do not use `require_dependency` when running in Zeitwerk mode. `require_dependency` is for autoloading in classic mode.'
|
||||
Reference: 'https://guides.rubyonrails.org/autoloading_and_reloading_constants.html'
|
||||
Enabled: false
|
||||
|
||||
Rails/ReversibleMigrationMethodDefinition:
|
||||
Description: 'Checks whether the migration implements either a `change` method or both an `up` and a `down` method.'
|
||||
Enabled: true
|
||||
Include:
|
||||
- db/migrate/*.rb
|
||||
|
||||
Rails/ShortI18n:
|
||||
Description: 'Use the short form of the I18n methods: `t` instead of `translate` and `l` instead of `localize`.'
|
||||
StyleGuide: 'https://rails.rubystyle.guide/#short-i18n'
|
||||
|
|
@ -820,6 +836,11 @@ Rails/SkipsModelValidations:
|
|||
Rails/SquishedSQLHeredocs:
|
||||
Enabled: false
|
||||
|
||||
Rails/TimeZoneAssignment:
|
||||
Description: 'Prefer the usage of `Time.use_zone` instead of manually updating `Time.zone` value.'
|
||||
Reference: 'https://thoughtbot.com/blog/its-about-time-zones'
|
||||
Enabled: true
|
||||
|
||||
Rails/WhereExists:
|
||||
Description: 'Prefer `exists?(...)` over `where(...).exists?`.'
|
||||
Enabled: true
|
||||
|
|
|
|||
2
Gemfile
2
Gemfile
|
|
@ -149,7 +149,7 @@ group :development, :test do
|
|||
gem "rspec-rails", "~> 5.0" # rspec-rails is a testing framework for Rails 3+
|
||||
gem "rubocop", "~> 1.13", 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.9", require: false # Automatic Rails code style checking tool
|
||||
gem "rubocop-rails", "~> 2.10", require: false # Automatic Rails code style checking tool
|
||||
gem "rubocop-rspec", "~> 2.3", require: false # Code style checking for RSpec files
|
||||
gem "sassc-rails", "~> 2.1.2" # Integrate SassC-Ruby into Rails
|
||||
gem "spring", "~> 2.1" # Preloads your application so things like console, rake and tests run faster
|
||||
|
|
|
|||
|
|
@ -661,10 +661,10 @@ GEM
|
|||
rubocop-performance (1.11.2)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-ast (>= 0.4.0)
|
||||
rubocop-rails (2.9.1)
|
||||
rubocop-rails (2.10.0)
|
||||
activesupport (>= 4.2.0)
|
||||
rack (>= 1.1)
|
||||
rubocop (>= 0.90.0, < 2.0)
|
||||
rubocop (>= 1.7.0, < 2.0)
|
||||
rubocop-rspec (2.3.0)
|
||||
rubocop (~> 1.0)
|
||||
rubocop-ast (>= 1.1.0)
|
||||
|
|
@ -953,7 +953,7 @@ DEPENDENCIES
|
|||
rspec-retry (~> 0.6)
|
||||
rubocop (~> 1.13)
|
||||
rubocop-performance (~> 1.11)
|
||||
rubocop-rails (~> 2.9)
|
||||
rubocop-rails (~> 2.10)
|
||||
rubocop-rspec (~> 2.3)
|
||||
ruby-prof (~> 1.4)
|
||||
rubyzip (~> 2.3)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,13 @@
|
|||
module EdgeCache
|
||||
class BustArticle
|
||||
# rubocop:disable Rails/RelativeDateConstant
|
||||
TIMEFRAMES = [
|
||||
[-> { 1.week.ago }, "week"],
|
||||
[-> { 1.month.ago }, "month"],
|
||||
[-> { 1.year.ago }, "year"],
|
||||
[-> { 5.years.ago }, "infinity"],
|
||||
].freeze
|
||||
# rubocop:enable Rails/RelativeDateConstant
|
||||
|
||||
def self.call(article)
|
||||
return unless article
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@ RSpec.describe "Metrics Overview task", type: :task do
|
|||
describe "#overview" do
|
||||
let(:event_name) { "Admin Overview Link Clicked" }
|
||||
let(:click_target) { "https://forem.gitbook.io/forem-admin-guide/quick-start-guide" }
|
||||
let(:host) { ENV['APP_DOMAIN'] }
|
||||
let(:host) { ENV["APP_DOMAIN"] }
|
||||
|
||||
it "returns the event count and target for admin overview events" do
|
||||
create(:ahoy_event, name: event_name, properties: {
|
||||
|
|
|
|||
BIN
vendor/cache/rubocop-rails-2.10.0.gem
vendored
Normal file
BIN
vendor/cache/rubocop-rails-2.10.0.gem
vendored
Normal file
Binary file not shown.
BIN
vendor/cache/rubocop-rails-2.9.1.gem
vendored
BIN
vendor/cache/rubocop-rails-2.9.1.gem
vendored
Binary file not shown.
Loading…
Add table
Reference in a new issue