hiiro 0.1.292 → 0.1.293
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 +5 -0
- data/bin/h-pr +7 -19
- data/lib/hiiro/pinned_pr_manager.rb +16 -4
- data/lib/hiiro/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 20e69313f458dee5ff24926e4c905ea46bcfa67146f45df57f08e5692c0c9005
|
|
4
|
+
data.tar.gz: cf1b62233a0c03e1bc024ec966b88b9687cbc384b2cbf593dae30b9587ade3ff
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d3db13bf516d8dfa5db32bd1480de76d886ed1dc51f9465749b4ee6f7b2ce75e420cc035bf3446828fe70383aa6b2fd315c6f76ae8f7bfb7dd2943250dc7a7ff
|
|
7
|
+
data.tar.gz: 402ff47ab1de9c80d226c853914ed7c2a9d21a03e2d275138545a73551bdbc62275a8e53bf884dafdfa8037b6f55b93ecb98cf90b63cf89eb32f2c512f6ad4dc
|
data/CHANGELOG.md
CHANGED
data/bin/h-pr
CHANGED
|
@@ -7,20 +7,8 @@ require "yaml"
|
|
|
7
7
|
require "json"
|
|
8
8
|
require "tempfile"
|
|
9
9
|
|
|
10
|
-
FILTER_OPTS = Proc.new {
|
|
11
|
-
flag(:red, short: 'r', desc: 'filter: failing checks')
|
|
12
|
-
flag(:green, short: 'g', desc: 'filter: passing checks')
|
|
13
|
-
flag(:conflicts, short: 'c', desc: 'filter: merge conflicts')
|
|
14
|
-
flag(:drafts, short: 'D', desc: 'filter: draft PRs')
|
|
15
|
-
flag(:pending, short: 'p', desc: 'filter: pending checks')
|
|
16
|
-
flag(:merged, short: 'm', desc: 'filter: merged PRs')
|
|
17
|
-
flag(:active, short: 'o', desc: 'filter: open (non-merged) PRs')
|
|
18
|
-
flag(:numbers, short: 'n', desc: 'output PR numbers only (no #)')
|
|
19
|
-
option(:tag, short: 't', desc: 'filter by tag (OR when multiple; AND with flag filters)', multi: true)
|
|
20
|
-
}
|
|
21
|
-
|
|
22
10
|
Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
23
|
-
pinned_manager = Hiiro::PinnedPRManager.new
|
|
11
|
+
pm = pinned_manager = Hiiro::PinnedPRManager.new
|
|
24
12
|
Hiiro::PinnedPRManager.add_resolvers(self)
|
|
25
13
|
|
|
26
14
|
watch_block = ->(original_pr_number=nil, *watch_args) {
|
|
@@ -239,7 +227,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
239
227
|
flag(:checks, short: 'C', desc: 'show individual check run details')
|
|
240
228
|
flag(:diff, short: 'd', desc: 'open diff for selected PR')
|
|
241
229
|
flag(:all, short: 'a', desc: 'show all tracked PRs (no filter)')
|
|
242
|
-
|
|
230
|
+
pm.add_options(self)
|
|
243
231
|
mutual_exclusion(:all, :active, :merged, :drafts, :red, :green, :pending, :conflicts)
|
|
244
232
|
}
|
|
245
233
|
|
|
@@ -329,7 +317,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
329
317
|
opts = Hiiro::Options.parse(update_args) {
|
|
330
318
|
flag(:force_update, long: 'force-update', short: 'u', desc: 'force refresh even if recently checked')
|
|
331
319
|
flag(:all, short: 'a', desc: 'show all tracked PRs (no filter)')
|
|
332
|
-
|
|
320
|
+
pm.add_options(self)
|
|
333
321
|
mutual_exclusion(:all, :active, :merged, :drafts, :red, :green, :pending, :conflicts)
|
|
334
322
|
}
|
|
335
323
|
|
|
@@ -350,7 +338,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
350
338
|
end
|
|
351
339
|
|
|
352
340
|
add_subcmd(:green) do |*green_args|
|
|
353
|
-
opts = Hiiro::Options.parse(green_args
|
|
341
|
+
opts = Hiiro::Options.parse(green_args) { |o| pm.add_options(o) }
|
|
354
342
|
pinned = pinned_manager.load_pinned
|
|
355
343
|
results = pinned_manager.apply_filters(pinned, opts, forced: [:green])
|
|
356
344
|
|
|
@@ -367,7 +355,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
367
355
|
end
|
|
368
356
|
|
|
369
357
|
add_subcmd(:red) do |*red_args|
|
|
370
|
-
opts = Hiiro::Options.parse(red_args
|
|
358
|
+
opts = Hiiro::Options.parse(red_args) { |o| pm.add_options(o) }
|
|
371
359
|
pinned = pinned_manager.load_pinned
|
|
372
360
|
results = pinned_manager.apply_filters(pinned, opts, forced: [:red])
|
|
373
361
|
|
|
@@ -384,7 +372,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
384
372
|
end
|
|
385
373
|
|
|
386
374
|
add_subcmd(:old) do |*old_args|
|
|
387
|
-
opts = Hiiro::Options.parse(old_args
|
|
375
|
+
opts = Hiiro::Options.parse(old_args) { |o| pm.add_options(o) }
|
|
388
376
|
pinned = pinned_manager.load_pinned
|
|
389
377
|
results = pinned_manager.apply_filters(pinned, opts, forced: [:merged])
|
|
390
378
|
|
|
@@ -428,7 +416,7 @@ Hiiro.run(*ARGV, plugins: [Pins]) do
|
|
|
428
416
|
end
|
|
429
417
|
|
|
430
418
|
add_subcmd(:draft) do |*draft_args|
|
|
431
|
-
opts = Hiiro::Options.parse(draft_args
|
|
419
|
+
opts = Hiiro::Options.parse(draft_args) { |o| pm.add_options(o) }
|
|
432
420
|
pinned = pinned_manager.load_pinned
|
|
433
421
|
results = pinned_manager.apply_filters(pinned, opts, forced: [:drafts])
|
|
434
422
|
|
|
@@ -55,14 +55,26 @@ class Hiiro
|
|
|
55
55
|
end
|
|
56
56
|
end
|
|
57
57
|
|
|
58
|
-
def pr_repo(pr)
|
|
59
|
-
pr.repo || Hiiro::Git::Pr.repo_from_url(pr.url)
|
|
60
|
-
end
|
|
61
|
-
|
|
62
58
|
def initialize
|
|
63
59
|
ensure_file
|
|
64
60
|
end
|
|
65
61
|
|
|
62
|
+
def add_options(opts)
|
|
63
|
+
opts.flag(:red, short: 'r', desc: 'filter: failing checks')
|
|
64
|
+
opts.flag(:green, short: 'g', desc: 'filter: passing checks')
|
|
65
|
+
opts.flag(:conflicts, short: 'c', desc: 'filter: merge conflicts')
|
|
66
|
+
opts.flag(:drafts, short: 'D', desc: 'filter: draft PRs')
|
|
67
|
+
opts.flag(:pending, short: 'p', desc: 'filter: pending checks')
|
|
68
|
+
opts.flag(:merged, short: 'm', desc: 'filter: merged PRs')
|
|
69
|
+
opts.flag(:active, short: 'o', desc: 'filter: open (non-merged) PRs')
|
|
70
|
+
opts.flag(:numbers, short: 'n', desc: 'output PR numbers only (no #)')
|
|
71
|
+
opts.option(:tag, short: 't', desc: 'filter by tag (OR when multiple; AND with flag filters)', multi: true)
|
|
72
|
+
end
|
|
73
|
+
|
|
74
|
+
def pr_repo(pr)
|
|
75
|
+
pr.repo || Hiiro::Git::Pr.repo_from_url(pr.url)
|
|
76
|
+
end
|
|
77
|
+
|
|
66
78
|
def ensure_file
|
|
67
79
|
dir = File.dirname(Hiiro::Git::Pr::PINNED_FILE)
|
|
68
80
|
FileUtils.mkdir_p(dir) unless Dir.exist?(dir)
|
data/lib/hiiro/version.rb
CHANGED