diowa / icare

Open Source Carpooling Platform
BSD 2-Clause "Simplified" License
242 stars 142 forks source link

[WIP] Change RuboCop defaults #485

Open tagliala opened 4 years ago

tagliala commented 4 years ago
Cop Proposed Change Reasons (max 3)
Layout/ExtraSpacing AllowForAlignment: false Preserve blame; minimize history changes
Layout/HashAlignment EnforcedColonStyle: key (default) Preserve blame; minimize history changes
Style/StringLiterals EnforcedStyle: double_quotes Improve search; uniformity
Style/SymbolArray EnforcedStyle: brackets Improve search; uniformity
Style/TrailingCommaInArrayLiteral EnforcedStyleForMultiline: consistent_comma Preserve blame; minimize history changes
Style/TrailingCommaInHashLiteral EnforcedStyleForMultiline: consistent_comma Preserve blame; minimize history changes
Style/WordArray EnforcedStyle: brackets Improve search; uniformity

Checklist

Before

# Layout/ExtraSpacing, Style/StringLiterals
foo    = 'foo'
foobar = 'foobar'

# Layout/HashAlignment, Style/Style/TrailingCommaInHash
hashie = {
  foo:    :foo,
  foobar: :foobar
}

# Style/SymbolArray
sym_arr = %i[one two three]

# Style/TrailingCommaInArray
sym_arr_ml = [
  :one,
  :two,
  :three
]

# Style/WordArray
sym_arr = %w[one two three]

After

# Layout/ExtraSpacing, Style/StringLiterals
foo = "foo"
foobar = "foobar"

# Layout/HashAlignment, Style/Style/TrailingCommaInHash
hashie = {
  foo: :foo,
  foobar: :foobar,
}

# Style/SymbolArray
sym_arr = [:one, :two, :three]

# Style/TrailingCommaInArray
sym_arr = [
  :one,
  :two,
  :three,
]

# Style/WordArray
sym_arr = ["one", "two", "three"]
Layout/ExtraSpacing:
  AllowForAlignment: false

Layout/HashAlignment:
  EnforcedColonStyle: key

Style/StringLiterals:
  EnforcedStyle: double_quotes

Style/SymbolArray:
  EnforcedStyle: brackets

Style/TrailingCommaInArrayLiteral:
  EnforcedStyleForMultiline: consistent_comma

Style/TrailingCommaInHashLiteral:
  EnforcedStyleForMultiline: consistent_comma

Style/WordArray:
  EnforcedStyle: brackets
tagliala commented 4 years ago

@cesidio about Style/StringLiterals, I think that it took ~10 years to convince us, but we have lost the battle since standard and stylelint are preferring single quotes