Skip to content

Commit

Permalink
update_attributes to update
Browse files Browse the repository at this point in the history
  • Loading branch information
jasl committed May 16, 2019
1 parent cec2eaf commit 6360009
Show file tree
Hide file tree
Showing 4 changed files with 199 additions and 112 deletions.
171 changes: 131 additions & 40 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,51 @@
require: rubocop-performance

inherit_gem:
rubocop-rails_config:
- config/rails.yml

AllCops:
TargetRubyVersion: 2.5
Exclude:
- bin/**/*
- test/dummy/bin/**/*
- test/dummy/db/schema.rb

Rails:
Enabled: false

Metrics/LineLength:
Max: 150

# frozen_string_literal: true
Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: when_needed
Metrics/MethodLength:
Max: 100

Metrics/BlockLength:
Max: 50

Metrics/ClassLength:
Enabled: false

Style/GuardClause:
Enabled: false

Style/Documentation:
Enabled: false

Style/ClassAndModuleChildren:
Enabled: false

Naming/AccessorMethodName:
Enabled: false

Naming/MemoizedInstanceVariableName:
Enabled: false

# Prefer assert_not over assert !
Rails/AssertNot:
Include:
- 'test/**/*'

# Prefer assert_not_x over refute_x
Rails/RefuteMethods:
Include:
- 'test/**/*'

# Prefer &&/|| over and/or.
Style/AndOr:
Expand All @@ -27,6 +55,7 @@ Style/AndOr:
# method call.
Style/BracesAroundHashParameters:
Enabled: true
EnforcedStyle: context_dependent

# Align `when` with `case`.
Layout/CaseIndentation:
Expand All @@ -36,8 +65,20 @@ Layout/CaseIndentation:
Layout/CommentIndentation:
Enabled: true

# No extra empty lines.
Layout/EmptyLines:
Layout/ElseAlignment:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
# assignments, where it should be aligned with the LHS.
Layout/EndAlignment:
Enabled: true
EnforcedStyleAlignWith: variable
AutoCorrect: true

Layout/EmptyLineAfterMagicComment:
Enabled: true

Layout/EmptyLinesAroundBlockBody:
Enabled: true

# In a regular class definition, no empty lines around the body.
Expand All @@ -52,26 +93,35 @@ Layout/EmptyLinesAroundMethodBody:
Layout/EmptyLinesAroundModuleBody:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer {a: :b} over { :a => :b }.
Layout/IndentFirstArgument:
Enabled: true

# Use Ruby >= 1.9 syntax for hashes. Prefer { a: :b } over { :a => :b }.
Style/HashSyntax:
Enabled: true

# Method definitions after `private` or `protected` isolated calls need one
# extra level of indentation.
Layout/IndentationConsistency:
Enabled: true
EnforcedStyle: normal
EnforcedStyle: rails

# Two spaces, no tabs (for indentation).
Layout/IndentationWidth:
Enabled: true

Layout/LeadingCommentSpace:
Enabled: true

Layout/SpaceAfterColon:
Enabled: true

Layout/SpaceAfterComma:
Enabled: true

Layout/SpaceAfterSemicolon:
Enabled: true

Layout/SpaceAroundEqualsInParameterDefault:
Enabled: true

Expand All @@ -81,24 +131,38 @@ Layout/SpaceAroundKeyword:
Layout/SpaceAroundOperators:
Enabled: true

Layout/SpaceBeforeComma:
Enabled: true

Layout/SpaceBeforeFirstArg:
Enabled: true

Style/DefWithParentheses:
Enabled: true

# Defining a method with parameters needs parentheses.
Style/MethodDefParentheses:
Enabled: true

Style/FrozenStringLiteralComment:
Enabled: true
EnforcedStyle: always

Style/RedundantFreeze:
Enabled: true

# Use `foo {}` not `foo{}`.
Layout/SpaceBeforeBlockBraces:
Enabled: true

# Use `foo { bar }` not `foo {bar}`.
Layout/SpaceInsideBlockBraces:
Enabled: true
EnforcedStyleForEmptyBraces: space

# Use `{a: 1}` not `{ a:1 }`.
# Use `{ a: 1 }` not `{a:1}`.
Layout/SpaceInsideHashLiteralBraces:
Enabled: false
Enabled: true

Layout/SpaceInsideParens:
Enabled: true
Expand All @@ -124,45 +188,72 @@ Layout/TrailingWhitespace:
Style/UnneededPercentQ:
Enabled: true

# Align `end` with the matching keyword or starting expression except for
# assignments, where it should be aligned with the LHS.
Layout/EndAlignment:
Lint/AmbiguousOperator:
Enabled: true

Lint/AmbiguousRegexpLiteral:
Enabled: true

Lint/ErbNewArguments:
Enabled: true
EnforcedStyleAlignWith: variable

# Use my_method(my_arg) not my_method( my_arg ) or my_method my_arg.
Lint/RequireParentheses:
Enabled: true

Style/Documentation:
Enabled: false
Lint/ShadowingOuterLocalVariable:
Enabled: true

Metrics/MethodLength:
Enabled: false
Lint/StringConversionInInterpolation:
Enabled: true

Metrics/AbcSize:
Enabled: false
Lint/UriEscapeUnescape:
Enabled: true

Metrics/ParameterLists:
Enabled: false
Lint/UselessAssignment:
Enabled: true

Metrics/BlockLength:
Enabled: false
Lint/DeprecatedClassMethods:
Enabled: true

Lint/HandleExceptions:
Enabled: false
Style/ParenthesesAroundCondition:
Enabled: true

Metrics/ClassLength:
Enabled: false
Style/RedundantBegin:
Enabled: true

Layout/EmptyLinesAroundArguments:
Enabled: false
Style/RedundantReturn:
Enabled: true
AllowMultipleReturnValues: true

Style/ClassAndModuleChildren:
Enabled: false
Style/Semicolon:
Enabled: true
AllowAsExpressionSeparator: true

Naming/UncommunicativeMethodParamName:
Enabled: false
# Prefer Foo.method over Foo::method
Style/ColonMethodCall:
Enabled: true

Style/IfUnlessModifier:
Enabled: false
Style/TrivialAccessors:
Enabled: true

Performance/FlatMap:
Enabled: true

Performance/RedundantMerge:
Enabled: true

Performance/StartWith:
Enabled: true

Performance/EndWith:
Enabled: true

Performance/RegexpMatch:
Enabled: true

Performance/ReverseEach:
Enabled: true

Performance/UnfreezeString:
Enabled: true
3 changes: 1 addition & 2 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ gem "puma"
# For better console experience
gem "pry-rails"
# Access an IRB console on exception pages or by using <%= console %> anywhere in the code.
gem "web-console"
gem "listen", ">= 3.0.5", "< 3.2"
gem "web-console", group: :development
# Call "byebug" anywhere in the code to stop execution and get a debugger console
gem "pry-byebug"

gem "rubocop"
gem "rubocop-rails_config"
gem "rubocop-performance"
Loading

0 comments on commit 6360009

Please sign in to comment.