Enable Rubocop cops that our code already conforms to

I propose to enable Rubocop cops, that our codebase already conforms with. This is based on assumption that current shape of GitLab determines style, we would like to stick into.

Enabling more Rubocop cops offloads some work from merge request endbosses who spend some time on commenting style, which should be job for static analysis tools.

Currently we can enable quite a few cops (60), that already pass on CE.

List of cops to be enabled (edited as we go):

Style/ArrayJoin:
  Description: Use Array#join instead of Array#*.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
  Enabled: false
----------------
Style/Attr:
  Description: Checks for uses of Module#attr.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
  Enabled: false
----------------
Style/BlockComments:
  Description: Do not use block comments.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
  Enabled: false
----------------
Style/ClassMethods:
  Description: Use self when defining module/class methods.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-class-methods
  Enabled: false
----------------
Style/EndBlock:
  Description: Avoid the use of END blocks.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
  Enabled: false
----------------
Style/EvenOdd:
  Description: Favor the use of Fixnum#even? && Fixnum#odd?
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
  Enabled: false
----------------
Style/FileName:
  Description: Use snake_case for source file names.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
  Enabled: false
  Exclude: []
  ExpectMatchingDefinition: false
----------------
Style/FirstMethodParameterLineBreak:
  Description: Checks for a line break before the first parameter in a multi-line method
    parameter definition.
  Enabled: false
----------------
Style/FlipFlop:
  Description: Checks for flip flops
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
  Enabled: false
----------------
Style/GlobalVars:
  Description: Do not introduce global variables.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
  Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html
  Enabled: false
----------------
Style/IfWithSemicolon:
  Description: Do not use if x; .... Use the ternary operator instead.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
  Enabled: false
----------------
Style/LambdaCall:
  Description: Use lambda.call(...) instead of lambda.(...).
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
  Enabled: false
  EnforcedStyle: call
----------------
Style/MethodName:
  Description: Use the configured style when naming methods.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
  Enabled: false
  EnforcedStyle: snake_case
----------------
Style/MultilineMethodDefinitionBraceLayout:
  Description: Checks that the closing brace in a method definition is symmetrical with
    respect to the opening brace and the method parameters.
  Enabled: false
----------------
Style/NestedModifier:
  Description: Avoid using nested modifiers.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers
  Enabled: false
----------------
Style/OpMethod:
  Description: When defining binary operators, name the argument other.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
  Enabled: false
----------------
Style/SignalException:
  Description: Checks for proper usage of fail and raise.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail
  Enabled: false
  EnforcedStyle: only_raise
----------------
Style/SpaceAfterNot:
  Description: Tracks redundant space after the ! operator.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
  Enabled: false
----------------
Style/SpaceBeforeSemicolon:
  Description: No spaces before semicolons.
  Enabled: false
----------------
Style/SpaceInsideRangeLiteral:
  Description: No spaces inside range literals.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
  Enabled: false
----------------
Style/SpaceInsideStringInterpolation:
  Description: Checks for padding/surrounding spaces inside string interpolation.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation
  Enabled: false
  EnforcedStyle: no_space
----------------
Style/StabbyLambdaParentheses:
  Description: Check for the usage of parentheses around stabby lambda arguments.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args
  Enabled: false
  EnforcedStyle: require_parentheses
----------------
Style/StringMethods:
  Description: Checks if configured preferred methods are used over non-preferred.
  Enabled: false
  PreferredMethods:
    intern: to_sym
----------------
Style/VariableInterpolation:
  Description: Don't interpolate global, instance and class variables directly in strings.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
  Enabled: false
----------------
Style/VariableName:
  Description: Use the configured style when naming variables.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
  Enabled: false
  EnforcedStyle: snake_case
----------------
Style/WhenThen:
  Description: Use when x then ... for one-line cases.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
  Enabled: false
----------------
Style/WhileUntilModifier:
  Description: Favor modifier while/until usage when you have a single-line body.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
  Enabled: false
  MaxLineLength: 80

List of cops that where disabled when this issue was created:

----------------
Lint/CircularArgumentReference:
  Description: Default values in optional keyword arguments and optional ordinal arguments
    should not refer back to the name of the argument.
  Enabled: false
----------------
Lint/ConditionPosition:
  Description: Checks for condition placed in a confusing position relative to the keyword.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#same-line-condition
  Enabled: false
----------------
Lint/Debugger:
  Description: Check for debugger calls.
  Enabled: false
Lint/DefEndAlignment:
----------------
Lint/DefEndAlignment:
  Description: Align ends corresponding to defs correctly.
  Enabled: false
----------------
Lint/DuplicateMethods:
  Description: Check for duplicate method definitions.
  Enabled: false
----------------
Lint/DuplicatedKey:
  Description: Check for duplicate keys in hash literals.
  Enabled: false
----------------
Lint/EachWithObjectArgument:
  Description: Check for immutable argument given to each_with_object.
  Enabled: false
----------------
Lint/ElseLayout:
  Description: Check for odd code arrangement in an else block.
  Enabled: false
----------------
Lint/EmptyEnsure:
  Description: Checks for empty ensure block.
  Enabled: false
----------------
Lint/EmptyInterpolation:
  Description: Checks for empty string interpolation.
  Enabled: false
----------------
Lint/EndAlignment:
  Description: Align ends correctly.
  Enabled: false
Lint/EndInMethod:
  Description: END blocks should not be placed inside method definitions.
  Enabled: false
----------------
Lint/EnsureReturn:
  Description: Do not use return in an ensure block.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-return-ensure
  Enabled: false
----------------
Lint/Eval:
  Description: The use of eval represents a serious security risk.
  Enabled: false
----------------
Lint/FloatOutOfRange:
  Description: Catches floating-point literals too large or small for Ruby to represent.
  Enabled: false
----------------
Lint/FormatParameterMismatch:
  Description: The number of parameters to format/sprint must match the fields.
  Enabled: false
----------------
Lint/ImplicitStringConcatenation:
  Description: Checks for adjacent string literals on the same line, which could better
    be represented as a single string literal.
  Enabled: false
----------------
Lint/InvalidCharacterLiteral:
  Description: Checks for invalid character literals with a non-escaped whitespace character.
  Enabled: false
----------------
Lint/LiteralInInterpolation:
  Description: Checks for literals used in interpolation.
  Enabled: false
----------------
Lint/NestedMethodDefinition:
  Description: Do not use nested method definitions.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-methods
  Enabled: false
----------------
Lint/NextWithoutAccumulator:
  Description: Do not omit the accumulator when calling `next` in a `reduce`/`inject`
    block.
  Enabled: false
----------------
Lint/RandOne:
  Description: Checks for `rand(1)` calls. Such calls always return `0` and most likely
    a mistake.
  Enabled: false
----------------
Lint/RequireParentheses:
  Description: Use parentheses in the method call to avoid confusion about precedence.
  Enabled: false
----------------
Lint/UnreachableCode:
  Description: Unreachable code.
  Enabled: false
----------------
Lint/UselessComparison:
  Description: Checks for comparison of something with itself.
  Enabled: false
----------------
Lint/UselessElseWithoutRescue:
  Description: Checks for useless `else` in `begin..end` without `rescue`.
  Enabled: false
----------------
Lint/UselessSetterCall:
  Description: Checks for useless setter call to a local variable.
  Enabled: false
----------------
Lint/Void:
  Description: Possible use of operator/literal/variable in void context.
  Enabled: false
----------------
Performance/DoubleStartEndWith:
  Description: Use `str.{start,end}_with?(x, ..., y, ...)` instead of `str.{start,end}_with?(x,
    ...) || str.{start,end}_with?(y, ...)`.
  Enabled: false
----------------
Performance/RedundantSortBy:
  Description: Use `sort` instead of `sort_by { |x| x }`.
  Enabled: false
----------------
Rails/FindBy:
  Description: Prefer find_by over where.first.
  Enabled: false
  Include:
  - app/models/**/*.rb
----------------
Rails/FindEach:
  Description: Prefer all.find_each over all.find.
  Enabled: false
  Include:
  - app/models/**/*.rb
----------------
Rails/PluralizationGrammar:
  Description: Checks for incorrect grammar when using methods like `3.day.ago`.
  Enabled: false
----------------
Rails/ScopeArgs:
  Description: Checks the arguments of ActiveRecord scopes.
  Enabled: false
  Include:
  - app/models/**/*.rb
----------------
Style/ArrayJoin:
  Description: Use Array#join instead of Array#*.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#array-join
  Enabled: false
----------------
Style/Attr:
  Description: Checks for uses of Module#attr.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#attr
  Enabled: false
----------------
Style/BlockComments:
  Description: Do not use block comments.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-block-comments
  Enabled: false
----------------
Style/ClassMethods:
  Description: Use self when defining module/class methods.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#def-self-class-methods
  Enabled: false
----------------
Style/EndBlock:
  Description: Avoid the use of END blocks.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-END-blocks
  Enabled: false
----------------
Style/EvenOdd:
  Description: Favor the use of Fixnum#even? && Fixnum#odd?
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#predicate-methods
  Enabled: false
----------------
Style/FileName:
  Description: Use snake_case for source file names.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files
  Enabled: false
  Exclude: []
  ExpectMatchingDefinition: false
----------------
Style/FirstMethodParameterLineBreak:
  Description: Checks for a line break before the first parameter in a multi-line method
    parameter definition.
  Enabled: false
----------------
Style/FlipFlop:
  Description: Checks for flip flops
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-flip-flops
  Enabled: false
----------------
Style/GlobalVars:
  Description: Do not introduce global variables.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#instance-vars
  Reference: http://www.zenspider.com/Languages/Ruby/QuickRef.html
  Enabled: false
----------------
Style/IfWithSemicolon:
  Description: Do not use if x; .... Use the ternary operator instead.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-semicolon-ifs
  Enabled: false
----------------
Style/InfiniteLoop:
  Description: Use Kernel#loop for infinite loops.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#infinite-loop
  Enabled: false
----------------
Style/LambdaCall:
  Description: Use lambda.call(...) instead of lambda.(...).
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#proc-call
  Enabled: false
  EnforcedStyle: call
----------------
Style/MethodName:
  Description: Use the configured style when naming methods.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
  Enabled: false
  EnforcedStyle: snake_case
----------------
Style/MultilineMethodDefinitionBraceLayout:
  Description: Checks that the closing brace in a method definition is symmetrical with
    respect to the opening brace and the method parameters.
  Enabled: false
----------------
Style/NestedModifier:
  Description: Avoid using nested modifiers.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-modifiers
  Enabled: false
----------------
Style/OpMethod:
  Description: When defining binary operators, name the argument other.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#other-arg
  Enabled: false
----------------
Style/SignalException:
  Description: Checks for proper usage of fail and raise.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-raise-over-fail
  Enabled: false
  EnforcedStyle: only_raise
----------------
Style/SpaceAfterNot:
  Description: Tracks redundant space after the ! operator.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-bang
  Enabled: false
----------------
Style/SpaceBeforeSemicolon:
  Description: No spaces before semicolons.
  Enabled: false
----------------
Style/SpaceInsideRangeLiteral:
  Description: No spaces inside range literals.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-space-inside-range-literals
  Enabled: false
----------------
Style/SpaceInsideStringInterpolation:
  Description: Checks for padding/surrounding spaces inside string interpolation.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#string-interpolation
  Enabled: false
  EnforcedStyle: no_space
----------------
Style/StabbyLambdaParentheses:
  Description: Check for the usage of parentheses around stabby lambda arguments.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#stabby-lambda-with-args
  Enabled: false
  EnforcedStyle: require_parentheses
----------------
Style/StringMethods:
  Description: Checks if configured preferred methods are used over non-preferred.
  Enabled: false
  PreferredMethods:
    intern: to_sym
----------------
Style/VariableInterpolation:
  Description: Don't interpolate global, instance and class variables directly in strings.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate
  Enabled: false
----------------
Style/VariableName:
  Description: Use the configured style when naming variables.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-symbols-methods-vars
  Enabled: false
  EnforcedStyle: snake_case
----------------
Style/WhenThen:
  Description: Use when x then ... for one-line cases.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases
  Enabled: false
----------------
Style/WhileUntilModifier:
  Description: Favor modifier while/until usage when you have a single-line body.
  StyleGuide: https://github.com/bbatsov/ruby-style-guide#while-as-a-modifier
  Enabled: false
  MaxLineLength: 80

Command used to check that:

for cop in `rubocop --show-cops | egrep -o "^\w[^:]+" `; do if rubocop -F --only $cop ; then echo $cop >> ok_cops; fi; done

Related to: https://gitlab.com/gitlab-org/gitlab-ce/issues/3444

/cc @dzaporozhets @DouweM @stanhu @rspeicher @rymai