linear-cli 0.9.17 → 0.9.19

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e5c0d2c4f9191fcb285234522569f47e6e4b437338563fa8b14a801480c92b4a
4
- data.tar.gz: b023995d7242b5e02af60bf6e9fb7d9013660f9cfc31dcbd5d53003e529f8974
3
+ metadata.gz: f8b5d0243a88d0bf959a14f147c7966fa661839059d2b4c17d4905c9ea7d9b8d
4
+ data.tar.gz: 3162551cd445f432cc01e42643c5d428ed86e3e4fad93cab4fc829519a1b0c96
5
5
  SHA512:
6
- metadata.gz: 15030e014db1cd76294da2f3967cdbb69ad2964f752ee8213776e373d6b22fe31c2266e4818862156d0c4839a7bbbdc5bee31e6420cbe63e3cec2c5da7b4e279
7
- data.tar.gz: c8113509fd3f9315c952cf4d970f3b78e730cf987209f9005d9d2b6fb6213b1666607c3c724b998dec62228b413b598797a8d0477fab180ca90e4005d0775f1c
6
+ metadata.gz: 3f98055e6ecbb47cb3725609f01491648d43854bcb010b09eb7ec5c92a227e37c31cd6ef74a192ea08d726e3350b9401d038ea9ac383458555f82ec807727860
7
+ data.tar.gz: 3c5bc6ed193aaa0995625185f3dfb3c98f0eb5f83c960077b145bd5921382170623ae5c62c08bc361d6d5089e7e52366cadfab2af9755e7f6329726d31c8193b
data/.overcommit.yml ADDED
@@ -0,0 +1,10 @@
1
+ ---
2
+ PreCommit:
3
+ RuboCop:
4
+ enabled: true
5
+ BundleAudit:
6
+ enabled: true
7
+ BundleCheck:
8
+ enabled: true
9
+ BundleOutdated:
10
+ enabled: true
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Rubyists
4
4
  module Linear
5
- VERSION = '0.9.17'
5
+ VERSION = '0.9.19'
6
6
  end
7
7
  end
@@ -20,9 +20,8 @@ module Rubyists
20
20
  argument :issue_ids, type: :array, required: true, desc: 'Issue Identifiers'
21
21
 
22
22
  def call(issue_ids:, **options)
23
- me = Rubyists::Linear::User.me
24
23
  updates = issue_ids.map do |issue_id|
25
- gimme_da_issue! issue_id, me # gimme_da_issue! is defined in Rubyists::Linear::CLI::Issue
24
+ gimme_da_issue! issue_id # gimme_da_issue! is defined in Rubyists::Linear::CLI::Issue
26
25
  rescue NotFoundError => e
27
26
  logger.warn e.message
28
27
  next
@@ -36,7 +36,7 @@ module Rubyists
36
36
  def cancel_issue(issue, **options)
37
37
  reason = reason_for(options[:reason], four: "cancelling #{issue.identifier} - #{issue.title}")
38
38
  issue_comment issue, reason
39
- cancel_state = cancel_state_for(issue)
39
+ cancel_state = cancelled_state_for(issue)
40
40
  issue.close! state: cancel_state, trash: options[:trash]
41
41
  prompt.ok "#{issue.identifier} was cancelled"
42
42
  end
@@ -70,9 +70,10 @@ module Rubyists
70
70
  prompt.ok "#{issue.identifier} was attached to #{project.name}"
71
71
  end
72
72
 
73
- def update_issue(issue, **options)
73
+ def update_issue(issue, **options) # rubocop:disable Metrics/AbcSize
74
74
  issue_comment(issue, options[:comment]) if options[:comment]
75
75
  return close_issue(issue, **options) if options[:close]
76
+ return cancel_issue(issue, **options) if options[:cancel]
76
77
  return issue_pr(issue) if options[:pr]
77
78
  return attach_project(issue, options[:project]) if options[:project]
78
79
  return if options[:comment]
@@ -66,16 +66,22 @@ module Rubyists
66
66
  def close_mutation(close_state, trash: false)
67
67
  id_for_this = identifier
68
68
  input = { stateId: close_state.id }
69
- input[:trash] = true if trash
69
+ input[:trashed] = true if trash
70
70
  mutation { issueUpdate(id: id_for_this, input:) { issue { ___ Issue.full_fragment } } }
71
71
  end
72
72
 
73
- def close!(state: nil, trash: false)
73
+ def close!(state: nil, trash: false) # rubocop:disable Metrics/MethodLength
74
74
  logger.warn "Using first completed state found: #{completed_states.first}" if state.nil?
75
75
  state ||= completed_states.first
76
76
  query_data = Api.query close_mutation(state, trash:)
77
+ unless query_data.respond_to?(:dig)
78
+ raise SmellsBad, "Unknown response (#{query_data || "NULL"}) updating #{self} to #{state}, trash: #{trash}"
79
+ end
80
+
77
81
  updated = query_data.dig(:issueUpdate, :issue)
78
- raise SmellsBad, "Unknown response for issue close: #{data} (should have :issueUpdate key)" if updated.nil?
82
+ if updated.nil?
83
+ raise SmellsBad, "Unknown response for issue close: #{query_data} (should have :issueUpdate key)"
84
+ end
79
85
 
80
86
  @data = @updated_data = updated
81
87
  self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: linear-cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.17
4
+ version: 0.9.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tj (bougyman) Vanderpoel
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: base64
@@ -205,6 +205,7 @@ executables:
205
205
  extensions: []
206
206
  extra_rdoc_files: []
207
207
  files:
208
+ - ".overcommit.yml"
208
209
  - CHANGELOG.md
209
210
  - LICENSE.txt
210
211
  - Rakefile