diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..c5d3610 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,42 @@ +AllCops: + # TargetRubyVersion value is based on `required_ruby_version = '>= 2.3'` in the ransack.gemspec + TargetRubyVersion: 2.3 + + DisabledByDefault: true + +Layout/EmptyLineAfterMagicComment: + Enabled: true + +Layout/EmptyLineBetweenDefs: + Enabled: true + +Layout/EmptyLines: + Enabled: true + +Layout/FirstArrayElementIndentation: + EnforcedStyle: consistent + +Layout/SpaceAfterComma: + Enabled: true + +Layout/SpaceInsideBlockBraces: + Enabled: true + +Layout/SpaceInsideHashLiteralBraces: + Enabled: true + +Layout/SpaceInsideParens: + Enabled: true + +Layout/TrailingEmptyLines: + Enabled: true + +Style/RedundantReturn: + Enabled: true + +Style/SelfAssignment: + Enabled: true + +Style/Semicolon: + Enabled: true + diff --git a/Gemfile b/Gemfile index ea198d7..633fd2e 100644 --- a/Gemfile +++ b/Gemfile @@ -49,3 +49,8 @@ group :test do gem 'rspec', '~> 3' gem 'simplecov', :require => false end + +# RuboCop 0.81.0 is the last version which supports Ruby 2.3. +# Once Ransack required_ruby_version is bumped, RuboCop version can be bumped. +# https://github.com/rubocop-hq/rubocop/pull/7869 +gem 'rubocop', '=0.81.0', require: false