checkoff 0.39.4 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.git-hooks/pre_commit/circle_ci.rb +1 -0
- data/.git-hooks/pre_commit/punchlist.rb +3 -1
- data/.git-hooks/pre_commit/solargraph_typecheck.rb +8 -1
- data/.solargraph.yml +2 -1
- data/Gemfile +2 -3
- data/Gemfile.lock +17 -16
- data/lib/checkoff/internal/search_url/simple_param_converter.rb +31 -1
- data/lib/checkoff/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42f156ed0a4b85a8fa1b0887a74c3df016d8245293c547ea6b2ed49be7254b18
|
4
|
+
data.tar.gz: 55e6d2c6c560e4c74c18c8db95f079a36637912973e849154f1f2e2bcb724f97
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e200395f12114df856c15c030dcbf4d2a8a7a77333cd431881352975655fa7d6a559626dafb15d9f93c9fbcec47e6c1d1be5afc6f7ee6e5d816d315b4566d20
|
7
|
+
data.tar.gz: 6ce670c2ce1e0b783ca3d044b1e957004dc460cc0b207cda9f7ce12898021c32c94efa44bd4e1a652f76f2986c3a4d9873afbe1fe9e3eeec32df8ab4b9e40072
|
@@ -10,7 +10,7 @@ module Overcommit
|
|
10
10
|
# Runs `punchlist` against any modified Ruby files.
|
11
11
|
class Punchlist < Base
|
12
12
|
# @param stdout [String]
|
13
|
-
# @return [Array<Overcommit::Hook::Message]
|
13
|
+
# @return [Array<Overcommit::Hook::Message>]
|
14
14
|
def parse_output(stdout)
|
15
15
|
stdout.split("\n").map do |line|
|
16
16
|
# @sg-ignore
|
@@ -19,12 +19,14 @@ module Overcommit
|
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
22
|
+
# @return [String]
|
22
23
|
def files_glob
|
23
24
|
"{" \
|
24
25
|
"#{applicable_files.join(',')}" \
|
25
26
|
"}"
|
26
27
|
end
|
27
28
|
|
29
|
+
# @return [Symbol, Array<Overcommit::Hook::Message>]
|
28
30
|
def run
|
29
31
|
# @sg-ignore
|
30
32
|
# @type [Overcommit::Subprocess::Result]
|
@@ -11,6 +11,7 @@ module Overcommit
|
|
11
11
|
module PreCommit
|
12
12
|
# Runs `solargraph typecheck` against any modified Ruby files.
|
13
13
|
class SolargraphTypecheck < Base
|
14
|
+
# @return [Array<String>]
|
14
15
|
def run
|
15
16
|
errors = []
|
16
17
|
|
@@ -24,8 +25,11 @@ module Overcommit
|
|
24
25
|
|
25
26
|
private
|
26
27
|
|
28
|
+
# @param file [String]
|
29
|
+
# @param errors [Array<String>]
|
30
|
+
# @return [void]
|
27
31
|
def generate_errors_for_file(file, errors)
|
28
|
-
result = execute(['bundle', 'exec', 'solargraph', 'typecheck', '--level', '
|
32
|
+
result = execute(['bundle', 'exec', 'solargraph', 'typecheck', '--level', 'strong', file])
|
29
33
|
return if result.success?
|
30
34
|
|
31
35
|
# @type [String]
|
@@ -37,6 +41,9 @@ module Overcommit
|
|
37
41
|
end
|
38
42
|
end
|
39
43
|
|
44
|
+
# @param file [String]
|
45
|
+
# @param error [String]
|
46
|
+
# @return [Overcommit::Hook::Message, nil]
|
40
47
|
def parse_error(file, error)
|
41
48
|
# Parse the result for the line number # @type [MatchData]
|
42
49
|
match = error.match(/^(.+?):(\d+)/)
|
data/.solargraph.yml
CHANGED
@@ -4,6 +4,7 @@ include:
|
|
4
4
|
- ".git-hooks/**/*.rb"
|
5
5
|
exclude:
|
6
6
|
- spec/**/*
|
7
|
+
- feature/**/*
|
7
8
|
- test/**/*
|
8
9
|
- vendor/**/*
|
9
10
|
- ".bundle/**/*"
|
@@ -12,7 +13,7 @@ domains: []
|
|
12
13
|
reporters:
|
13
14
|
- rubocop
|
14
15
|
- require_not_found
|
15
|
-
- typecheck:
|
16
|
+
- typecheck:strong
|
16
17
|
- update_errors
|
17
18
|
formatter:
|
18
19
|
rubocop:
|
data/Gemfile
CHANGED
@@ -19,15 +19,14 @@ gem 'overcommit', ['>=0.60.0', '<0.61.0']
|
|
19
19
|
gem 'pry'
|
20
20
|
gem 'punchlist'
|
21
21
|
gem 'rake', '~> 13.0'
|
22
|
-
|
23
|
-
gem 'rbs', ['>3.0.3']
|
22
|
+
gem 'rbs'
|
24
23
|
gem 'rubocop', ['~> 1.52']
|
25
24
|
gem 'rubocop-minitest'
|
26
25
|
gem 'rubocop-rake'
|
27
26
|
# ensure version with branch coverage
|
28
27
|
gem 'simplecov', ['>=0.18.0']
|
29
28
|
gem 'simplecov-lcov'
|
30
|
-
gem 'solargraph'
|
29
|
+
gem 'solargraph', ['>=0.49.0']
|
31
30
|
gem 'undercover'
|
32
31
|
gem 'webmock'
|
33
32
|
|
data/Gemfile.lock
CHANGED
@@ -12,7 +12,7 @@ GIT
|
|
12
12
|
PATH
|
13
13
|
remote: .
|
14
14
|
specs:
|
15
|
-
checkoff (0.
|
15
|
+
checkoff (0.40.0)
|
16
16
|
activesupport
|
17
17
|
asana (> 0.10.0)
|
18
18
|
cache_method
|
@@ -79,7 +79,7 @@ GEM
|
|
79
79
|
imagen (0.1.8)
|
80
80
|
parser (>= 2.5, != 2.5.1.1)
|
81
81
|
iniparse (1.5.0)
|
82
|
-
jaro_winkler (1.5.
|
82
|
+
jaro_winkler (1.5.6)
|
83
83
|
json (2.6.3)
|
84
84
|
jwt (2.2.3)
|
85
85
|
kramdown (2.4.0)
|
@@ -110,12 +110,12 @@ GEM
|
|
110
110
|
multi_json (1.15.0)
|
111
111
|
multi_xml (0.6.0)
|
112
112
|
multipart-post (2.1.1)
|
113
|
-
nokogiri (1.
|
114
|
-
mini_portile2 (~> 2.8.
|
113
|
+
nokogiri (1.15.2)
|
114
|
+
mini_portile2 (~> 2.8.2)
|
115
115
|
racc (~> 1.4)
|
116
|
-
nokogiri (1.
|
116
|
+
nokogiri (1.15.2-x86_64-darwin)
|
117
117
|
racc (~> 1.4)
|
118
|
-
nokogiri (1.
|
118
|
+
nokogiri (1.15.2-x86_64-linux)
|
119
119
|
racc (~> 1.4)
|
120
120
|
oauth2 (1.4.11)
|
121
121
|
faraday (>= 0.17.3, < 3.0)
|
@@ -136,11 +136,11 @@ GEM
|
|
136
136
|
public_suffix (5.0.0)
|
137
137
|
punchlist (1.3.0)
|
138
138
|
source_finder (>= 2)
|
139
|
-
racc (1.
|
139
|
+
racc (1.7.1)
|
140
140
|
rack (3.0.6.1)
|
141
141
|
rainbow (3.1.1)
|
142
142
|
rake (13.0.3)
|
143
|
-
rbs (
|
143
|
+
rbs (2.8.4)
|
144
144
|
regexp_parser (2.8.0)
|
145
145
|
reverse_markdown (2.1.1)
|
146
146
|
nokogiri
|
@@ -171,24 +171,25 @@ GEM
|
|
171
171
|
simplecov-html (0.12.3)
|
172
172
|
simplecov-lcov (0.8.0)
|
173
173
|
simplecov_json_formatter (0.1.3)
|
174
|
-
solargraph (0.
|
174
|
+
solargraph (0.49.0)
|
175
175
|
backport (~> 1.2)
|
176
176
|
benchmark
|
177
|
-
bundler (
|
177
|
+
bundler (~> 2.0)
|
178
178
|
diff-lcs (~> 1.4)
|
179
179
|
e2mmap
|
180
180
|
jaro_winkler (~> 1.5)
|
181
181
|
kramdown (~> 2.3)
|
182
182
|
kramdown-parser-gfm (~> 1.1)
|
183
183
|
parser (~> 3.0)
|
184
|
-
|
185
|
-
|
184
|
+
rbs (~> 2.0)
|
185
|
+
reverse_markdown (~> 2.0)
|
186
|
+
rubocop (~> 1.38)
|
186
187
|
thor (~> 1.0)
|
187
188
|
tilt (~> 2.0)
|
188
189
|
yard (~> 0.9, >= 0.9.24)
|
189
190
|
source_finder (3.2.1)
|
190
|
-
thor (1.2.
|
191
|
-
tilt (2.
|
191
|
+
thor (1.2.2)
|
192
|
+
tilt (2.2.0)
|
192
193
|
tomlrb (2.0.3)
|
193
194
|
tzinfo (2.0.6)
|
194
195
|
concurrent-ruby (~> 1.0)
|
@@ -225,13 +226,13 @@ DEPENDENCIES
|
|
225
226
|
pry
|
226
227
|
punchlist
|
227
228
|
rake (~> 13.0)
|
228
|
-
rbs
|
229
|
+
rbs
|
229
230
|
rubocop (~> 1.52)
|
230
231
|
rubocop-minitest
|
231
232
|
rubocop-rake
|
232
233
|
simplecov (>= 0.18.0)
|
233
234
|
simplecov-lcov
|
234
|
-
solargraph
|
235
|
+
solargraph (>= 0.49.0)
|
235
236
|
undercover
|
236
237
|
webmock
|
237
238
|
|
@@ -31,12 +31,20 @@ module Checkoff
|
|
31
31
|
end
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
# @return [String]
|
35
|
+
attr_reader :key
|
36
|
+
|
37
|
+
# @return [Array<String>]
|
38
|
+
attr_reader :values
|
35
39
|
|
36
40
|
# Inputs:
|
37
41
|
# 123_column_456 means "abc" project, "def" section
|
38
42
|
# 123 means "abc" project
|
39
43
|
# 123~456 means "abc" and "def" projects
|
44
|
+
#
|
45
|
+
# @param projects [Array<String>]
|
46
|
+
# @param sections [Array<String>]
|
47
|
+
# @return [void]
|
40
48
|
def parse_projects_and_sections(projects, sections)
|
41
49
|
single_value.split('~').each do |project_section_pair|
|
42
50
|
# @sg-ignore
|
@@ -49,6 +57,8 @@ module Checkoff
|
|
49
57
|
end
|
50
58
|
end
|
51
59
|
|
60
|
+
# @param verb [String]
|
61
|
+
# @return [Array<String>]
|
52
62
|
def convert_from_projects_and_sections(verb)
|
53
63
|
projects = []
|
54
64
|
sections = []
|
@@ -62,6 +72,7 @@ module Checkoff
|
|
62
72
|
|
63
73
|
# Handle 'any_projects.ids' search url param
|
64
74
|
class AnyProjectsIds < SimpleParam
|
75
|
+
# @return [Array<String>]
|
65
76
|
def convert
|
66
77
|
convert_from_projects_and_sections('any')
|
67
78
|
end
|
@@ -69,6 +80,7 @@ module Checkoff
|
|
69
80
|
|
70
81
|
# Handle 'not_projects.ids' search url param
|
71
82
|
class NotProjectsIds < SimpleParam
|
83
|
+
# @return [Array<String>]
|
72
84
|
def convert
|
73
85
|
convert_from_projects_and_sections('not')
|
74
86
|
end
|
@@ -76,6 +88,7 @@ module Checkoff
|
|
76
88
|
|
77
89
|
# Handle 'completion' search url param
|
78
90
|
class Completion < SimpleParam
|
91
|
+
# @return [Array<String>]
|
79
92
|
def convert
|
80
93
|
case single_value
|
81
94
|
when 'incomplete'
|
@@ -90,6 +103,7 @@ module Checkoff
|
|
90
103
|
|
91
104
|
# Handle 'not_tags.ids' search url param
|
92
105
|
class NotTagsIds < SimpleParam
|
106
|
+
# @return [Array<String>]
|
93
107
|
def convert
|
94
108
|
tag_ids = single_value.split('~')
|
95
109
|
['tags.not', tag_ids.join(',')]
|
@@ -98,6 +112,7 @@ module Checkoff
|
|
98
112
|
|
99
113
|
# handle 'subtask' search url param
|
100
114
|
class Subtask < SimpleParam
|
115
|
+
# @return [Array<[String, Boolean]>]
|
101
116
|
def convert
|
102
117
|
case single_value
|
103
118
|
when 'is_not_subtask'
|
@@ -112,6 +127,7 @@ module Checkoff
|
|
112
127
|
|
113
128
|
# Handle 'any_tags.ids' search url param
|
114
129
|
class AnyTagsIds < SimpleParam
|
130
|
+
# @return [Array<String>]
|
115
131
|
def convert
|
116
132
|
tag_ids = single_value.split('~')
|
117
133
|
['tags.any', tag_ids.join(',')]
|
@@ -120,6 +136,7 @@ module Checkoff
|
|
120
136
|
|
121
137
|
# Handle 'sort' search url param
|
122
138
|
class Sort < SimpleParam
|
139
|
+
# @return [Array<String>]
|
123
140
|
def convert
|
124
141
|
# https://developers.asana.com/reference/searchtasksforworkspace
|
125
142
|
conversion = {
|
@@ -132,6 +149,16 @@ module Checkoff
|
|
132
149
|
['sort_by', conversion.fetch(single_value)]
|
133
150
|
end
|
134
151
|
end
|
152
|
+
|
153
|
+
# Handle 'milestone' search url param
|
154
|
+
class Milestone < SimpleParam
|
155
|
+
# @return [Array<String>]
|
156
|
+
def convert
|
157
|
+
return %w[resource_subtype milestone] if single_value == 'is_milestone'
|
158
|
+
|
159
|
+
raise "Teach me how to handle #{key} = #{values}"
|
160
|
+
end
|
161
|
+
end
|
135
162
|
end
|
136
163
|
|
137
164
|
# Convert simple parameters - ones where the param name itself
|
@@ -160,6 +187,7 @@ module Checkoff
|
|
160
187
|
'any_tags.ids' => SimpleParam::AnyTagsIds,
|
161
188
|
'subtask' => SimpleParam::Subtask,
|
162
189
|
'sort' => SimpleParam::Sort,
|
190
|
+
'milestone' => SimpleParam::Milestone,
|
163
191
|
}.freeze
|
164
192
|
|
165
193
|
# https://developers.asana.com/docs/search-tasks-in-a-workspace
|
@@ -170,12 +198,14 @@ module Checkoff
|
|
170
198
|
def convert_arg(key, values)
|
171
199
|
# @type [Class<SimpleParam::SimpleParam>]
|
172
200
|
clazz = ARGS.fetch(key)
|
201
|
+
# @sg-ignore
|
173
202
|
# @type [SimpleParam::SimpleParam]
|
174
203
|
obj = clazz.new(key: key, values: values)
|
175
204
|
# @sg-ignore
|
176
205
|
obj.convert
|
177
206
|
end
|
178
207
|
|
208
|
+
# @return [Hash<String, Array<String>>]
|
179
209
|
attr_reader :simple_url_params
|
180
210
|
end
|
181
211
|
end
|
data/lib/checkoff/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: checkoff
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vince Broz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-06-
|
11
|
+
date: 2023-06-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|