Commit 9d6da439 authored by Peter Leitzen's avatar Peter Leitzen

Fix RuboCop Lint/DuplicateMethods todos

Avoid method redefinitions by removing the corresponding
`attr_{reader,writer,accessor}`.
parent 32a1dc5e
...@@ -153,23 +153,6 @@ Layout/SpaceInsideBlockBraces: ...@@ -153,23 +153,6 @@ Layout/SpaceInsideBlockBraces:
Layout/SpaceInsideParens: Layout/SpaceInsideParens:
Enabled: false Enabled: false
# Offense count: 19
Lint/DuplicateMethods:
Exclude:
- 'app/models/commit.rb'
- 'app/models/note.rb'
- 'lib/bitbucket/representation/repo.rb'
- 'lib/declarative_policy/base.rb'
- 'lib/gitlab/auth/ldap/person.rb'
- 'lib/gitlab/auth/o_auth/user.rb'
- 'lib/gitlab/ci/build/artifacts/metadata/entry.rb'
- 'lib/gitlab/cycle_analytics/base_event_fetcher.rb'
- 'lib/gitlab/diff/formatters/base_formatter.rb'
- 'lib/gitlab/git/blob.rb'
- 'lib/gitlab/git/repository.rb'
- 'lib/gitlab/git/tree.rb'
- 'lib/gitlab/git/wiki_page.rb'
# Offense count: 157 # Offense count: 157
# Configuration parameters: MaximumRangeSize. # Configuration parameters: MaximumRangeSize.
Lint/MissingCopEnableDirective: Lint/MissingCopEnableDirective:
......
...@@ -21,7 +21,6 @@ class Commit ...@@ -21,7 +21,6 @@ class Commit
participant :committer participant :committer
participant :notes_with_associations participant :notes_with_associations
attr_accessor :author
attr_accessor :redacted_description_html attr_accessor :redacted_description_html
attr_accessor :redacted_title_html attr_accessor :redacted_title_html
attr_accessor :redacted_full_title_html attr_accessor :redacted_full_title_html
......
...@@ -61,7 +61,7 @@ class Note < ApplicationRecord ...@@ -61,7 +61,7 @@ class Note < ApplicationRecord
attr_accessor :commands_changes attr_accessor :commands_changes
# A special role that may be displayed on issuable's discussions # A special role that may be displayed on issuable's discussions
attr_accessor :special_role attr_reader :special_role
default_value_for :system, false default_value_for :system, false
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
module Bitbucket module Bitbucket
module Representation module Representation
class Repo < Representation::Base class Repo < Representation::Base
attr_reader :owner, :slug
def initialize(raw) def initialize(raw)
super(raw) super(raw)
end end
......
...@@ -213,7 +213,7 @@ module DeclarativePolicy ...@@ -213,7 +213,7 @@ module DeclarativePolicy
# #
# It also stores a reference to the cache, so it can be used # It also stores a reference to the cache, so it can be used
# to cache computations by e.g. ManifestCondition. # to cache computations by e.g. ManifestCondition.
attr_reader :user, :subject, :cache attr_reader :user, :subject
def initialize(user, subject, opts = {}) def initialize(user, subject, opts = {})
@user = user @user = user
@subject = subject @subject = subject
......
...@@ -11,7 +11,7 @@ module Gitlab ...@@ -11,7 +11,7 @@ module Gitlab
InvalidEntryError = Class.new(StandardError) InvalidEntryError = Class.new(StandardError)
attr_accessor :entry, :provider attr_accessor :provider
def self.find_by_uid(uid, adapter) def self.find_by_uid(uid, adapter)
uid = Net::LDAP::Filter.escape(uid) uid = Net::LDAP::Filter.escape(uid)
......
...@@ -12,7 +12,7 @@ module Gitlab ...@@ -12,7 +12,7 @@ module Gitlab
SignupDisabledError = Class.new(StandardError) SignupDisabledError = Class.new(StandardError)
SigninDisabledForProviderError = Class.new(StandardError) SigninDisabledForProviderError = Class.new(StandardError)
attr_accessor :auth_hash, :gl_user attr_reader :auth_hash
def initialize(auth_hash) def initialize(auth_hash)
self.auth_hash = auth_hash self.auth_hash = auth_hash
......
...@@ -16,7 +16,7 @@ module Gitlab ...@@ -16,7 +16,7 @@ module Gitlab
# #
class Entry class Entry
attr_reader :entries attr_reader :entries
attr_accessor :name attr_writer :name
def initialize(path, entries) def initialize(path, entries)
@entries = entries @entries = entries
......
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
include BaseQuery include BaseQuery
include GroupProjectsProvider include GroupProjectsProvider
attr_reader :projections, :query, :stage, :order, :options attr_reader :projections, :query, :stage, :options
MAX_EVENTS = 50 MAX_EVENTS = 50
......
...@@ -10,7 +10,6 @@ module Gitlab ...@@ -10,7 +10,6 @@ module Gitlab
attr_reader :base_sha attr_reader :base_sha
attr_reader :start_sha attr_reader :start_sha
attr_reader :head_sha attr_reader :head_sha
attr_reader :position_type
def initialize(attrs) def initialize(attrs)
if diff_file = attrs[:diff_file] if diff_file = attrs[:diff_file]
......
...@@ -25,7 +25,8 @@ module Gitlab ...@@ -25,7 +25,8 @@ module Gitlab
LFS_POINTER_MIN_SIZE = 120.bytes LFS_POINTER_MIN_SIZE = 120.bytes
LFS_POINTER_MAX_SIZE = 200.bytes LFS_POINTER_MAX_SIZE = 200.bytes
attr_accessor :name, :path, :size, :data, :mode, :id, :commit_id, :loaded_size, :binary attr_accessor :size, :mode, :id, :commit_id, :loaded_size, :binary
attr_writer :name, :path, :data
define_counter :gitlab_blob_truncated_true do define_counter :gitlab_blob_truncated_true do
docstring 'blob.truncated? == true' docstring 'blob.truncated? == true'
......
...@@ -44,7 +44,7 @@ module Gitlab ...@@ -44,7 +44,7 @@ module Gitlab
# Relative path of repo # Relative path of repo
attr_reader :relative_path attr_reader :relative_path
attr_reader :storage, :gl_repository, :relative_path, :gl_project_path attr_reader :storage, :gl_repository, :gl_project_path
# This remote name has to be stable for all types of repositories that # This remote name has to be stable for all types of repositories that
# can join an object pool. If it's structure ever changes, a migration # can join an object pool. If it's structure ever changes, a migration
......
...@@ -6,8 +6,8 @@ module Gitlab ...@@ -6,8 +6,8 @@ module Gitlab
include Gitlab::EncodingHelper include Gitlab::EncodingHelper
extend Gitlab::Git::WrapsGitalyErrors extend Gitlab::Git::WrapsGitalyErrors
attr_accessor :id, :root_id, :name, :path, :flat_path, :type, attr_accessor :id, :root_id, :type, :mode, :commit_id, :submodule_url
:mode, :commit_id, :submodule_url attr_writer :name, :path, :flat_path
class << self class << self
# Get list of tree objects # Get list of tree objects
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
module Gitlab module Gitlab
module Git module Git
class WikiPage class WikiPage
attr_reader :url_path, :title, :format, :path, :version, :raw_data, :name, :text_data, :historical, :formatted_data attr_reader :url_path, :title, :format, :path, :version, :raw_data, :name, :historical, :formatted_data
# This class abstracts away Gitlab::GitalyClient::WikiPage # This class abstracts away Gitlab::GitalyClient::WikiPage
def initialize(gitaly_page, version) def initialize(gitaly_page, version)
......
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