Skip to content

Commit e80c27d

Browse files
committed
fix: fix Rubocop Style/Documentation offense
1 parent a2f651a commit e80c27d

File tree

14 files changed

+37
-5
lines changed

14 files changed

+37
-5
lines changed

.rubocop.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,18 @@ inherit_from: .rubocop_todo.yml
33
inherit_gem:
44
main_branch_shared_rubocop_config: config/rubocop.yml
55

6+
# Testing and gemspec DSL results in large blocks
67
Metrics/BlockLength:
78
Exclude:
89
- "tests/test_helper.rb"
910
- "tests/units/**/*"
1011
- "*.gemspec"
1112

13+
# Don't force every test class to be described
14+
Style/Documentation:
15+
Exclude:
16+
- "tests/units/**/*"
17+
1218
AllCops:
1319
# Pin this project to Ruby 3.1 in case the shared config above is upgraded to 3.2
1420
# or later.

.rubocop_todo.yml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +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: 66
10-
# Configuration parameters: AllowedConstants.
11-
Style/Documentation:
12-
Enabled: false
13-
149
# Offense count: 4
1510
# This cop supports safe autocorrection (--autocorrect).
1611
Style/IfUnlessModifier:

lib/git/author.rb

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

33
module Git
4+
# An author in a Git commit
45
class Author
56
attr_accessor :name, :email, :date
67

lib/git/branch.rb

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

55
module Git
6+
# Represents a Git branch
67
class Branch
78
attr_accessor :full, :remote, :name
89

lib/git/config.rb

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

33
module Git
4+
# The global configuration for this gem
45
class Config
56
attr_writer :binary_path, :git_ssh, :timeout
67

lib/git/diff.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ def stats
7676
}
7777
end
7878

79+
# The changes for a single file within a diff
7980
class DiffFile
8081
attr_accessor :patch, :path, :mode, :src, :dst, :type
8182

lib/git/diff_path_status.rb

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

33
module Git
4+
# The files and their status (e.g., added, modified, deleted) between two commits
45
class DiffPathStatus
56
include Enumerable
67

lib/git/lib.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111
require 'open3'
1212

1313
module Git
14+
# Internal git operations
15+
# @api private
1416
class Lib
1517
# The path to the Git working copy. The default is '"./.git"'.
1618
#

lib/git/object.rb

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
module Git
99
# represents a git object
1010
class Object
11+
# A base class for all Git objects
1112
class AbstractObject
1213
attr_accessor :objectish, :type, :mode
1314

@@ -79,6 +80,7 @@ def commit? = false
7980
def tag? = false
8081
end
8182

83+
# A Git blob object
8284
class Blob < AbstractObject
8385
def initialize(base, sha, mode = nil)
8486
super(base, sha)
@@ -90,6 +92,7 @@ def blob?
9092
end
9193
end
9294

95+
# A Git tree object
9396
class Tree < AbstractObject
9497
def initialize(base, sha, mode = nil)
9598
super(base, sha)
@@ -149,6 +152,7 @@ def check_tree
149152
end
150153
end
151154

155+
# A Git commit object
152156
class Commit < AbstractObject
153157
def initialize(base, sha, init = nil)
154158
super(base, sha)
@@ -240,6 +244,13 @@ def check_commit
240244
end
241245
end
242246

247+
# A Git tag object
248+
#
249+
# This class represents a tag in Git, which can be either annotated or lightweight.
250+
#
251+
# Annotated tags contain additional metadata such as the tagger's name, email, and
252+
# the date when the tag was created, along with a message.
253+
#
243254
class Tag < AbstractObject
244255
attr_accessor :name
245256

lib/git/path.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
# frozen_string_literal: true
22

33
module Git
4+
# A base class that represents and validates a filesystem path
5+
#
6+
# Use for tracking things relevant to a Git repository, such as the working
7+
# directory or index file.
8+
#
49
class Path
510
attr_accessor :path
611

lib/git/remote.rb

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

33
module Git
4+
# A remote in a Git repository
45
class Remote
56
attr_accessor :name, :url, :fetch_opts
67

lib/git/stash.rb

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

33
module Git
4+
# A stash in a Git repository
45
class Stash
56
def initialize(base, message, existing = false)
67
@base = base

lib/git/worktree.rb

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

55
module Git
6+
# A worktree in a Git repository
67
class Worktree
78
attr_accessor :full, :dir
89

tests/test_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@
1717

1818
module Test
1919
module Unit
20+
# A base class for all test cases in this project
21+
#
22+
# This class provides utility methods for setting up and tearing down test
23+
# environments, creating temporary repositories, and mocking the Git binary.
24+
#
2025
class TestCase
2126
TEST_ROOT = File.expand_path(__dir__)
2227
TEST_FIXTURES = File.join(TEST_ROOT, 'files')

0 commit comments

Comments
 (0)