Skip to content

Commit e9e91a8

Browse files
committed
fix: fix Rubocop Lint/MissingSuper offense
The Branch, Remote, and Worktree classes all inherit from Path but do not initialize it. Rather than call super, I am removing the inheritance. While this could be considered a breaking change, since the base class was never initialized, objects of these classes can not make use of the Path methods.
1 parent 9081f0f commit e9e91a8

File tree

4 files changed

+3
-11
lines changed

4 files changed

+3
-11
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@
66
# Note that changes in the inspected code, or installation of new
77
# versions of RuboCop, may require this file to be generated again.
88

9-
# Offense count: 3
10-
# Configuration parameters: AllowedParentClasses.
11-
Lint/MissingSuper:
12-
Exclude:
13-
- 'lib/git/branch.rb'
14-
- 'lib/git/remote.rb'
15-
- 'lib/git/worktree.rb'
16-
179
# Offense count: 8
1810
Lint/StructNewOverride:
1911
Exclude:

lib/git/branch.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'git/path'
44

55
module Git
6-
class Branch < Path
6+
class Branch
77
attr_accessor :full, :remote, :name
88

99
def initialize(base, name)

lib/git/remote.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
module Git
4-
class Remote < Path
4+
class Remote
55
attr_accessor :name, :url, :fetch_opts
66

77
def initialize(base, name)

lib/git/worktree.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
require 'git/path'
44

55
module Git
6-
class Worktree < Path
6+
class Worktree
77
attr_accessor :full, :dir
88

99
def initialize(base, dir, gcommit = nil)

0 commit comments

Comments
 (0)