hoe-halostatue 2.1.1 → 3.0.0
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/CHANGELOG.md +21 -0
- data/CODE_OF_CONDUCT.md +152 -116
- data/CONTRIBUTING.md +120 -31
- data/CONTRIBUTORS.md +15 -14
- data/LICENCE.md +33 -6
- data/Manifest.txt +8 -0
- data/README.md +303 -34
- data/Rakefile +66 -9
- data/SECURITY.md +6 -10
- data/lib/hoe/halostatue/checklist.rb +46 -0
- data/lib/hoe/halostatue/gemspec.rb +104 -0
- data/lib/hoe/halostatue/git.rb +81 -0
- data/lib/hoe/halostatue/markdown/linkify.rb +423 -0
- data/lib/hoe/halostatue/markdown.rb +152 -0
- data/lib/hoe/halostatue/version.rb +1 -1
- data/lib/hoe/halostatue.rb +96 -173
- data/licences/dco.txt +34 -0
- data/test/hoe/halostatue/markdown/test_linkify.rb +527 -0
- data/test/minitest_helper.rb +11 -0
- metadata +112 -29
data/README.md
CHANGED
|
@@ -12,6 +12,10 @@ Hoe::Halostatue is a [Hoe][hoe] meta-plugin that provides improved support for
|
|
|
12
12
|
Markdown README files, provides features from other plugins, and enables
|
|
13
13
|
improved support for [trusted publishing][tp].
|
|
14
14
|
|
|
15
|
+
Hoe::Halostatue 3.0 incorporates functionality derived from
|
|
16
|
+
[`hoe-gemspec2`][hgs2] with more support for [reproducible builds][rb] and
|
|
17
|
+
replaces [`hoe-markdown`][hmd] with an internal implementation.
|
|
18
|
+
|
|
15
19
|
## Examples
|
|
16
20
|
|
|
17
21
|
```ruby
|
|
@@ -21,29 +25,29 @@ Hoe.plugin :halostatue
|
|
|
21
25
|
Hoe.spec "myproj" do
|
|
22
26
|
self.checklist = nil if ENV["rubygems_release_gem"] == "true"
|
|
23
27
|
self.git_tag_enabled = ENV["rubygems_release_gem"] != "true"
|
|
28
|
+
self.reproducible_gemspec = true
|
|
24
29
|
# ...
|
|
25
30
|
end
|
|
26
31
|
```
|
|
27
32
|
|
|
28
|
-
If this plugin cannot see that it is in a `.git` directory, `hoe-git2` derived
|
|
29
|
-
features will be deactivated.
|
|
30
|
-
|
|
31
33
|
## Features
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
[`hoe-
|
|
35
|
-
|
|
35
|
+
- Improved Markdown support through functionality derived from
|
|
36
|
+
[`hoe-markdown`][hmd].
|
|
37
|
+
|
|
38
|
+
- Improved manual release support by adding a display checklist as a reminder of
|
|
39
|
+
tasks frequently forgotten, inspired by [`hoe-doofus`][hd].
|
|
36
40
|
|
|
37
|
-
|
|
38
|
-
[`hoe-git2`][
|
|
39
|
-
|
|
41
|
+
- Improved support of automated releases and reproducible builds by
|
|
42
|
+
incorporating modified versions of [`hoe-git2`][hg2] and
|
|
43
|
+
[`hoe-gemspec2`][hgs2].
|
|
40
44
|
|
|
41
45
|
### Improved Metadata URL Parsing
|
|
42
46
|
|
|
43
47
|
Hoe::Halostatue provides an improved implementation for `Hoe#parse_urls`. The
|
|
44
|
-
expected format is more or less the same, but accepts any left-aligned
|
|
45
|
-
list (beginning with `-`, `+`, or `*`) and handles lists that wrap
|
|
46
|
-
as the `changelog` entry at the top of this file).
|
|
48
|
+
expected format is more or less the same, but accepts any left-aligned unordered
|
|
49
|
+
Markdown list (beginning with `-`, `+`, or `*`) and handles lists that wrap
|
|
50
|
+
lines (such as the `changelog` entry at the top of this file).
|
|
47
51
|
|
|
48
52
|
It is more strict than the default `Hoe#parse_urls` because it only accepts the
|
|
49
53
|
known aliases for the various RubyGems URI meta keys.
|
|
@@ -57,16 +61,189 @@ known aliases for the various RubyGems URI meta keys.
|
|
|
57
61
|
| `wiki_uri` | `wiki` |
|
|
58
62
|
| `mailing_list_uri` | `mail` |
|
|
59
63
|
|
|
64
|
+
### Markdown Support
|
|
65
|
+
|
|
66
|
+
Hoe::Halostatue used code originally developed in [`hoe-markdown`][hmd].
|
|
67
|
+
|
|
68
|
+
#### History and README Files
|
|
69
|
+
|
|
70
|
+
Hoe was originally written before Markdown support was pervasive in software
|
|
71
|
+
forges and before RubyDocs supported Markdown rendering. It assumes that your
|
|
72
|
+
README is `README.txt` and that your changelog file is `History.txt`.
|
|
73
|
+
|
|
74
|
+
As a maintainer, you need to opt out of this — unless you use `hoe-markdown` or
|
|
75
|
+
Hoe::Halostatue, which allows you to remove this modification from your
|
|
76
|
+
`Rakefile`:
|
|
77
|
+
|
|
78
|
+
```ruby
|
|
79
|
+
Hoe.spec "projectname" do
|
|
80
|
+
# ...
|
|
81
|
+
self.history_file = "CHANGELOG.md"
|
|
82
|
+
self.readme_file = "README.md"
|
|
83
|
+
# ...
|
|
84
|
+
end
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
Specifically, Hoe::Halostatue will use `README.md` if it exists for
|
|
88
|
+
`spec.readme_file`, and will use case-insensitive matching against
|
|
89
|
+
`CHANGELOG.md` or `HISTORY.md` for your history file. `CHANGELOG` is preferred
|
|
90
|
+
over `HISTORY`, and exact matches are preferred over case-insensitive matches.
|
|
91
|
+
|
|
92
|
+
```diff
|
|
93
|
+
Hoe.spec "projectname" do
|
|
94
|
+
# ...
|
|
95
|
+
- self.history_file = "CHANGELOG.md"
|
|
96
|
+
- self.readme_file = "README.md"
|
|
97
|
+
# ...
|
|
98
|
+
end
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
#### Automatically Link to GitHub
|
|
102
|
+
|
|
103
|
+
A rake task `markdown:linkify` is created that automatically converts GitHub
|
|
104
|
+
references to hyperlinks in your Markdown files and bare hyperlinks to readable
|
|
105
|
+
links.
|
|
106
|
+
|
|
107
|
+
| Input | Output |
|
|
108
|
+
| ----------------------------------------------- | ----------------------------------------------------------------- |
|
|
109
|
+
| `@username` | `[@username](https://github.com/username)` |
|
|
110
|
+
| `https://github.com/username` | `[@username](https://github.com/username)` |
|
|
111
|
+
| `https://github.com/owner/repo` | `[owner/repo](https://github.com/owner/repo)` |
|
|
112
|
+
| `owner/repo#123` | `[owner/repo#123](https://github.com/owner/repo/issues/123)` |
|
|
113
|
+
| `https://github.com/owner/repo/issues/123` | `[owner/repo#123](https://github.com/owner/repo/issues/123)` |
|
|
114
|
+
| `https://github.com/owner/repo/pull/123` | `[owner/repo#123](https://github.com/owner/repo/pull/123)` |
|
|
115
|
+
| `https://github.com/owner/repo/discussions/123` | `[owner/repo#123](https://github.com/owner/repo/discussions/123)` |
|
|
116
|
+
|
|
117
|
+
Issue, pull request, and discussion links to comments will be rendered with
|
|
118
|
+
`(comment)` appended:
|
|
119
|
+
|
|
120
|
+
| Input | Output |
|
|
121
|
+
| --------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- |
|
|
122
|
+
| `https://github.com/owner/repo/issues/123#issuecomment-987` | `[owner/repo#123 (comment)](https://github.com/owner/repo/issues/123#issuecomment-987)` |
|
|
123
|
+
| `https://github.com/owner/repo/pull/123#issuecomment-987` | `[owner/repo#123 (comment)](https://github.com/owner/repo/pull/123#issuecomment-987)` |
|
|
124
|
+
| `https://github.com/owner/repo/discussions/123#discussioncomment-987` | `[owner/repo#123 (comment)](https://github.com/owner/repo/discussions/123#discussioncomment-987)` |
|
|
125
|
+
|
|
126
|
+
Query parameters and fragments are preserved in the link URL:
|
|
127
|
+
|
|
128
|
+
| Input | Output |
|
|
129
|
+
| -------------------------------------------------- | -------------------------------------------------------------------- |
|
|
130
|
+
| `https://github.com/owner/repo/issues/123?foo=bar` | `[owner/repo#123](https://github.com/owner/repo/issues/123?foo=bar)` |
|
|
131
|
+
| `https://github.com/owner/repo/issues/123#heading` | `[owner/repo#123](https://github.com/owner/repo/issues/123#heading)` |
|
|
132
|
+
|
|
133
|
+
> [!NOTE]
|
|
134
|
+
>
|
|
135
|
+
> If `spec.metadata["bug_tracker_uri"]` points to a GitHub repo, link labels to
|
|
136
|
+
> that repo are shortened:
|
|
137
|
+
>
|
|
138
|
+
> | Input | Output Link Text |
|
|
139
|
+
> | ----------------------------------------------------------- | -------------------------- |
|
|
140
|
+
> | `https://github.com/your/repo/issues/123` | `#123` |
|
|
141
|
+
> | `https://github.com/your/repo/issues/123#issuecomment-789` | `#123 (comment)` |
|
|
142
|
+
> | `https://github.com/other/repo/issues/456` | `other/repo#456` |
|
|
143
|
+
> | `https://github.com/other/repo/issues/456#issuecomment-987` | `other/repo#456 (comment)` |
|
|
144
|
+
|
|
145
|
+
> [!IMPORTANT]
|
|
146
|
+
>
|
|
147
|
+
> Link transformation will be skipped in the following cases:
|
|
148
|
+
>
|
|
149
|
+
> - Patterns in code blocks (`` ``` ``) or code spans (`` ` ``)
|
|
150
|
+
> - Patterns already in links: `[#123](url)` or `<https://...>`
|
|
151
|
+
> - Email addresses: `user@example.com`
|
|
152
|
+
> - Mastodon handles: `@user@instance.com`
|
|
153
|
+
> - Invalid usernames[^2]: `@-invalid`, `@foo--bar`
|
|
154
|
+
|
|
155
|
+
The rest of your Markdown documentation should be unmodified.
|
|
156
|
+
|
|
157
|
+
##### Example
|
|
158
|
+
|
|
159
|
+
If your README sets the `spec.metadata["bug_tracker_uri"]` to
|
|
160
|
+
`https://github.com/cogswellcogs/sprocketkiller/issues`[^3], when you
|
|
161
|
+
`markdown:linkify` against the CHANGELOG that looks like this:
|
|
162
|
+
|
|
163
|
+
```markdown
|
|
164
|
+
# Changelog
|
|
165
|
+
|
|
166
|
+
## v1.0.0
|
|
167
|
+
|
|
168
|
+
Bugfix: Frobnicate the transmogrifier. #123 Thanks, @hobbes!
|
|
169
|
+
|
|
170
|
+
Feature: Finagle the sprocket. See
|
|
171
|
+
https://github.com/cogswellcogs/sprocketkiller/pull/456#issuecomment-987
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
it is transformed to:
|
|
175
|
+
|
|
176
|
+
```markdown
|
|
177
|
+
# Changelog
|
|
178
|
+
|
|
179
|
+
## v1.0.0
|
|
180
|
+
|
|
181
|
+
Bugfix: Frobnicate the transmogrifier. [#123][gh-issue-123] Thanks,
|
|
182
|
+
[@hobbes][gh-user-hobbes]!
|
|
183
|
+
|
|
184
|
+
Feature: Finagle the sprocket. See [#456 (comment)][gh-issue-456-987]
|
|
185
|
+
|
|
186
|
+
[gh-user-hobbes]: https://github.com/hobbes
|
|
187
|
+
[gh-issue-123]: https://github.com/cogswellcogs/sprocketkiller/issues/123
|
|
188
|
+
[gh-issue-456-987]: https://github.com/cogswellcogs/sprocketkiller/pull/456#issuecomment-987
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
### Link Generation Options
|
|
192
|
+
|
|
193
|
+
All Markdown files in your `Manifest.txt` will be processed by
|
|
194
|
+
`markdown:linkify`, unless modified by `spec.markdown_linkify_files`.
|
|
195
|
+
|
|
196
|
+
- `spec.markdown_linkify_files` (default `[:default]`): The list of files to
|
|
197
|
+
process. If the list value contains `:default`, then all `.md` files in the
|
|
198
|
+
manifest will be included.
|
|
199
|
+
|
|
200
|
+
Files may be excluded from the list by adding `{exclude: patterns}` to the
|
|
201
|
+
list, where `patterns` is a glob pattern string, a regular expression, or a
|
|
202
|
+
list of glob pattern strings or regular expressions.
|
|
203
|
+
|
|
204
|
+
```ruby
|
|
205
|
+
self.markdown_linkify_files << {exclude: "licences/*"}
|
|
206
|
+
```
|
|
207
|
+
|
|
208
|
+
This will exclude any link found in files in the `licenses/` directory.
|
|
209
|
+
|
|
210
|
+
- `spec.markdown_linkify_style` (default `:reference`): The style for producing
|
|
211
|
+
links. Valid values are:
|
|
212
|
+
|
|
213
|
+
- `:reference`, which will produce named reference links (e.g.,
|
|
214
|
+
`[#123][gh-issue-123]`)
|
|
215
|
+
- `:inline`, which produces inline links (e.g., `[#123](https://…)`)
|
|
216
|
+
|
|
217
|
+
Existing links _will not be modified_.
|
|
218
|
+
|
|
219
|
+
When using reference links, existing reference link definitions will not be
|
|
220
|
+
moved, but new definitions will be appended to the end of the file.
|
|
221
|
+
|
|
222
|
+
- `spec.markdown_linkify_uri_prefixes` (default `nil`): Controls whether
|
|
223
|
+
shortened URIs for the current repository have prefixes added to them. This is
|
|
224
|
+
either falsy (no prefixes added), `true` default prefixes are added, or a map
|
|
225
|
+
with one or more type (`issue`, `pull`, `discussion`) and the prefix to be
|
|
226
|
+
applied. The default prefixes (when `true`) are
|
|
227
|
+
`{issue: 'issue', pull: 'pull', discussion: 'discussion'}`.
|
|
228
|
+
|
|
229
|
+
Examples (assuming `true`):
|
|
230
|
+
|
|
231
|
+
```markdown
|
|
232
|
+
[issue #123](https://github.com/cogswellcogs/sprocketkiller/issues/123
|
|
233
|
+
[pull #246](https://github.com/cogswellcogs/sprocketkiller/pull/246)
|
|
234
|
+
[discussion #369](https://github.com/cogswellcogs/sprocketkiller/discussions/369)
|
|
235
|
+
```
|
|
236
|
+
|
|
60
237
|
### Automated Release Support
|
|
61
238
|
|
|
62
|
-
Certain features offered by Hoe plugins
|
|
63
|
-
|
|
239
|
+
Certain features offered by Hoe plugins are useful for manual releases but work
|
|
240
|
+
against automated releases (see [trusted publishing][tp]).
|
|
64
241
|
|
|
65
|
-
-
|
|
66
|
-
the
|
|
242
|
+
- The checklist feature will be disabled when trusted publishing is turned on or
|
|
243
|
+
the checklist is unset or empty.
|
|
67
244
|
|
|
68
|
-
-
|
|
69
|
-
|
|
245
|
+
- Automatic release tagging is enabled by default, but may be disabled when
|
|
246
|
+
using release triggers like [release-please][rp].
|
|
70
247
|
|
|
71
248
|
In the example below, the release checklist and Git tag creation will be
|
|
72
249
|
disabled if `$rubygems_release_gem` is `true`.
|
|
@@ -83,7 +260,8 @@ end
|
|
|
83
260
|
|
|
84
261
|
### Release Checklist (from `hoe-doofus`)
|
|
85
262
|
|
|
86
|
-
The release checklist feature has been incorporated from `hoe-doofus
|
|
263
|
+
The release checklist feature has been incorporated from `hoe-doofus`, described
|
|
264
|
+
as:
|
|
87
265
|
|
|
88
266
|
> A Hoe plugin that helps me (and you, maybe?) keep from messing up gem
|
|
89
267
|
> releases. It shows a configurable checklist when `rake release` is run, and
|
|
@@ -105,15 +283,19 @@ Hoe.spec "myproj" do
|
|
|
105
283
|
end
|
|
106
284
|
```
|
|
107
285
|
|
|
286
|
+
The checklist is automatically disabled when executing a trusted publishing
|
|
287
|
+
workflow.
|
|
288
|
+
|
|
108
289
|
### Git Integration Tasks (from `hoe-git2`)
|
|
109
290
|
|
|
110
|
-
|
|
111
|
-
|
|
291
|
+
If Hoe::Halostatue cannot see that it is in a `.git` repository, these features
|
|
292
|
+
will be deactivated.
|
|
112
293
|
|
|
113
294
|
#### Generating the Manifest
|
|
114
295
|
|
|
115
296
|
The `Manifest.txt` required by Hoe can be generated with `rake git:manifest`.
|
|
116
|
-
This uses `git ls-files`, respecting the Hoe manifest sort order and
|
|
297
|
+
This uses `git ls-files`, respecting the Hoe manifest sort order and `.hoerc`
|
|
298
|
+
excludes.
|
|
117
299
|
|
|
118
300
|
#### Tagging and Sanity Checking a Release
|
|
119
301
|
|
|
@@ -126,26 +308,99 @@ In the following example with no other configuration, a `v1.0.0.beta.1` tag will
|
|
|
126
308
|
be created and pushed to the `origin` remote.
|
|
127
309
|
|
|
128
310
|
```console
|
|
129
|
-
$ rake
|
|
311
|
+
$ rake git:tag VERSION=1.0.0 PRERELEASE=beta.1
|
|
130
312
|
```
|
|
131
313
|
|
|
132
|
-
The tag prefix can be with `self.git_release_tag_prefix`, which defaults to
|
|
314
|
+
The tag prefix can be set with `self.git_release_tag_prefix`, which defaults to
|
|
315
|
+
`v`.
|
|
133
316
|
|
|
134
317
|
The created tag can be pushed to different remotes with `self.git_remotes`,
|
|
135
318
|
which defaults to `["origin"]`.
|
|
136
319
|
|
|
320
|
+
The tag will automatically be created when a release is pushed:
|
|
321
|
+
|
|
322
|
+
```console
|
|
323
|
+
$ rake release VERSION=1.0.0 PRERELEASE=beta.1
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
#### Features Not Included
|
|
327
|
+
|
|
328
|
+
Support for generating the CHANGELOG from the git commit messages has not been
|
|
329
|
+
incorporated into Hoe::Halostatue. There are better tools for producing a
|
|
330
|
+
changelog automatically (such as [changie][cg] or [cocogitto][cc]), and I prefer
|
|
331
|
+
to manage my changelogs by hand.
|
|
332
|
+
|
|
333
|
+
Listing the applied tags is better done with `git tag`.
|
|
334
|
+
|
|
335
|
+
### Regenerating the Gem Spec (from `hoe-gemspec2`)
|
|
336
|
+
|
|
337
|
+
The ability to regenerate the gem specification using `rake gemspec` has been
|
|
338
|
+
added from `hoe-gemspec2`. This variant adds support for reproducible builds to
|
|
339
|
+
the spec generation.
|
|
340
|
+
|
|
341
|
+
Note that `rake gemspec:full` has been removed; there is no support for RubyGems
|
|
342
|
+
`signing_key` and `cert_chain`.
|
|
343
|
+
|
|
344
|
+
#### Reproducible Build Support
|
|
345
|
+
|
|
346
|
+
> [!NOTE]
|
|
347
|
+
>
|
|
348
|
+
> Documentation on reproducible builds in RubyGems is fairly thin, but this
|
|
349
|
+
> amounts to having a fixed date set for the specification `date`, which is also
|
|
350
|
+
> used to ensure that all files have the same date.
|
|
351
|
+
|
|
352
|
+
Reproducible builds are primarily performed by setting the value of
|
|
353
|
+
`$SOURCE_DATE_EPOCH`. If unset, RubyGems will use a fixed date (1980-01-02), but
|
|
354
|
+
only when building the gem.
|
|
355
|
+
|
|
356
|
+
The Hoe::Halostatue implementation of the `gemspec` task will set the generated
|
|
357
|
+
specification date and `$SOURCE_DATE_EPOCH` for proper handling by the RubyGems
|
|
358
|
+
build process.
|
|
359
|
+
|
|
360
|
+
> [!IMPORTANT]
|
|
361
|
+
>
|
|
362
|
+
> Most projects will use the default reproducible builds behaviour and should
|
|
363
|
+
> not have `$SOURCE_DATE_EPOCH` set when publishing releases (either manually or
|
|
364
|
+
> in CI environments).
|
|
365
|
+
|
|
366
|
+
For other cases, `$SOURCE_DATE_EPOCH` is used if it is set, or behaviour is
|
|
367
|
+
controlled by the `spec.reproducible_gemspec` option.
|
|
368
|
+
|
|
369
|
+
- `:default` / `true`: uses the default RubyGems behaviour, setting the date to
|
|
370
|
+
`1980-01-02`
|
|
371
|
+
|
|
372
|
+
- `:current`: uses the date in the current gem `gemspec` file, or falls back to
|
|
373
|
+
the default RubyGems behaviour
|
|
374
|
+
|
|
375
|
+
- `false`: disables reproducible builds as much as possible
|
|
376
|
+
|
|
377
|
+
- Integer or String values: parsed as the integer source date epoch as seconds
|
|
378
|
+
from the Unix epoch
|
|
379
|
+
|
|
380
|
+
The default `spec.reproducible_gemspec` value is `:default`.
|
|
381
|
+
|
|
137
382
|
### Trusted Release
|
|
138
383
|
|
|
384
|
+
> [!IMPORTANT]
|
|
385
|
+
>
|
|
386
|
+
> Trusted releases should only be enabled when using a [trusted publishing][tp]
|
|
387
|
+
> workflow. It is strongly recommended that all gem releases be performed with
|
|
388
|
+
> such a workflow.
|
|
389
|
+
|
|
139
390
|
If `spec.trusted_release` is set to `true` changes will be made to the `release`
|
|
140
|
-
workflow.
|
|
141
|
-
|
|
391
|
+
workflow. It will bypass certain manual release protections offered by Hoe and
|
|
392
|
+
Hoe::Halostatue:
|
|
142
393
|
|
|
143
394
|
- The version discovered by Hoe will be trusted as correct, removing the need
|
|
144
395
|
for specifying the version.
|
|
145
396
|
|
|
146
397
|
- The release checklist will be skipped.
|
|
147
398
|
|
|
148
|
-
### Strict Warnings
|
|
399
|
+
### Strict Deprecation Warnings
|
|
400
|
+
|
|
401
|
+
Deprecation warnings signal code that will break in future Ruby or gem versions.
|
|
402
|
+
Making warnings strict during tests catches these issues early, before they
|
|
403
|
+
reach production or complicate upgrades.
|
|
149
404
|
|
|
150
405
|
Warnings can be made strict (an exception will be thrown) for tests by adding
|
|
151
406
|
the following to your test or spec helper file (`test/minitest_helper.rb` or
|
|
@@ -155,7 +410,7 @@ the following to your test or spec helper file (`test/minitest_helper.rb` or
|
|
|
155
410
|
require "hoe/halostatue/strict_warnings"
|
|
156
411
|
|
|
157
412
|
# Optional but recommended to avoid getting warnings outside of your code.
|
|
158
|
-
Hoe::Halostatue::StrictWarnings.project_root = File.expand_path("../"
|
|
413
|
+
Hoe::Halostatue::StrictWarnings.project_root = File.expand_path(__dir__, "../")
|
|
159
414
|
|
|
160
415
|
# Optional regex patterns to suppress. Suppressed messages will not be printed
|
|
161
416
|
# to standard error. The patterns provided will be converted to a single regex
|
|
@@ -176,7 +431,7 @@ This is based on [RailsStrictWarnings][rsw].
|
|
|
176
431
|
|
|
177
432
|
## Dependencies
|
|
178
433
|
|
|
179
|
-
Hoe and Git 2.37 or later.
|
|
434
|
+
Hoe 4 and Git 2.37 or later.
|
|
180
435
|
|
|
181
436
|
## Installation
|
|
182
437
|
|
|
@@ -184,11 +439,25 @@ Hoe and Git 2.37 or later.
|
|
|
184
439
|
$ gem install hoe-halostatue
|
|
185
440
|
```
|
|
186
441
|
|
|
187
|
-
[
|
|
188
|
-
|
|
189
|
-
[
|
|
190
|
-
|
|
191
|
-
|
|
442
|
+
[^1]: Also includes discussions and pull requests
|
|
443
|
+
|
|
444
|
+
[^2]: GitHub username may only contain alphanumeric characters or hyphens, may
|
|
445
|
+
not have multiple consecutive hyphens, may not begin or end with a hyphen,
|
|
446
|
+
and may have at most 39 characters.
|
|
447
|
+
|
|
448
|
+
[^3]: ```markdown
|
|
449
|
+
- bugs: <https://github.com/cogswellcogs/sprocketkiller/issues
|
|
450
|
+
```
|
|
451
|
+
|
|
452
|
+
[cc]: https://docs.cocogitto.io
|
|
453
|
+
[cg]: https://changie.dev
|
|
454
|
+
[hd]: https://github.com/jbarnette/hoe-doofus
|
|
455
|
+
[hg2]: https://github.com/halostatue/hoe-git2
|
|
456
|
+
[hgs2]: https://github.com/raggi/hoe-gemspec2
|
|
457
|
+
[hmd]: https://github.com/flavorjones/hoe-markdown
|
|
192
458
|
[hoe]: https://github.com/seattlerb/hoe
|
|
459
|
+
[rb]: https://reproducible-builds.org/
|
|
460
|
+
[rp]: https://github.com/googleapis/release-please
|
|
193
461
|
[rsw]: https://github.com/rails/rails/blob/66732971111a62e5940268e1daf7d413c72a234f/tools/strict_warnings.rb
|
|
194
462
|
[tp]: https://guides.rubygems.org/trusted-publishing/
|
|
463
|
+
[lgo]: #link-generation-options
|
data/Rakefile
CHANGED
|
@@ -2,27 +2,84 @@
|
|
|
2
2
|
|
|
3
3
|
$LOAD_PATH.unshift "lib"
|
|
4
4
|
|
|
5
|
+
require "rubygems"
|
|
5
6
|
require "hoe"
|
|
7
|
+
require "rake/clean"
|
|
8
|
+
require "rdoc/task"
|
|
9
|
+
require "minitest"
|
|
10
|
+
require "minitest/test_task"
|
|
6
11
|
|
|
7
12
|
Hoe.plugin :halostatue
|
|
13
|
+
Hoe.plugins.delete :debug
|
|
14
|
+
Hoe.plugins.delete :git
|
|
15
|
+
Hoe.plugins.delete :newb
|
|
16
|
+
Hoe.plugins.delete :publish
|
|
17
|
+
Hoe.plugins.delete :signing
|
|
18
|
+
Hoe.plugins.delete :test
|
|
8
19
|
|
|
9
|
-
Hoe.spec "hoe-halostatue" do
|
|
20
|
+
hoe = Hoe.spec "hoe-halostatue" do
|
|
10
21
|
developer "Austin Ziegler", "halostatue@gmail.com"
|
|
11
22
|
|
|
12
23
|
self.trusted_release = ENV["rubygems_release_gem"] == "true"
|
|
13
24
|
|
|
14
|
-
self.extra_rdoc_files = FileList["*.rdoc"]
|
|
15
|
-
|
|
16
25
|
license "MIT"
|
|
17
26
|
|
|
18
27
|
spec_extras[:metadata] = ->(val) {
|
|
19
|
-
val
|
|
28
|
+
val["rubygems_mfa_required"] = "true"
|
|
20
29
|
}
|
|
21
30
|
|
|
22
|
-
extra_deps << ["hoe", "
|
|
23
|
-
extra_deps << ["
|
|
24
|
-
extra_deps << ["
|
|
25
|
-
|
|
31
|
+
extra_deps << ["hoe", "~> 4.0"]
|
|
32
|
+
extra_deps << ["kramdown", "~> 2.3"]
|
|
33
|
+
extra_deps << ["kramdown-parser-gfm", "~> 1.1"]
|
|
34
|
+
|
|
35
|
+
extra_dev_deps << ["minitest", "~> 6.0"]
|
|
36
|
+
extra_dev_deps << ["minitest-autotest", "~> 1.0"]
|
|
37
|
+
extra_dev_deps << ["minitest-focus", "~> 1.1"]
|
|
38
|
+
extra_dev_deps << ["rake", ">= 10.0", "< 14"]
|
|
39
|
+
extra_dev_deps << ["rdoc", ">= 6.0", "< 8"]
|
|
40
|
+
extra_dev_deps << ["simplecov", "~> 0.22"]
|
|
41
|
+
extra_dev_deps << ["simplecov-lcov", "~> 0.8"]
|
|
42
|
+
extra_dev_deps << ["standard", "~> 1.50"]
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
Minitest::TestTask.create :test
|
|
46
|
+
Minitest::TestTask.create :coverage do |t|
|
|
47
|
+
formatters = <<-RUBY.split($/).join(" ")
|
|
48
|
+
SimpleCov::Formatter::MultiFormatter.new([
|
|
49
|
+
SimpleCov::Formatter::HTMLFormatter,
|
|
50
|
+
SimpleCov::Formatter::LcovFormatter,
|
|
51
|
+
SimpleCov::Formatter::SimpleFormatter
|
|
52
|
+
])
|
|
53
|
+
RUBY
|
|
54
|
+
t.test_prelude = <<-RUBY.split($/).join("; ")
|
|
55
|
+
require "simplecov"
|
|
56
|
+
require "simplecov-lcov"
|
|
57
|
+
|
|
58
|
+
SimpleCov::Formatter::LcovFormatter.config do |config|
|
|
59
|
+
config.report_with_single_file = true
|
|
60
|
+
config.lcov_file_name = "lcov.info"
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
SimpleCov.start "test_frameworks" do
|
|
64
|
+
enable_coverage :branch
|
|
65
|
+
primary_coverage :branch
|
|
66
|
+
formatter #{formatters}
|
|
67
|
+
end
|
|
68
|
+
RUBY
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
task default: :test
|
|
72
|
+
|
|
73
|
+
task :version do
|
|
74
|
+
require "hoe/halostatue/version"
|
|
75
|
+
puts Hoe::Halostatue::VERSION
|
|
76
|
+
end
|
|
26
77
|
|
|
27
|
-
|
|
78
|
+
RDoc::Task.new do
|
|
79
|
+
_1.title = "Hoe::Halostatue -- Opinionated reconfiguration of Hoe"
|
|
80
|
+
_1.main = "README.md"
|
|
81
|
+
_1.rdoc_dir = "doc"
|
|
82
|
+
_1.rdoc_files = hoe.spec.require_paths - ["Manifest.txt"] + hoe.spec.extra_rdoc_files
|
|
83
|
+
_1.markup = "markdown"
|
|
28
84
|
end
|
|
85
|
+
task docs: :rerdoc
|
data/SECURITY.md
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
# Hoe::Halostatue Security Policy
|
|
2
2
|
|
|
3
|
+
## LLM-Generated Security Report Policy
|
|
4
|
+
|
|
5
|
+
Absolutely no security reports will be accepted that have been generated by LLM
|
|
6
|
+
agents.
|
|
7
|
+
|
|
3
8
|
## Supported Versions
|
|
4
9
|
|
|
5
10
|
Security reports are accepted only for the most recent minor release.
|
|
6
11
|
|
|
7
12
|
## Reporting a Vulnerability
|
|
8
13
|
|
|
9
|
-
Create a [
|
|
10
|
-
[hoe-halostatue@halostatue.ca][email] with the text `hoe-halostatue` in the
|
|
11
|
-
subject. Emails sent to this address should be encrypted using [age][age] with
|
|
12
|
-
the following public key:
|
|
13
|
-
|
|
14
|
-
```
|
|
15
|
-
age1fc6ngxmn02m62fej5cl30lrvwmxn4k3q2atqu53aatekmnqfwumqj4g93w
|
|
16
|
-
```
|
|
14
|
+
Create a [private vulnerability report][advisory] with GitHub.
|
|
17
15
|
|
|
18
16
|
[advisory]: https://github.com/halostatue/hoe-halostatue/security/advisories/new
|
|
19
|
-
[age]: https://github.com/FiloSottile/age
|
|
20
|
-
[email]: mailto:hoe-halostatue@halostatue.ca
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Hoe::Halostatue::Checklist
|
|
4
|
+
# An array of reminder questions that should be asked before a release, in the form,
|
|
5
|
+
attr_accessor :checklist
|
|
6
|
+
|
|
7
|
+
private
|
|
8
|
+
|
|
9
|
+
def initialize_halostatue_checklist
|
|
10
|
+
self.checklist = [
|
|
11
|
+
"bump the version",
|
|
12
|
+
"check everything in",
|
|
13
|
+
"review the manifest",
|
|
14
|
+
"update the README and docs",
|
|
15
|
+
"update the changelog",
|
|
16
|
+
"regenerate the gemspec"
|
|
17
|
+
]
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def define_halostatue_checklist_tasks
|
|
21
|
+
desc "Show a reminder for steps frequently forgotten in a manual release"
|
|
22
|
+
task :checklist do
|
|
23
|
+
if checklist.nil? || checklist.empty?
|
|
24
|
+
puts "Checklist is empty."
|
|
25
|
+
else
|
|
26
|
+
puts "\n### HEY! Did you...\n\n"
|
|
27
|
+
|
|
28
|
+
checklist.each do |question|
|
|
29
|
+
question = question[0..0].upcase + question[1..]
|
|
30
|
+
question = "#{question}?" unless question.end_with?("?")
|
|
31
|
+
puts " * #{question}"
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
puts
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
task :release_sanity do
|
|
39
|
+
unless checklist.nil? || checklist.empty? || trusted_release
|
|
40
|
+
Rake::Task[:checklist].invoke
|
|
41
|
+
puts "Hit return if you're sure, Ctrl-C if you forgot something."
|
|
42
|
+
$stdin.gets
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
end
|