git 5.0.0.beta.3 → 5.0.0.beta.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.dockerignore +27 -0
- data/.github/copilot-instructions.md +3 -8
- data/.github/hooks/bin-setup-on-worktree.json +11 -0
- data/.github/hooks/run-bin-setup-once.sh +14 -0
- data/.github/skills/breaking-change-analysis/SKILL.md +6 -9
- data/.github/skills/ci-cd-troubleshooting/SKILL.md +2 -2
- data/.github/skills/command-implementation/REFERENCE.md +34 -33
- data/.github/skills/command-implementation/SKILL.md +5 -4
- data/.github/skills/command-test-conventions/SKILL.md +13 -9
- data/.github/skills/command-yard-documentation/SKILL.md +14 -6
- data/.github/skills/development-workflow/SKILL.md +20 -14
- data/.github/skills/facade-implementation/REFERENCE.md +19 -22
- data/.github/skills/facade-implementation/SKILL.md +0 -5
- data/.github/skills/facade-test-conventions/SKILL.md +4 -7
- data/.github/skills/facade-yard-documentation/SKILL.md +8 -2
- data/.github/skills/make-skill-template/SKILL.md +53 -3
- data/.github/skills/pr-readiness-review/SKILL.md +22 -2
- data/.github/skills/project-context/SKILL.md +16 -23
- data/.github/skills/pull-request-review/SKILL.md +2 -2
- data/.github/skills/rebase/SKILL.md +148 -0
- data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +1 -1
- data/.github/skills/resolve-feedback/SKILL.md +288 -0
- data/.github/skills/review-arguments-dsl/CHECKLIST.md +3 -3
- data/.github/skills/reviewing-skills/SKILL.md +28 -3
- data/.github/skills/test-debugging/SKILL.md +20 -19
- data/.github/skills/yard-documentation/SKILL.md +671 -483
- data/.github/skills/yard-documentation/element-rules.md +162 -0
- data/.github/skills-deprecated/README.md +21 -0
- data/.github/{skills → skills-deprecated}/extract-command-from-lib/SKILL.md +9 -9
- data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/SKILL.md +12 -12
- data/.github/workflows/continuous_integration.yml +3 -2
- data/.rubocop.yml +7 -39
- data/.yard-lint.yml +75 -0
- data/CONTRIBUTING.md +186 -174
- data/Gemfile +17 -0
- data/README.md +47 -12
- data/Rakefile +3 -21
- data/UPGRADING.md +219 -70
- data/docker/test/Dockerfile +32 -0
- data/docker/test/docker-compose.yml +0 -0
- data/git.gemspec +3 -4
- data/lib/git/author.rb +20 -1
- data/lib/git/branch.rb +26 -6
- data/lib/git/branch_delete_failure.rb +3 -0
- data/lib/git/branch_delete_result.rb +6 -3
- data/lib/git/branch_info.rb +6 -6
- data/lib/git/command_line/base.rb +6 -13
- data/lib/git/command_line/capturing.rb +67 -10
- data/lib/git/command_line/result.rb +0 -8
- data/lib/git/command_line/streaming.rb +45 -5
- data/lib/git/command_line.rb +4 -3
- data/lib/git/commands/add.rb +61 -53
- data/lib/git/commands/am/abort.rb +2 -2
- data/lib/git/commands/am/apply.rb +109 -98
- data/lib/git/commands/am/continue.rb +2 -2
- data/lib/git/commands/am/quit.rb +2 -2
- data/lib/git/commands/am/retry.rb +4 -2
- data/lib/git/commands/am/show_current_patch.rb +1 -1
- data/lib/git/commands/am/skip.rb +2 -2
- data/lib/git/commands/am.rb +2 -2
- data/lib/git/commands/apply.rb +7 -2
- data/lib/git/commands/archive/list_formats.rb +3 -3
- data/lib/git/commands/archive.rb +7 -2
- data/lib/git/commands/arguments.rb +1370 -359
- data/lib/git/commands/base.rb +111 -13
- data/lib/git/commands/branch/copy.rb +29 -21
- data/lib/git/commands/branch/create.rb +72 -68
- data/lib/git/commands/branch/delete.rb +25 -17
- data/lib/git/commands/branch/list.rb +76 -60
- data/lib/git/commands/branch/move.rb +29 -21
- data/lib/git/commands/branch/set_upstream.rb +8 -8
- data/lib/git/commands/branch/show_current.rb +3 -3
- data/lib/git/commands/branch/unset_upstream.rb +4 -8
- data/lib/git/commands/branch.rb +2 -2
- data/lib/git/commands/cat_file/batch.rb +36 -20
- data/lib/git/commands/cat_file/filtered.rb +12 -12
- data/lib/git/commands/cat_file/raw.rb +13 -13
- data/lib/git/commands/cat_file.rb +4 -4
- data/lib/git/commands/checkout/branch.rb +7 -5
- data/lib/git/commands/checkout/files.rb +5 -4
- data/lib/git/commands/checkout.rb +4 -4
- data/lib/git/commands/checkout_index.rb +5 -4
- data/lib/git/commands/clean.rb +6 -4
- data/lib/git/commands/clone.rb +5 -4
- data/lib/git/commands/commit.rb +5 -4
- data/lib/git/commands/commit_tree.rb +5 -4
- data/lib/git/commands/config_option_syntax/add.rb +7 -4
- data/lib/git/commands/config_option_syntax/get.rb +9 -5
- data/lib/git/commands/config_option_syntax/get_all.rb +7 -4
- data/lib/git/commands/config_option_syntax/get_color.rb +8 -4
- data/lib/git/commands/config_option_syntax/get_color_bool.rb +7 -4
- data/lib/git/commands/config_option_syntax/get_regexp.rb +8 -4
- data/lib/git/commands/config_option_syntax/get_urlmatch.rb +8 -4
- data/lib/git/commands/config_option_syntax/list.rb +8 -4
- data/lib/git/commands/config_option_syntax/remove_section.rb +7 -2
- data/lib/git/commands/config_option_syntax/rename_section.rb +7 -2
- data/lib/git/commands/config_option_syntax/replace_all.rb +7 -2
- data/lib/git/commands/config_option_syntax/set.rb +7 -2
- data/lib/git/commands/config_option_syntax/unset.rb +7 -4
- data/lib/git/commands/config_option_syntax/unset_all.rb +7 -2
- data/lib/git/commands/describe.rb +5 -4
- data/lib/git/commands/diff.rb +13 -12
- data/lib/git/commands/diff_files.rb +7 -6
- data/lib/git/commands/diff_index.rb +10 -7
- data/lib/git/commands/fetch.rb +6 -4
- data/lib/git/commands/fsck.rb +6 -4
- data/lib/git/commands/gc.rb +6 -4
- data/lib/git/commands/grep.rb +6 -5
- data/lib/git/commands/init.rb +6 -4
- data/lib/git/commands/log.rb +287 -285
- data/lib/git/commands/ls_files.rb +69 -65
- data/lib/git/commands/ls_remote.rb +62 -56
- data/lib/git/commands/ls_tree.rb +50 -46
- data/lib/git/commands/maintenance/register.rb +25 -23
- data/lib/git/commands/maintenance/run.rb +7 -2
- data/lib/git/commands/maintenance/start.rb +7 -2
- data/lib/git/commands/maintenance/stop.rb +7 -2
- data/lib/git/commands/maintenance/unregister.rb +7 -2
- data/lib/git/commands/merge/abort.rb +2 -2
- data/lib/git/commands/merge/continue.rb +2 -2
- data/lib/git/commands/merge/quit.rb +2 -2
- data/lib/git/commands/merge/start.rb +7 -2
- data/lib/git/commands/merge.rb +2 -2
- data/lib/git/commands/merge_base.rb +7 -2
- data/lib/git/commands/mv.rb +7 -2
- data/lib/git/commands/name_rev.rb +7 -2
- data/lib/git/commands/pull.rb +7 -2
- data/lib/git/commands/push.rb +7 -2
- data/lib/git/commands/read_tree.rb +7 -2
- data/lib/git/commands/remote/add.rb +7 -2
- data/lib/git/commands/remote/get_url.rb +4 -2
- data/lib/git/commands/remote/list.rb +4 -2
- data/lib/git/commands/remote/prune.rb +4 -2
- data/lib/git/commands/remote/remove.rb +4 -2
- data/lib/git/commands/remote/rename.rb +4 -2
- data/lib/git/commands/remote/set_branches.rb +9 -2
- data/lib/git/commands/remote/set_head.rb +12 -5
- data/lib/git/commands/remote/set_url.rb +9 -2
- data/lib/git/commands/remote/set_url_add.rb +11 -2
- data/lib/git/commands/remote/set_url_delete.rb +9 -2
- data/lib/git/commands/remote/show.rb +18 -12
- data/lib/git/commands/remote/update.rb +19 -12
- data/lib/git/commands/remote.rb +2 -2
- data/lib/git/commands/repack.rb +67 -63
- data/lib/git/commands/reset.rb +51 -44
- data/lib/git/commands/rev_parse.rb +135 -128
- data/lib/git/commands/revert/abort.rb +2 -2
- data/lib/git/commands/revert/continue.rb +7 -2
- data/lib/git/commands/revert/quit.rb +2 -2
- data/lib/git/commands/revert/skip.rb +2 -2
- data/lib/git/commands/revert/start.rb +7 -2
- data/lib/git/commands/revert.rb +2 -2
- data/lib/git/commands/rm.rb +35 -36
- data/lib/git/commands/show.rb +1 -1
- data/lib/git/commands/show_ref/exclude_existing.rb +3 -4
- data/lib/git/commands/show_ref/exists.rb +15 -13
- data/lib/git/commands/show_ref/list.rb +39 -35
- data/lib/git/commands/show_ref/verify.rb +29 -27
- data/lib/git/commands/show_ref.rb +4 -4
- data/lib/git/commands/stash/apply.rb +31 -25
- data/lib/git/commands/stash/branch.rb +10 -8
- data/lib/git/commands/stash/clear.rb +7 -5
- data/lib/git/commands/stash/create.rb +10 -8
- data/lib/git/commands/stash/drop.rb +15 -9
- data/lib/git/commands/stash/list.rb +9 -5
- data/lib/git/commands/stash/pop.rb +21 -12
- data/lib/git/commands/stash/push.rb +20 -11
- data/lib/git/commands/stash/show.rb +21 -12
- data/lib/git/commands/stash/store.rb +19 -10
- data/lib/git/commands/stash.rb +2 -2
- data/lib/git/commands/status.rb +7 -2
- data/lib/git/commands/symbolic_ref/delete.rb +18 -14
- data/lib/git/commands/symbolic_ref/read.rb +24 -20
- data/lib/git/commands/symbolic_ref/update.rb +20 -17
- data/lib/git/commands/symbolic_ref.rb +4 -4
- data/lib/git/commands/tag/create.rb +45 -42
- data/lib/git/commands/tag/delete.rb +5 -3
- data/lib/git/commands/tag/list.rb +47 -44
- data/lib/git/commands/tag/verify.rb +12 -12
- data/lib/git/commands/tag.rb +2 -2
- data/lib/git/commands/update_ref/batch.rb +6 -1
- data/lib/git/commands/update_ref/delete.rb +19 -21
- data/lib/git/commands/update_ref/update.rb +22 -25
- data/lib/git/commands/update_ref.rb +4 -4
- data/lib/git/commands/version.rb +14 -11
- data/lib/git/commands/worktree/add.rb +50 -51
- data/lib/git/commands/worktree/list.rb +17 -17
- data/lib/git/commands/worktree/lock.rb +12 -12
- data/lib/git/commands/worktree/move.rb +16 -16
- data/lib/git/commands/worktree/prune.rb +2 -2
- data/lib/git/commands/worktree/remove.rb +2 -2
- data/lib/git/commands/worktree/repair.rb +2 -2
- data/lib/git/commands/worktree/unlock.rb +2 -2
- data/lib/git/commands/write_tree.rb +2 -2
- data/lib/git/commands.rb +4 -3
- data/lib/git/config.rb +47 -1
- data/lib/git/configuring.rb +89 -15
- data/lib/git/detached_head_info.rb +4 -1
- data/lib/git/diff.rb +2 -5
- data/lib/git/diff_file_numstat_info.rb +3 -1
- data/lib/git/diff_file_patch_info.rb +3 -1
- data/lib/git/diff_file_raw_info.rb +3 -1
- data/lib/git/diff_info.rb +8 -15
- data/lib/git/diff_path_status.rb +16 -3
- data/lib/git/diff_result.rb +3 -1
- data/lib/git/diff_stats.rb +15 -0
- data/lib/git/dirstat_info.rb +24 -8
- data/lib/git/encoding_utils.rb +32 -1
- data/lib/git/errors.rb +19 -9
- data/lib/git/escaped_path.rb +55 -3
- data/lib/git/execution_context/repository.rb +15 -0
- data/lib/git/execution_context.rb +76 -74
- data/lib/git/file_ref.rb +6 -3
- data/lib/git/fsck_object.rb +8 -0
- data/lib/git/fsck_result.rb +26 -15
- data/lib/git/log.rb +152 -5
- data/lib/git/object.rb +284 -8
- data/lib/git/parsers/branch.rb +18 -0
- data/lib/git/parsers/cat_file.rb +2 -2
- data/lib/git/parsers/diff.rb +213 -5
- data/lib/git/parsers/fsck.rb +11 -0
- data/lib/git/parsers/ls_remote.rb +1 -1
- data/lib/git/parsers/stash.rb +51 -0
- data/lib/git/parsers/tag.rb +38 -0
- data/lib/git/remote.rb +34 -2
- data/lib/git/repository/branching.rb +23 -21
- data/lib/git/repository/committing.rb +46 -6
- data/lib/git/repository/context_helpers.rb +45 -16
- data/lib/git/repository/diffing.rb +32 -23
- data/lib/git/repository/factories.rb +153 -28
- data/lib/git/repository/inspecting.rb +1 -1
- data/lib/git/repository/logging.rb +169 -30
- data/lib/git/repository/maintenance.rb +1 -1
- data/lib/git/repository/merging.rb +3 -3
- data/lib/git/repository/object_operations.rb +108 -14
- data/lib/git/repository/remote_operations.rb +150 -171
- data/lib/git/repository/shared_private.rb +7 -5
- data/lib/git/repository/staging.rb +36 -12
- data/lib/git/repository/stashing.rb +16 -16
- data/lib/git/repository/status_operations.rb +1 -1
- data/lib/git/repository/worktree_operations.rb +1 -1
- data/lib/git/repository.rb +123 -63
- data/lib/git/stash.rb +16 -21
- data/lib/git/stash_info.rb +4 -4
- data/lib/git/stashes.rb +20 -26
- data/lib/git/status.rb +21 -7
- data/lib/git/tag_delete_failure.rb +3 -0
- data/lib/git/tag_delete_result.rb +6 -3
- data/lib/git/tag_info.rb +1 -0
- data/lib/git/url.rb +12 -5
- data/lib/git/version.rb +6 -4
- data/lib/git/version_constraint.rb +4 -0
- data/lib/git.rb +398 -314
- data/redesign/3_architecture_implementation.md +59 -29
- data/redesign/Phase 4 - Step B.md +921 -0
- data/redesign/Phase 4 - Step C.md +833 -0
- data/redesign/c1a-public-api-scope.tsv +256 -0
- data/redesign/phase-4-step-b-test-audit.tsv +485 -0
- data/tasks/yard.rake +24 -17
- metadata +24 -57
- data/commitlint.test +0 -4
- data/lib/git/args_builder.rb +0 -103
- data/lib/git/command_line_result.rb +0 -8
- data/lib/git/deprecation.rb +0 -9
- data/tasks/test.rake +0 -25
- /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
- /data/.github/{skills → skills-deprecated}/review-backward-compatibility/SKILL.md +0 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
# YARD Element-Specific Rules
|
|
2
|
+
|
|
3
|
+
Per-element YARD requirements for classes, modules, constants, attributes,
|
|
4
|
+
dynamically defined methods, and value objects
|
|
5
|
+
(`Data.define` / `Struct.new`).
|
|
6
|
+
|
|
7
|
+
Consult this file when documenting one of those elements. Rules that apply to
|
|
8
|
+
**every** doc comment (formatting, length limits, tag order) and to **methods**
|
|
9
|
+
live in [SKILL.md](SKILL.md).
|
|
10
|
+
|
|
11
|
+
## Contents
|
|
12
|
+
|
|
13
|
+
- [Contents](#contents)
|
|
14
|
+
- [Classes](#classes)
|
|
15
|
+
- [Modules](#modules)
|
|
16
|
+
- [Constants](#constants)
|
|
17
|
+
- [Attributes](#attributes)
|
|
18
|
+
- [Dynamically defined methods (`@!method`)](#dynamically-defined-methods-method)
|
|
19
|
+
- [`Data.define` classes](#datadefine-classes)
|
|
20
|
+
- [`Struct.new` classes](#structnew-classes)
|
|
21
|
+
|
|
22
|
+
## Classes
|
|
23
|
+
|
|
24
|
+
- One-sentence class description as a **noun phrase** (or starting with "Represents…") — the description should pass
|
|
25
|
+
the "This class is a…" litmus test (i.e. you should be able to prefix "This class
|
|
26
|
+
is a" and produce a grammatical sentence). "Represents…" is an accepted convention.
|
|
27
|
+
Do not start descriptions with "This class is…", "Provides…", or "Encapsulates…".
|
|
28
|
+
- Good: `Wrapper around the git binary`, `Immutable value object for a branch
|
|
29
|
+
delete result`, `Represents a git branch`
|
|
30
|
+
- Bad: `This class wraps the git binary`, `Provides branch deletion`,
|
|
31
|
+
`Encapsulates branch state`
|
|
32
|
+
- `@api public` or `@api private` tag to declare visibility — use `@api public` for
|
|
33
|
+
stable user-facing classes; use `@api private` for internal implementation classes
|
|
34
|
+
(e.g., `Git::ExecutionContext::*`, `Git::Commands::*`, parsers)
|
|
35
|
+
- At least one `@example` showing typical instantiation or primary usage — this
|
|
36
|
+
applies to all classes including `@api private` classes
|
|
37
|
+
- Error/exception classes must also state when the error is raised in class-level
|
|
38
|
+
prose, using caller-facing wording such as `Raised when branch deletion fails`
|
|
39
|
+
- Deprecated classes must include `@deprecated` explaining the migration path
|
|
40
|
+
- When present, class-level tags must appear in this order: `@example`, `@note`,
|
|
41
|
+
`@deprecated`, `@see`, `@api`, `@abstract`
|
|
42
|
+
|
|
43
|
+
## Modules
|
|
44
|
+
|
|
45
|
+
- One-sentence description — "Namespace for…", "Provides helpers for…", or
|
|
46
|
+
"Mixin that adds…"
|
|
47
|
+
- `@api public` or `@api private` — use `@api public` for stable user-facing modules;
|
|
48
|
+
use `@api private` for internal implementation modules
|
|
49
|
+
- No `@example` required unless the module provides standalone methods
|
|
50
|
+
- Deprecated modules must include `@deprecated` explaining the migration path
|
|
51
|
+
- When present, module-level tags must appear in the same order as class-level
|
|
52
|
+
tags: `@example`, `@note`, `@deprecated`, `@see`, `@api`
|
|
53
|
+
|
|
54
|
+
## Constants
|
|
55
|
+
|
|
56
|
+
- A comment immediately above the constant describing its purpose and valid values
|
|
57
|
+
- No special YARD tag is needed; YARD picks up the preceding comment automatically
|
|
58
|
+
- Add `# @return [Type]` when the constant holds a collection, frozen structure, or
|
|
59
|
+
domain-specific type whose shape is not immediately obvious from the value
|
|
60
|
+
|
|
61
|
+
## Attributes
|
|
62
|
+
|
|
63
|
+
- For explicitly written `attr_reader`, `attr_accessor`, and `attr_writer` declarations,
|
|
64
|
+
place the documentation directly above the attribute; do **not** use the `@!attribute`
|
|
65
|
+
directive
|
|
66
|
+
- For dynamically created attributes, `Data.define` members, or `Struct.new`
|
|
67
|
+
members, you **must** use a `# @!attribute [r/rw/w] name` YARD directive
|
|
68
|
+
- Must include `@return [Type] description` explaining the value and its units or
|
|
69
|
+
constraints if relevant
|
|
70
|
+
- For explicit `attr_reader`/`attr_accessor`/`attr_writer`, include a short
|
|
71
|
+
description paragraph above the attribute in addition to `@return`
|
|
72
|
+
- For `@!attribute` directives (in `Data.define` / `Struct.new`), the `@return`
|
|
73
|
+
tag inside the directive block serves as the sole documentation — no separate
|
|
74
|
+
short description is needed
|
|
75
|
+
- Tags inside `@!attribute` (and `@!method`) directive blocks must be indented
|
|
76
|
+
two extra spaces relative to the directive itself
|
|
77
|
+
- Must be defined at the class level, not inside method bodies
|
|
78
|
+
|
|
79
|
+
## Dynamically defined methods (`@!method`)
|
|
80
|
+
|
|
81
|
+
Use the `# @!method name(params)` directive for methods created via
|
|
82
|
+
metaprogramming (`define_method`, method-generating DSLs, etc.) that have no
|
|
83
|
+
literal `def`. Place the directive and its doc comment where the method would
|
|
84
|
+
logically appear in the class body. Tags inside the directive block follow the
|
|
85
|
+
same indentation rule as `@!attribute` — indented two extra spaces relative to
|
|
86
|
+
the directive.
|
|
87
|
+
|
|
88
|
+
If an `@!method` block uses `@overload`, follow overload tag-placement rules in
|
|
89
|
+
[SKILL.md](SKILL.md): keep `@return` inside each overload, keep shared
|
|
90
|
+
`@raise` at top level, and keep `@api` at top level.
|
|
91
|
+
|
|
92
|
+
## `Data.define` classes
|
|
93
|
+
|
|
94
|
+
Immutable value objects defined with `Data.define` use the following conventions
|
|
95
|
+
(see `Git::BranchDeleteFailure` for a canonical example):
|
|
96
|
+
|
|
97
|
+
- Class-level doc: noun-phrase short description, `@example`, `@see`, `@api`
|
|
98
|
+
- One `@!attribute [r]` directive per member with `@return [Type] description`
|
|
99
|
+
- Attribute directives are placed after class-level tags and before the
|
|
100
|
+
`Data.define` line
|
|
101
|
+
- Custom methods defined inside the `Data.define` block follow standard method
|
|
102
|
+
rules
|
|
103
|
+
|
|
104
|
+
```ruby
|
|
105
|
+
# Immutable value object for a failed branch delete
|
|
106
|
+
#
|
|
107
|
+
# @example Create a failure object
|
|
108
|
+
# failure = BranchDeleteFailure.new(
|
|
109
|
+
# name: 'nonexistent',
|
|
110
|
+
# error_message: "branch 'nonexistent' not found."
|
|
111
|
+
# )
|
|
112
|
+
# failure.name #=> 'nonexistent'
|
|
113
|
+
# failure.error_message #=> "branch 'nonexistent' not found."
|
|
114
|
+
#
|
|
115
|
+
# @see Git::BranchDeleteResult
|
|
116
|
+
#
|
|
117
|
+
# @api public
|
|
118
|
+
#
|
|
119
|
+
# @!attribute [r] name
|
|
120
|
+
#
|
|
121
|
+
# @return [String] the branch name that failed to delete
|
|
122
|
+
#
|
|
123
|
+
# @!attribute [r] error_message
|
|
124
|
+
#
|
|
125
|
+
# @return [String] the git error message explaining the failure
|
|
126
|
+
#
|
|
127
|
+
BranchDeleteFailure = Data.define(:name, :error_message)
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## `Struct.new` classes
|
|
131
|
+
|
|
132
|
+
Document `Struct.new` classes using the same conventions as `Data.define` classes:
|
|
133
|
+
class-level doc with a noun-phrase short description, `@example`, `@see`, `@api`,
|
|
134
|
+
and one `@!attribute` directive per member with `@return [Type] description`.
|
|
135
|
+
|
|
136
|
+
Unlike `Data.define`, a `Struct.new` class is **mutable** — it generates
|
|
137
|
+
read-write accessors — so use `@!attribute [rw]` (not `[r]`) for its members and
|
|
138
|
+
do not describe it as immutable.
|
|
139
|
+
|
|
140
|
+
```ruby
|
|
141
|
+
# Value object for a diff hunk's location within a file
|
|
142
|
+
#
|
|
143
|
+
# @example Create and update a hunk location
|
|
144
|
+
# loc = HunkLocation.new(start_line: 10, line_count: 3)
|
|
145
|
+
# loc.start_line #=> 10
|
|
146
|
+
# loc.line_count = 4
|
|
147
|
+
# loc.line_count #=> 4
|
|
148
|
+
#
|
|
149
|
+
# @see Git::DiffInfo
|
|
150
|
+
#
|
|
151
|
+
# @api public
|
|
152
|
+
#
|
|
153
|
+
# @!attribute [rw] start_line
|
|
154
|
+
#
|
|
155
|
+
# @return [Integer] the 1-based line where the hunk begins
|
|
156
|
+
#
|
|
157
|
+
# @!attribute [rw] line_count
|
|
158
|
+
#
|
|
159
|
+
# @return [Integer] the number of lines the hunk spans
|
|
160
|
+
#
|
|
161
|
+
HunkLocation = Struct.new(:start_line, :line_count, keyword_init: true)
|
|
162
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Deprecated skills
|
|
2
|
+
|
|
3
|
+
This directory holds skills that have been **retired** from active use. They are
|
|
4
|
+
kept on disk for historical reference only — they are intentionally located outside
|
|
5
|
+
`.github/skills/` so they are not auto-discovered or loaded into agent context.
|
|
6
|
+
|
|
7
|
+
## Retired skills
|
|
8
|
+
|
|
9
|
+
- **`extract-command-from-lib/`** — guided migrating a `Git::Lib` `#command` call
|
|
10
|
+
into a `Git::Commands::*` class during the v5.0.0 architectural redesign.
|
|
11
|
+
- **`extract-facade-from-base-lib/`** — guided migrating a public method from
|
|
12
|
+
`Git::Base` / `Git::Lib` into a `Git::Repository::*` facade method during the same
|
|
13
|
+
redesign.
|
|
14
|
+
- **`review-backward-compatibility/`** — audited `Git::Lib` methods for backward
|
|
15
|
+
compatibility during the migration to `Git::Commands::*`. `Git::Lib` was deleted in
|
|
16
|
+
PR #1456 as part of Phase 4 Step A; this workflow no longer applies.
|
|
17
|
+
|
|
18
|
+
The extract-* skills describe migration work that is now complete: `Git::Base` and
|
|
19
|
+
`Git::Lib` have been removed from the codebase, so there is nothing left to extract.
|
|
20
|
+
All three skills remain here as a record of the workflow used during the migration,
|
|
21
|
+
in case similar work is needed again in the future.
|
|
@@ -55,22 +55,22 @@ from the `#command` call (or both).
|
|
|
55
55
|
|
|
56
56
|
Before starting, you **MUST** load the following skill(s) in their entirety:
|
|
57
57
|
|
|
58
|
-
- [YARD Documentation](
|
|
58
|
+
- [YARD Documentation](../../skills/yard-documentation/SKILL.md) — authoritative
|
|
59
59
|
source for YARD formatting rules and writing standards;
|
|
60
60
|
|
|
61
61
|
## Related skills
|
|
62
62
|
|
|
63
63
|
Run or reference these skills during the workflow:
|
|
64
64
|
|
|
65
|
-
- [Command Implementation](
|
|
65
|
+
- [Command Implementation](../../skills/command-implementation/SKILL.md) — generates and reviews `Git::Commands::*`
|
|
66
66
|
classes, unit tests, integration tests, and YARD docs (used in Step 4 if the
|
|
67
67
|
command class does not exist yet); also the canonical class-shape checklist,
|
|
68
68
|
phased rollout gates, and internal compatibility contracts
|
|
69
|
-
- [Review Arguments DSL](
|
|
70
|
-
- [Command Test Conventions](
|
|
71
|
-
- [Command YARD Documentation](
|
|
72
|
-
- [Review Cross-Command Consistency](
|
|
73
|
-
- [Review Backward Compatibility](
|
|
69
|
+
- [Review Arguments DSL](../../skills/review-arguments-dsl/SKILL.md) — verifying DSL entries match git CLI
|
|
70
|
+
- [Command Test Conventions](../../skills/command-test-conventions/SKILL.md) — unit/integration test conventions for command classes
|
|
71
|
+
- [Command YARD Documentation](../../skills/command-yard-documentation/SKILL.md) — documentation completeness for command classes
|
|
72
|
+
- [Review Cross-Command Consistency](../../skills/review-cross-command-consistency/SKILL.md) — sibling consistency within a command family
|
|
73
|
+
- [Review Backward Compatibility](../../skills/review-backward-compatibility/SKILL.md) — preserving `Git::Lib` return-value contracts
|
|
74
74
|
- [Extract Facade from Base/Lib](../extract-facade-from-base-lib/SKILL.md) — the
|
|
75
75
|
follow-on extraction that moves the public method from `Git::Base` /
|
|
76
76
|
`Git::Lib` into a `Git::Repository::*` facade method (Phase 4 deletes both
|
|
@@ -192,7 +192,7 @@ Before making any changes, verify that `tests/units/` has adequate tests for the
|
|
|
192
192
|
2. **If the command class already exists**, skip to Step 5.
|
|
193
193
|
|
|
194
194
|
3. **If the command class does not exist**, scaffold it using the
|
|
195
|
-
[Command Implementation](
|
|
195
|
+
[Command Implementation](../../skills/command-implementation/SKILL.md) skill. This produces:
|
|
196
196
|
|
|
197
197
|
- `lib/git/commands/<command>.rb` (or `lib/git/commands/<family>/<action>.rb`)
|
|
198
198
|
- `spec/unit/git/commands/<command>_spec.rb`
|
|
@@ -292,7 +292,7 @@ changes were needed for that step):
|
|
|
292
292
|
|
|
293
293
|
During implementation, you may use multiple task-level commits. Before opening a
|
|
294
294
|
PR, follow the repository finalize workflow (see
|
|
295
|
-
[Development Workflow](
|
|
295
|
+
[Development Workflow](../../skills/development-workflow/SKILL.md)) and squash commits as
|
|
296
296
|
required.
|
|
297
297
|
|
|
298
298
|
**Issue and PR references in commit bodies:** Do not use `#<number>` in the
|
|
@@ -67,24 +67,24 @@ Extract Facade: Git::Lib#branches_all (called publicly via g.lib.branches_all)
|
|
|
67
67
|
|
|
68
68
|
Before starting, you **MUST** load the following skill(s):
|
|
69
69
|
|
|
70
|
-
- [Facade Implementation](
|
|
70
|
+
- [Facade Implementation](../../skills/facade-implementation/SKILL.md) — drives the actual
|
|
71
71
|
scaffolding of the new facade method
|
|
72
|
-
- [YARD Documentation](
|
|
72
|
+
- [YARD Documentation](../../skills/yard-documentation/SKILL.md) — baseline YARD rules
|
|
73
73
|
|
|
74
74
|
## Related skills
|
|
75
75
|
|
|
76
|
-
- [Facade Implementation](
|
|
76
|
+
- [Facade Implementation](../../skills/facade-implementation/SKILL.md) — used in Step 5 to
|
|
77
77
|
scaffold the new facade method
|
|
78
|
-
- [Facade Test Conventions](
|
|
78
|
+
- [Facade Test Conventions](../../skills/facade-test-conventions/SKILL.md) — unit and
|
|
79
79
|
integration test conventions for the new facade method
|
|
80
|
-
- [Facade YARD Documentation](
|
|
80
|
+
- [Facade YARD Documentation](../../skills/facade-yard-documentation/SKILL.md) — YARD docs
|
|
81
81
|
for the new facade module/method
|
|
82
82
|
- [Extract Command from Lib](../extract-command-from-lib/SKILL.md) — sibling
|
|
83
83
|
extraction skill that moves the underlying CLI call into a
|
|
84
84
|
`Git::Commands::*` class. **Run first** when no command class exists yet.
|
|
85
|
-
- [Command Implementation](
|
|
85
|
+
- [Command Implementation](../../skills/command-implementation/SKILL.md) — used in Step 4
|
|
86
86
|
if a new `Git::Commands::*` class needs to be scaffolded
|
|
87
|
-
- [Project Context](
|
|
87
|
+
- [Project Context](../../skills/project-context/SKILL.md) — three-layer architecture and
|
|
88
88
|
Phase 4 deletion plan
|
|
89
89
|
|
|
90
90
|
## Input
|
|
@@ -126,7 +126,7 @@ implementation.
|
|
|
126
126
|
> When migrating, the facade method **must** preserve this signature exactly
|
|
127
127
|
> (e.g. `commit(message, opts = {})`) — even though greenfield facade methods
|
|
128
128
|
> would prefer `**options` per
|
|
129
|
-
> [facade-implementation REFERENCE.md — Choosing the method signature](
|
|
129
|
+
> [facade-implementation REFERENCE.md — Choosing the method signature](../../skills/facade-implementation/REFERENCE.md#choosing-the-method-signature).
|
|
130
130
|
> The legacy public contract wins during migration.
|
|
131
131
|
|
|
132
132
|
### Pattern B — `Git::Lib`-only (public-by-exposure)
|
|
@@ -286,11 +286,11 @@ Also state:
|
|
|
286
286
|
- For `legacy-contract` methods, confirm the exact 4.x call shape is preserved
|
|
287
287
|
verbatim (including rare `**opts` signatures).
|
|
288
288
|
- Whether a new topic module is required (justify per
|
|
289
|
-
[facade-implementation REFERENCE.md](
|
|
289
|
+
[facade-implementation REFERENCE.md](../../skills/facade-implementation/REFERENCE.md#decision-rules-for-adding-a-new-module)).
|
|
290
290
|
When extracting one method at a time, scan `Git::Base` / `Git::Lib` for
|
|
291
291
|
siblings on the same git topic and check
|
|
292
292
|
`redesign/3_architecture_implementation.md` before deciding — see
|
|
293
|
-
[One-at-a-time extraction](
|
|
293
|
+
[One-at-a-time extraction](../../skills/facade-implementation/REFERENCE.md#one-at-a-time-extraction-from-gitbase--gitlib).
|
|
294
294
|
- The delegation strategy for `Git::Base` and/or `Git::Lib` (Step 6) — both
|
|
295
295
|
remain in place during the migration window and delegate to the new facade.
|
|
296
296
|
- For Pattern B: explicit note that `g.lib.foo` callers will need to migrate
|
|
@@ -338,7 +338,7 @@ preserves backward compatibility.
|
|
|
338
338
|
The facade method calls one or more `Git::Commands::*` classes. If any required
|
|
339
339
|
command class does not exist yet, scaffold it first using
|
|
340
340
|
[Extract Command from Lib](../extract-command-from-lib/SKILL.md) (which in turn
|
|
341
|
-
uses [Command Implementation](
|
|
341
|
+
uses [Command Implementation](../../skills/command-implementation/SKILL.md)).
|
|
342
342
|
|
|
343
343
|
For Pattern C migrations, the source `Git::Base` method may not currently call
|
|
344
344
|
through a `Git::Commands::*` class at all (it uses `command(...)` directly or
|
|
@@ -349,7 +349,7 @@ Skip this step when every required command class already exists.
|
|
|
349
349
|
|
|
350
350
|
### Step 5 — Implement the facade method
|
|
351
351
|
|
|
352
|
-
Delegate to the [Facade Implementation](
|
|
352
|
+
Delegate to the [Facade Implementation](../../skills/facade-implementation/SKILL.md) skill
|
|
353
353
|
in **Scaffold** or **Update** mode. That skill handles:
|
|
354
354
|
|
|
355
355
|
- topic module selection
|
|
@@ -21,15 +21,16 @@ jobs:
|
|
|
21
21
|
strategy:
|
|
22
22
|
fail-fast: false
|
|
23
23
|
matrix:
|
|
24
|
-
# Only the
|
|
24
|
+
# Only the minimum required versions of JRuby and TruffleRuby are tested
|
|
25
25
|
ruby: ["3.2", "3.4", "4.0", "truffleruby-24.2.1", "jruby-10.0.0.1"]
|
|
26
26
|
operating-system: [ubuntu-latest]
|
|
27
27
|
experimental: [No]
|
|
28
28
|
java_version: [""]
|
|
29
29
|
include:
|
|
30
|
-
- ruby: 3.2
|
|
30
|
+
- ruby: "3.2"
|
|
31
31
|
operating-system: windows-latest
|
|
32
32
|
experimental: No
|
|
33
|
+
java_version: ""
|
|
33
34
|
|
|
34
35
|
steps:
|
|
35
36
|
- name: Checkout Code
|
data/.rubocop.yml
CHANGED
|
@@ -7,53 +7,21 @@ inherit_mode:
|
|
|
7
7
|
merge:
|
|
8
8
|
- Exclude
|
|
9
9
|
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
Metrics/CyclomaticComplexity:
|
|
13
|
-
Exclude:
|
|
14
|
-
- "tests/test_helper.rb"
|
|
15
|
-
- "tests/units/**/*"
|
|
16
|
-
|
|
17
|
-
Metrics/ClassLength:
|
|
18
|
-
Exclude:
|
|
19
|
-
- "tests/test_helper.rb"
|
|
20
|
-
- "tests/units/**/*"
|
|
21
|
-
|
|
22
|
-
Metrics/AbcSize:
|
|
23
|
-
Exclude:
|
|
24
|
-
- "tests/test_helper.rb"
|
|
25
|
-
- "tests/units/**/*"
|
|
26
|
-
|
|
27
|
-
# Don't care so much about length of methods in tests
|
|
28
|
-
Metrics/MethodLength:
|
|
29
|
-
Exclude:
|
|
30
|
-
- "tests/test_helper.rb"
|
|
31
|
-
- "tests/units/**/*"
|
|
32
|
-
|
|
33
|
-
# Allow test data to have long lines
|
|
34
|
-
Layout/LineLength:
|
|
10
|
+
# lib/git.rb is the gem's main entry-point module and is expected to be long
|
|
11
|
+
Metrics/ModuleLength:
|
|
35
12
|
Exclude:
|
|
36
|
-
- "
|
|
37
|
-
- "tests/units/**/*"
|
|
38
|
-
- "*.gemspec"
|
|
13
|
+
- "lib/git.rb"
|
|
39
14
|
|
|
40
|
-
#
|
|
15
|
+
# gemspec and command DSL blocks are intentionally long
|
|
41
16
|
Metrics/BlockLength:
|
|
42
17
|
Exclude:
|
|
43
|
-
- "tests/test_helper.rb"
|
|
44
|
-
- "tests/units/**/*"
|
|
45
18
|
- "*.gemspec"
|
|
46
19
|
- "lib/git/commands/**/*.rb"
|
|
47
20
|
|
|
48
|
-
#
|
|
49
|
-
|
|
50
|
-
Exclude:
|
|
51
|
-
- "lib/git.rb"
|
|
52
|
-
|
|
53
|
-
# Don't force every test class to be described
|
|
54
|
-
Style/Documentation:
|
|
21
|
+
# Allow gemspec to have long lines
|
|
22
|
+
Layout/LineLength:
|
|
55
23
|
Exclude:
|
|
56
|
-
- "
|
|
24
|
+
- "*.gemspec"
|
|
57
25
|
|
|
58
26
|
Style/OneClassPerFile:
|
|
59
27
|
Enabled: false
|
data/.yard-lint.yml
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
# Configuration for yard-lint (https://github.com/mensfeld/yard-lint)
|
|
2
|
+
#
|
|
3
|
+
# This config enforces the project's YARD documentation standards as described
|
|
4
|
+
# in .github/skills/yard-documentation/SKILL.md. It replaces the retired
|
|
5
|
+
# yardstick audit/coverage tooling.
|
|
6
|
+
|
|
7
|
+
AllValidators:
|
|
8
|
+
# Lint private and protected objects too: the yard-documentation skill
|
|
9
|
+
# requires YARD docs on all objects, including Ruby-private methods.
|
|
10
|
+
YardOptions:
|
|
11
|
+
- --private
|
|
12
|
+
- --protected
|
|
13
|
+
|
|
14
|
+
Exclude:
|
|
15
|
+
- 'spec/**/*'
|
|
16
|
+
- 'vendor/**/*'
|
|
17
|
+
|
|
18
|
+
# Fail the run on any offense at convention severity or higher so that tag
|
|
19
|
+
# ordering, collection style, and other convention-level skill rules gate CI.
|
|
20
|
+
FailOnSeverity: convention
|
|
21
|
+
|
|
22
|
+
# Replaces the retired yardstick coverage threshold (was 75).
|
|
23
|
+
MinCoverage: 75.0
|
|
24
|
+
|
|
25
|
+
# --- Overrides where yard-lint defaults conflict with the skill ---------------
|
|
26
|
+
|
|
27
|
+
# The skill's templates end every doc block with a trailing blank comment line
|
|
28
|
+
# (`#`) before the definition, so the default EmptyCommentLine validator would
|
|
29
|
+
# flag the entire codebase. Disabled to preserve the project's house style.
|
|
30
|
+
Documentation/EmptyCommentLine:
|
|
31
|
+
Enabled: false
|
|
32
|
+
|
|
33
|
+
# The skill uses angle-bracket parametrized collection types
|
|
34
|
+
# (e.g. `Array<String>`, `Hash<Symbol, String>`). This validator enforces the
|
|
35
|
+
# `Hash{K => V}` form instead, which conflicts with the documented convention.
|
|
36
|
+
Tags/CollectionType:
|
|
37
|
+
Enabled: false
|
|
38
|
+
|
|
39
|
+
# Match the tag order documented in the skill's standard and overload templates.
|
|
40
|
+
# Tags not listed here are left unordered (e.g. `overload`, `abstract`).
|
|
41
|
+
Tags/Order:
|
|
42
|
+
Enabled: true
|
|
43
|
+
Severity: convention
|
|
44
|
+
EnforcedOrder:
|
|
45
|
+
- example
|
|
46
|
+
- param
|
|
47
|
+
- option
|
|
48
|
+
- return
|
|
49
|
+
- raise
|
|
50
|
+
- yield
|
|
51
|
+
- yieldparam
|
|
52
|
+
- yieldreturn
|
|
53
|
+
- note
|
|
54
|
+
- deprecated
|
|
55
|
+
- see
|
|
56
|
+
- api
|
|
57
|
+
|
|
58
|
+
# --- Opt-in validators that enforce the skill's house style ------------------
|
|
59
|
+
|
|
60
|
+
# The skill's templates put a blank comment line between the description and the
|
|
61
|
+
# first tag and between every tag, so that the source formatter keeps each tag
|
|
62
|
+
# visually separated. The built-in Tags/TagGroupSeparator can only separate
|
|
63
|
+
# different tag *groups* (it can never split two sibling @param tags), so this
|
|
64
|
+
# project uses Tags/TagSeparator, which requires a blank line between every
|
|
65
|
+
# consecutive tag. @option is exempt so it can cluster directly beneath the
|
|
66
|
+
# @param hash it documents.
|
|
67
|
+
#
|
|
68
|
+
# Tags/TagSeparator is not yet part of a released yard-lint; it is sourced from a
|
|
69
|
+
# fork branch via the Gemfile until it is merged upstream and published.
|
|
70
|
+
Tags/TagSeparator:
|
|
71
|
+
Enabled: true
|
|
72
|
+
Severity: convention
|
|
73
|
+
RequireAfterDescription: true
|
|
74
|
+
Exempt:
|
|
75
|
+
- option
|