Skip to content

Commit a37412d

Browse files
committed
style: address newly reported rubocop offenses
1 parent d275b25 commit a37412d

6 files changed

Lines changed: 8 additions & 12 deletions

File tree

.rubocop.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ Style/Documentation:
4545
Exclude:
4646
- "tests/units/**/*"
4747

48+
Style/OneClassPerFile:
49+
Exclude:
50+
- "tests/units/**/*"
51+
4852
AllCops:
4953
# Pin this project to Ruby 3.1 in case the shared config above is upgraded to 3.2
5054
# or later.

.rubocop_todo.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,4 @@
99
# Offense count: 2
1010
# Configuration parameters: CountComments, CountAsOne.
1111
Metrics/ClassLength:
12-
Max: 1160
12+
Max: 1170

lib/git.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ module Git
4343
#
4444
# @author Scott Chacon (mailto:schacon@gmail.com)
4545
#
46-
module Git
46+
module Git # rubocop:disable Style/OneClassPerFile
4747
# g.config('user.name', 'Scott Chacon') # sets value
4848
# g.config('user.email', 'email@email.com') # sets value
4949
# g.config('user.name') # returns 'Scott Chacon'

lib/git/command_line.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ def run_with_capture_options(**options_hash)
242242
# @api private
243243
#
244244
def build_git_cmd(args)
245-
raise ArgumentError, 'The args array can not contain an array' if args.any? { |a| a.is_a?(Array) }
245+
raise ArgumentError, 'The args array can not contain an array' if args.any?(Array)
246246

247247
[binary_path, *global_opts, *args].map(&:to_s)
248248
end

lib/git/diff.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def blob(type = :dst)
133133
private
134134

135135
def validate_paths_not_arrays(paths)
136-
return unless paths.any? { |p| p.is_a?(Array) }
136+
return unless paths.any?(Array)
137137

138138
raise ArgumentError,
139139
'path expects individual arguments, not arrays. ' \

lib/git/status.rb

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,7 @@ def ignore_case?
8080
rescue Git::FailedError
8181
@_ignore_case = false
8282
end
83-
end
84-
end
8583

86-
module Git
87-
class Status
8884
# Represents a single file's status in the git repository. Each instance
8985
# holds information about a file's state in the index and working tree.
9086
class StatusFile
@@ -109,11 +105,7 @@ def blob(type = :index)
109105
@base.object(sha) if sha
110106
end
111107
end
112-
end
113-
end
114108

115-
module Git
116-
class Status
117109
# A factory class responsible for fetching git status data and building
118110
# a hash of StatusFile objects.
119111
# @api private

0 commit comments

Comments
 (0)