Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Change RuboCop defaults #485

Open
7 tasks
tagliala opened this issue May 12, 2020 · 1 comment
Open
7 tasks

[WIP] Change RuboCop defaults #485

tagliala opened this issue May 12, 2020 · 1 comment
Assignees

Comments

@tagliala
Copy link
Member

tagliala commented May 12, 2020

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

  • Layout/ExtraSpacing
  • Layout/HashAlignment
  • Style/StringLiterals
  • Style/SymbolArray
  • Style/TrailingCommaInArrayLiteral
  • Style/TrailingCommaInHashLiteral
  • Style/WordArray

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
Copy link
Member Author

tagliala commented Jun 6, 2020

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants