Commit d6f66977 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Enable Rubocop cops for invalid access modifiers

This enables following cops:

Check for useless access modifiers

  Lint/UselessAccessModifier

Checks for attempts to use `private` or `protected` to set the
visibility of a class method, which does not work.

  Lint/IneffectiveAccessModifier

This also disables two false possitives in concerns.
parent b6d3eadf
......@@ -506,6 +506,15 @@ Metrics/PerceivedComplexity:
#################### Lint ################################
# Checks for useless access modifiers.
Lint/UselessAccessModifier:
Enabled: true
# Checks for attempts to use `private` or `protected` to set the visibility
# of a class method, which does not work.
Lint/IneffectiveAccessModifier:
Enabled: false
# Checks for ambiguous operators in the first argument of a method invocation
# without parentheses.
Lint/AmbiguousOperator:
......
......@@ -19,10 +19,6 @@ Lint/AssignmentInCondition:
Lint/HandleExceptions:
Enabled: false
# Offense count: 21
Lint/IneffectiveAccessModifier:
Enabled: false
# Offense count: 2
Lint/Loop:
Enabled: false
......@@ -48,10 +44,6 @@ Lint/UnusedBlockArgument:
Lint/UnusedMethodArgument:
Enabled: false
# Offense count: 11
Lint/UselessAccessModifier:
Enabled: false
# Offense count: 12
# Cop supports --auto-correct.
Performance/PushSplat:
......
......@@ -20,7 +20,7 @@ module TokenAuthenticatable
@token_fields || []
end
private
private # rubocop:disable Lint/UselessAccessModifier
def add_authentication_token_field(token_field)
@token_fields = [] unless @token_fields
......
......@@ -36,7 +36,7 @@ module Gitlab
Hash[(@nodes || {}).map { |key, factory| [key, factory.dup] }]
end
private
private # rubocop:disable Lint/UselessAccessModifier
def node(symbol, entry_class, metadata)
factory = Node::Factory.new(entry_class)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment