checkoff 0.201.0 → 0.203.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/.circleci/config.yml +130 -28
- data/.git-hooks/pre_commit/solargraph_typecheck.rb +12 -11
- data/.overcommit.yml +27 -2
- data/.rubocop.yml +20 -2
- data/.rubocop_todo.yml +90 -0
- data/.solargraph.yml +10 -1
- data/DEVELOPMENT.md +1 -1
- data/Gemfile +11 -8
- data/Gemfile.lock +66 -42
- data/LICENSE +1 -1
- data/Makefile +14 -12
- data/bin/brakeman +27 -0
- data/bin/overcommit_branch +117 -0
- data/bin/spoom +27 -0
- data/bin/srb +27 -0
- data/bin/srb-rbi +27 -0
- data/bin/tapioca +27 -0
- data/config/annotations_misc.rb +35 -0
- data/docs/cookiecutter_input.json +1 -0
- data/fix.sh +14 -6
- data/lib/checkoff/internal/search_url/simple_param_converter.rb +11 -0
- data/lib/checkoff/version.rb +1 -1
- data/requirements_dev.txt +1 -1
- data/sorbet/config +4 -0
- data/sorbet/rbi/annotations/.gitattributes +1 -0
- data/sorbet/rbi/annotations/activesupport.rbi +453 -0
- data/sorbet/rbi/annotations/faraday.rbi +17 -0
- data/sorbet/rbi/annotations/minitest.rbi +119 -0
- data/sorbet/rbi/annotations/mocha.rbi +34 -0
- data/sorbet/rbi/annotations/rainbow.rbi +269 -0
- data/sorbet/rbi/annotations/webmock.rbi +9 -0
- data/sorbet/rbi/dsl/.gitattributes +1 -0
- data/sorbet/rbi/dsl/active_support/callbacks.rbi +23 -0
- data/sorbet/rbi/gems/.gitattributes +1 -0
- data/sorbet/rbi/gems/activesupport@7.1.3.rbi +18749 -0
- data/sorbet/rbi/gems/addressable@2.8.6.rbi +1994 -0
- data/sorbet/rbi/gems/ansi@1.5.0.rbi +688 -0
- data/sorbet/rbi/gems/asana@0.10.6-ab9393136d9ca59b75e42a661fdddc1c65c8f7c3.rbi +6142 -0
- data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
- data/sorbet/rbi/gems/backport@1.2.0.rbi +523 -0
- data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
- data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
- data/sorbet/rbi/gems/bigdecimal@3.1.5.rbi +78 -0
- data/sorbet/rbi/gems/builder@3.2.4.rbi +505 -0
- data/sorbet/rbi/gems/bump@0.10.0.rbi +169 -0
- data/sorbet/rbi/gems/cache@0.4.1.rbi +211 -0
- data/sorbet/rbi/gems/cache_method@0.2.7.rbi +293 -0
- data/sorbet/rbi/gems/chef-utils@18.3.0.rbi +9 -0
- data/sorbet/rbi/gems/childprocess@5.1.0.rbi +383 -0
- data/sorbet/rbi/gems/coderay@1.1.3.rbi +3427 -0
- data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11591 -0
- data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
- data/sorbet/rbi/gems/crack@0.4.5.rbi +145 -0
- data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +969 -0
- data/sorbet/rbi/gems/docile@1.4.0.rbi +377 -0
- data/sorbet/rbi/gems/drb@2.2.0.rbi +1347 -0
- data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +9 -0
- data/sorbet/rbi/gems/erubi@1.13.0.rbi +152 -0
- data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +222 -0
- data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +126 -0
- data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +136 -0
- data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +145 -0
- data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +259 -0
- data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +142 -0
- data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +118 -0
- data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +125 -0
- data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +133 -0
- data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +198 -0
- data/sorbet/rbi/gems/faraday@1.10.3.rbi +2729 -0
- data/sorbet/rbi/gems/faraday_middleware-multi_json@0.0.6.rbi +29 -0
- data/sorbet/rbi/gems/faraday_middleware@1.2.0.rbi +1004 -0
- data/sorbet/rbi/gems/gli@2.21.1.rbi +9 -0
- data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +351 -0
- data/sorbet/rbi/gems/i18n@1.14.1.rbi +2326 -0
- data/sorbet/rbi/gems/imagen@0.1.8.rbi +340 -0
- data/sorbet/rbi/gems/iniparse@1.5.0.rbi +899 -0
- data/sorbet/rbi/gems/jaro_winkler@1.6.0.rbi +22 -0
- data/sorbet/rbi/gems/json@2.7.1.rbi +1562 -0
- data/sorbet/rbi/gems/jwt@2.7.1.rbi +1405 -0
- data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +128 -0
- data/sorbet/rbi/gems/kramdown@2.4.0.rbi +3272 -0
- data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
- data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
- data/sorbet/rbi/gems/mdl@0.13.0.rbi +445 -0
- data/sorbet/rbi/gems/method_source@1.0.0.rbi +273 -0
- data/sorbet/rbi/gems/mime-types-data@3.2023.1205.rbi +127 -0
- data/sorbet/rbi/gems/mime-types@3.5.1.rbi +1252 -0
- data/sorbet/rbi/gems/minitest-profile@0.0.2.rbi +136 -0
- data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +1014 -0
- data/sorbet/rbi/gems/minitest@5.21.1.rbi +1539 -0
- data/sorbet/rbi/gems/mixlib-cli@2.1.8.rbi +314 -0
- data/sorbet/rbi/gems/mixlib-config@3.0.27.rbi +581 -0
- data/sorbet/rbi/gems/mixlib-shellout@3.2.7.rbi +629 -0
- data/sorbet/rbi/gems/mocha@2.1.0.rbi +12 -0
- data/sorbet/rbi/gems/multi_json@1.15.0.rbi +268 -0
- data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +102 -0
- data/sorbet/rbi/gems/multipart-post@2.3.0.rbi +234 -0
- data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +94 -0
- data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
- data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
- data/sorbet/rbi/gems/oauth2@1.4.11.rbi +833 -0
- data/sorbet/rbi/gems/ostruct@0.6.1.rbi +354 -0
- data/sorbet/rbi/gems/overcommit@0.64.0.rbi +2400 -0
- data/sorbet/rbi/gems/parallel@1.23.0.rbi +274 -0
- data/sorbet/rbi/gems/parser@3.2.2.4.rbi +7253 -0
- data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
- data/sorbet/rbi/gems/pry@0.14.2.rbi +10070 -0
- data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +936 -0
- data/sorbet/rbi/gems/punchlist@1.3.2.rbi +173 -0
- data/sorbet/rbi/gems/racc@1.7.3.rbi +162 -0
- data/sorbet/rbi/gems/rack@3.0.8.rbi +5184 -0
- data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
- data/sorbet/rbi/gems/rake@13.1.0.rbi +3022 -0
- data/sorbet/rbi/gems/rbi@0.2.1.rbi +4535 -0
- data/sorbet/rbi/gems/rbs@2.8.4.rbi +5613 -0
- data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +3750 -0
- data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +390 -0
- data/sorbet/rbi/gems/rexml@3.2.6.rbi +4888 -0
- data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7061 -0
- data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2577 -0
- data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +3262 -0
- data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
- data/sorbet/rbi/gems/rubocop@1.59.0.rbi +57238 -0
- data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
- data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
- data/sorbet/rbi/gems/rugged@1.6.3.rbi +1577 -0
- data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +217 -0
- data/sorbet/rbi/gems/simplecov-lcov@0.8.0.rbi +256 -0
- data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2149 -0
- data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
- data/sorbet/rbi/gems/solargraph@0.50.1-904b9304770a59fac393c5cc3cad481e5bdf0fd8.rbi +9396 -0
- data/sorbet/rbi/gems/source_finder@3.2.1.rbi +317 -0
- data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
- data/sorbet/rbi/gems/tapioca@0.16.4.rbi +3604 -0
- data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
- data/sorbet/rbi/gems/tilt@2.4.0.rbi +933 -0
- data/sorbet/rbi/gems/tomlrb@2.0.3.rbi +9 -0
- data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
- data/sorbet/rbi/gems/undercover@0.5.0.rbi +433 -0
- data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
- data/sorbet/rbi/gems/webmock@3.19.1.rbi +1769 -0
- data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
- data/sorbet/rbi/gems/yard@0.9.34.rbi +18247 -0
- data/sorbet/rbi/todo.rbi +11 -0
- data/sorbet/tapioca/config.yml +13 -0
- data/sorbet/tapioca/require.rb +4 -0
- metadata +134 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: eea1d4895348c513ce00ca2e7d494843632a1d3c0a35aa94325e6d9b3e57c608
|
|
4
|
+
data.tar.gz: e051b9884aaceef0bc7f4abf37c837b479a927df08c42ef71ec7b23da9af2d2d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 349033744e36da910570c401c40064ecd5918c9a89dba561994e92d2f11fcea7603cd7f79eb4f4395564f13b8c4f925f329fb80fcdf22aece35be7995e68b19c
|
|
7
|
+
data.tar.gz: 4a63e30752560a27ce28534d2b6b5c1390302da99603a734ccaccbed5b1e9fa37adda4d732c36029c30f07601c6df762aebe7025d83fa739a2bb19f8f651a5e7
|
data/.circleci/config.yml
CHANGED
|
@@ -33,13 +33,23 @@ commands:
|
|
|
33
33
|
description: "Install source environment"
|
|
34
34
|
steps:
|
|
35
35
|
- checkout
|
|
36
|
-
- run: |
|
|
37
|
-
sed -E -e 's/checkoff \([[:digit:]]+.[[:digit:]]+.[[:digit:]]+\)/checkoff (0.1.0)/g' \
|
|
38
|
-
Gemfile.lock > Gemfile.lock.deversioned
|
|
39
36
|
- restore_cache:
|
|
40
|
-
|
|
37
|
+
keys:
|
|
38
|
+
- gems-v2-{{ checksum "Gemfile.lock" }}
|
|
39
|
+
- gems-v2-
|
|
40
|
+
- gems-
|
|
41
41
|
- restore_cache:
|
|
42
|
-
|
|
42
|
+
keys:
|
|
43
|
+
- solargraph-v2-{{ checksum "Gemfile.lock" }}-{{ .Branch }}
|
|
44
|
+
- solargraph-v2-{{ checksum "Gemfile.lock" }}-
|
|
45
|
+
- solargraph-v2-
|
|
46
|
+
- solargraph-
|
|
47
|
+
- restore_cache:
|
|
48
|
+
keys:
|
|
49
|
+
- wheels-v1-3.12.1-{{ checksum "requirements_dev.txt" }}
|
|
50
|
+
- wheels-v1-3.12.1-
|
|
51
|
+
- wheels-v1-
|
|
52
|
+
- wheels-
|
|
43
53
|
- run:
|
|
44
54
|
name: Initialize packages
|
|
45
55
|
command: |
|
|
@@ -54,7 +64,7 @@ commands:
|
|
|
54
64
|
exit 1
|
|
55
65
|
fi
|
|
56
66
|
- save_cache:
|
|
57
|
-
key: gems-v2-{{ checksum "Gemfile.lock
|
|
67
|
+
key: gems-v2-{{ checksum "Gemfile.lock" }}
|
|
58
68
|
paths:
|
|
59
69
|
- "vendor/bundle"
|
|
60
70
|
- save_cache:
|
|
@@ -68,8 +78,8 @@ commands:
|
|
|
68
78
|
command: |
|
|
69
79
|
curl -fLSs \
|
|
70
80
|
https://raw.githubusercontent.com/CircleCI-Public/circleci-cli/master/install.sh | sudo bash
|
|
71
|
-
|
|
72
|
-
description: "
|
|
81
|
+
quality:
|
|
82
|
+
description: "Quality checks"
|
|
73
83
|
steps:
|
|
74
84
|
- set_up_environment
|
|
75
85
|
- run_with_languages:
|
|
@@ -81,33 +91,123 @@ commands:
|
|
|
81
91
|
bundle exec overcommit --sign
|
|
82
92
|
bundle exec overcommit --sign pre-commit
|
|
83
93
|
|
|
84
|
-
|
|
94
|
+
if [ $(git rev-parse --abbrev-ref HEAD) == "main" ]
|
|
95
|
+
then
|
|
96
|
+
bundle exec overcommit --run
|
|
97
|
+
else
|
|
98
|
+
bundle exec bin/overcommit_branch
|
|
99
|
+
fi
|
|
100
|
+
- run_with_languages:
|
|
101
|
+
label: Run brakeman
|
|
102
|
+
command: |
|
|
103
|
+
bundle exec brakeman --no-pager --force
|
|
104
|
+
- run_with_languages:
|
|
105
|
+
label: Ratchet rubocop quality
|
|
106
|
+
command: |
|
|
107
|
+
bundle exec rubocop --regenerate-todo --no-exclude-limit --auto-gen-only-exclude --no-auto-gen-timestamp
|
|
108
|
+
if [ -f .rubocop_todo.yml ]
|
|
109
|
+
then
|
|
110
|
+
git diff --exit-code .rubocop.yml
|
|
111
|
+
git diff --exit-code .rubocop_todo.yml
|
|
112
|
+
fi
|
|
113
|
+
update_dependencies:
|
|
114
|
+
description: "Update dependencies whose build may have triggered this build"
|
|
115
|
+
parameters:
|
|
116
|
+
gems:
|
|
117
|
+
type: string
|
|
118
|
+
description: "Space-separated list of gems to update"
|
|
119
|
+
steps:
|
|
120
|
+
- run_with_languages:
|
|
121
|
+
label: Update dependencies
|
|
122
|
+
command: |
|
|
123
|
+
set -x
|
|
124
|
+
for package in <<parameters.gems>>
|
|
125
|
+
do
|
|
126
|
+
REMOTE_VERSION=$(gem search "${package}" | \
|
|
127
|
+
grep "${package}" | cut -d\( -f2 | cut -d\) -f1)
|
|
128
|
+
BUNDLED_VERSION=$(bundle info "${package}" | \
|
|
129
|
+
head -1 | cut -d\( -f2 | cut -d\) -f1)
|
|
130
|
+
if [ ${REMOTE_VERSION:?} == ${BUNDLED_VERSION:?} ]
|
|
131
|
+
then
|
|
132
|
+
continue
|
|
133
|
+
fi
|
|
134
|
+
|
|
135
|
+
bundle update --conservative "${package}"
|
|
136
|
+
|
|
137
|
+
BUNDLED_VERSION=$(bundle info "${package}" | \
|
|
138
|
+
head -1 | cut -d\( -f2 | cut -d\) -f1)
|
|
139
|
+
|
|
140
|
+
if [ ${REMOTE_VERSION:?} == ${BUNDLED_VERSION:?} ]
|
|
141
|
+
then
|
|
142
|
+
continue
|
|
143
|
+
fi
|
|
144
|
+
|
|
145
|
+
echo "Waiting for ${package} v${REMOTE_VERSION} to be"\
|
|
146
|
+
"available..."
|
|
147
|
+
sleep 20
|
|
148
|
+
bundle update "${package}"
|
|
149
|
+
|
|
150
|
+
BUNDLED_VERSION=$(bundle info "${package}" | \
|
|
151
|
+
head -1 | cut -d\( -f2 | cut -d\) -f1)
|
|
152
|
+
|
|
85
153
|
|
|
154
|
+
if [ ${REMOTE_VERSION:?} != ${BUNDLED_VERSION:?} ]
|
|
155
|
+
then
|
|
156
|
+
>&2 echo "Manually upgrade to ${package}"\
|
|
157
|
+
"v${REMOTE_VERSION}"
|
|
158
|
+
exit 1
|
|
159
|
+
fi
|
|
160
|
+
done
|
|
161
|
+
if [ -z "$(git status --porcelain Gemfile.lock)" ]
|
|
162
|
+
then
|
|
163
|
+
echo "No updates needed"
|
|
164
|
+
exit 0
|
|
165
|
+
fi
|
|
166
|
+
# Push any dependency gem updates
|
|
167
|
+
git config user.email 'vince@broz.cc'
|
|
168
|
+
git config user.name 'Vince Broz'
|
|
169
|
+
git status
|
|
170
|
+
# bundle exec so that overcommit is used from Gemfile for
|
|
171
|
+
# git hooks
|
|
172
|
+
#
|
|
173
|
+
# https://app.circleci.com/pipelines/github/apiology/"${package}"-rails/806/workflows/40fdf1ef-fa23-421b-a0f1-641ea0ed1641/jobs/1173
|
|
174
|
+
#
|
|
175
|
+
bundle exec overcommit --sign pre-commit
|
|
176
|
+
bundle exec git commit -m "Bump dependency releases" Gemfile.lock || true
|
|
177
|
+
OVERCOMMIT_DEBUG=1 bundle exec git push --set-upstream origin "${CIRCLE_BRANCH:?}"
|
|
178
|
+
echo "Avoiding double build after git push"
|
|
179
|
+
exit 1
|
|
86
180
|
jobs:
|
|
87
|
-
|
|
181
|
+
quality:
|
|
88
182
|
working_directory: ~/checkoff
|
|
89
183
|
docker:
|
|
90
184
|
- image: apiology/circleci-ruby:latest
|
|
91
185
|
steps:
|
|
92
|
-
-
|
|
93
|
-
condition:
|
|
94
|
-
equal: [<< pipeline.git.branch >>, "main"]
|
|
95
|
-
steps:
|
|
96
|
-
- overcommit
|
|
97
|
-
- unless:
|
|
98
|
-
condition:
|
|
99
|
-
equal: [<< pipeline.git.branch >>, "main"]
|
|
100
|
-
steps:
|
|
101
|
-
- run: echo "overcommit only runs on main branch"
|
|
186
|
+
- quality
|
|
102
187
|
build:
|
|
103
188
|
working_directory: ~/checkoff
|
|
104
189
|
docker:
|
|
105
190
|
- image: apiology/circleci-ruby:latest
|
|
106
191
|
steps:
|
|
107
192
|
- set_up_environment
|
|
193
|
+
- when:
|
|
194
|
+
condition:
|
|
195
|
+
equal: [<< pipeline.git.branch >>, "main"]
|
|
196
|
+
steps:
|
|
197
|
+
- update_dependencies:
|
|
198
|
+
gems: checkoff
|
|
199
|
+
# - run_with_languages:
|
|
200
|
+
# label: Typecheck
|
|
201
|
+
# command: make citypecheck citypecoverage
|
|
108
202
|
- run_with_languages:
|
|
109
|
-
label:
|
|
110
|
-
command:
|
|
203
|
+
label: Test
|
|
204
|
+
command: |
|
|
205
|
+
make citest cicoverage
|
|
206
|
+
- save_cache:
|
|
207
|
+
key: solargraph-v2-{{ checksum "Gemfile.lock" }}-{{ .Branch }}
|
|
208
|
+
paths:
|
|
209
|
+
- ".yardoc"
|
|
210
|
+
- "/home/circleci/.cache/solargraph"
|
|
111
211
|
# This seemed to shave 5ish% of the build time off when added
|
|
112
212
|
resource_class: large
|
|
113
213
|
publish_gem:
|
|
@@ -123,6 +223,8 @@ jobs:
|
|
|
123
223
|
command: |
|
|
124
224
|
set -x
|
|
125
225
|
|
|
226
|
+
echo $BUNDLE_PATH
|
|
227
|
+
ls -l vendor/bundle
|
|
126
228
|
# Coax overcommit into working
|
|
127
229
|
git config --global user.email "test@test.test"
|
|
128
230
|
git config --global user.name "Test Test"
|
|
@@ -151,16 +253,16 @@ workflows:
|
|
|
151
253
|
- main
|
|
152
254
|
jobs:
|
|
153
255
|
- build
|
|
154
|
-
-
|
|
155
|
-
|
|
256
|
+
- quality
|
|
257
|
+
quality:
|
|
156
258
|
jobs:
|
|
157
|
-
-
|
|
259
|
+
- quality
|
|
158
260
|
build:
|
|
159
261
|
jobs:
|
|
160
262
|
- build
|
|
161
263
|
- publish_gem:
|
|
162
264
|
requires:
|
|
163
265
|
- build
|
|
164
|
-
filters:
|
|
165
|
-
branches:
|
|
166
|
-
only: main
|
|
266
|
+
# filters: # TODO
|
|
267
|
+
# branches:
|
|
268
|
+
# only: main
|
|
@@ -15,9 +15,7 @@ module Overcommit
|
|
|
15
15
|
def run
|
|
16
16
|
errors = []
|
|
17
17
|
|
|
18
|
-
applicable_files
|
|
19
|
-
generate_errors_for_file(file, errors)
|
|
20
|
-
end
|
|
18
|
+
generate_errors_for_files(errors, *applicable_files)
|
|
21
19
|
|
|
22
20
|
# output message to stderr
|
|
23
21
|
errors
|
|
@@ -25,27 +23,30 @@ module Overcommit
|
|
|
25
23
|
|
|
26
24
|
private
|
|
27
25
|
|
|
28
|
-
# @param file [String]
|
|
29
26
|
# @param errors [Array<String>]
|
|
27
|
+
# @param file [String]
|
|
30
28
|
# @return [void]
|
|
31
|
-
def
|
|
32
|
-
result = execute(['bundle', 'exec', 'solargraph', 'typecheck', '--level', 'strong',
|
|
29
|
+
def generate_errors_for_files(errors, *files)
|
|
30
|
+
result = execute(['bundle', 'exec', 'solargraph', 'typecheck', '--level', 'strong', *files])
|
|
33
31
|
return if result.success?
|
|
34
32
|
|
|
33
|
+
stderr = result.stderr.split("\n").reject { _1.include? '[WARN]' }
|
|
34
|
+
raise result.stderr unless stderr.empty?
|
|
35
|
+
|
|
35
36
|
# @type [String]
|
|
36
37
|
stdout = result.stdout
|
|
37
38
|
|
|
38
39
|
stdout.split("\n").each do |error|
|
|
39
|
-
error = parse_error(
|
|
40
|
+
error = parse_error(error)
|
|
40
41
|
errors << error unless error.nil?
|
|
41
42
|
end
|
|
42
43
|
end
|
|
43
44
|
|
|
44
|
-
# @param file [String]
|
|
45
45
|
# @param error [String]
|
|
46
46
|
# @return [Overcommit::Hook::Message, nil]
|
|
47
|
-
def parse_error(
|
|
48
|
-
# Parse the result for the line number
|
|
47
|
+
def parse_error(error)
|
|
48
|
+
# Parse the result for the line number
|
|
49
|
+
# @type [MatchData]
|
|
49
50
|
match = error.match(/^(.+?):(\d+)/)
|
|
50
51
|
return nil unless match
|
|
51
52
|
|
|
@@ -56,7 +57,7 @@ module Overcommit
|
|
|
56
57
|
message = error.sub("#{file_path}:#{lineno} - ",
|
|
57
58
|
"#{file_path}:#{lineno}: ")
|
|
58
59
|
# Emit the errors in the specified format
|
|
59
|
-
Overcommit::Hook::Message.new(:error,
|
|
60
|
+
Overcommit::Hook::Message.new(:error, file_path, lineno.to_i, message)
|
|
60
61
|
end
|
|
61
62
|
end
|
|
62
63
|
end
|
data/.overcommit.yml
CHANGED
|
@@ -35,6 +35,7 @@ PreCommit:
|
|
|
35
35
|
- '**/Rakefile'
|
|
36
36
|
- 'bin/*'
|
|
37
37
|
- 'exe/*'
|
|
38
|
+
- 'script/*'
|
|
38
39
|
problem_on_unmodified_line: warn
|
|
39
40
|
exclude:
|
|
40
41
|
- db/migrate/*.rb
|
|
@@ -50,8 +51,11 @@ PreCommit:
|
|
|
50
51
|
- '**/*.sh'
|
|
51
52
|
YamlLint:
|
|
52
53
|
enabled: true
|
|
53
|
-
flags: ['-c', '.yamllint.yml']
|
|
54
|
+
flags: ['-c', '.yamllint.yml', '--format=parsable', '--strict']
|
|
54
55
|
on_warn: fail
|
|
56
|
+
exclude:
|
|
57
|
+
- '.rubocop_todo.yml' # generated
|
|
58
|
+
- 'sorbet/**/*' # generated
|
|
55
59
|
CircleCi:
|
|
56
60
|
required_executable: 'circleci'
|
|
57
61
|
flags: ['config', 'validate']
|
|
@@ -62,13 +66,34 @@ PreCommit:
|
|
|
62
66
|
enabled: true
|
|
63
67
|
problem_on_unmodified_line: warn
|
|
64
68
|
include:
|
|
65
|
-
|
|
69
|
+
# process first
|
|
70
|
+
- "config/annotations*.rb"
|
|
71
|
+
- "**/*.rb"
|
|
72
|
+
- "**/.*.rb"
|
|
73
|
+
- "lib/tasks/*.rake"
|
|
74
|
+
- ".git-hooks/**/*.rb"
|
|
75
|
+
- "script/*"
|
|
76
|
+
- "bin/*"
|
|
77
|
+
- "bin/overcommit_branch"
|
|
78
|
+
exclude:
|
|
79
|
+
- script/.rubocop.yml
|
|
80
|
+
- vendor/**/*
|
|
81
|
+
- spec/**/*
|
|
82
|
+
- feature/**/*
|
|
83
|
+
- test/**/*
|
|
84
|
+
- ".bundle/**/*"
|
|
85
|
+
- ".markdownlint_style.rb"
|
|
66
86
|
Punchlist:
|
|
67
87
|
command: ['bundle', 'exec', 'punchlist']
|
|
68
88
|
enabled: true
|
|
69
89
|
problem_on_unmodified_line: warn
|
|
90
|
+
exclude:
|
|
91
|
+
- 'sorbet/**/*'
|
|
70
92
|
|
|
71
93
|
PrePush:
|
|
94
|
+
Brakeman:
|
|
95
|
+
enabled: true
|
|
96
|
+
flags: ['--exit-on-warn', '--quiet', '--summary', '--force']
|
|
72
97
|
RakeTarget:
|
|
73
98
|
enabled: true
|
|
74
99
|
command: ['bundle', 'exec', 'rake']
|
data/.rubocop.yml
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
---
|
|
2
|
+
inherit_from: .rubocop_todo.yml
|
|
3
|
+
|
|
2
4
|
Gemspec/RequireMFA:
|
|
3
5
|
# We publish via CI/CD, so MFA is not possible.
|
|
4
6
|
Enabled: false
|
|
@@ -13,8 +15,10 @@ Lint/EmptyClass:
|
|
|
13
15
|
# some workarounds for circular dependencies require empty classes
|
|
14
16
|
AllowComments: true
|
|
15
17
|
|
|
18
|
+
# conflicts with solargraph wanting every parameter documented with
|
|
19
|
+
# actual name and subclassing
|
|
16
20
|
Lint/UnusedMethodArgument:
|
|
17
|
-
|
|
21
|
+
Enabled: false
|
|
18
22
|
|
|
19
23
|
# https://stackoverflow.com/questions/40934345/rubocop-25-line-block-size-and-rspec-tests
|
|
20
24
|
Metrics/BlockLength:
|
|
@@ -52,6 +56,7 @@ Naming/MethodParameterName:
|
|
|
52
56
|
- e # exception
|
|
53
57
|
- x # cartesian coordinates
|
|
54
58
|
- y # cartesian coordinates
|
|
59
|
+
- n # number of things
|
|
55
60
|
|
|
56
61
|
# by default (EnforcedStyle=NormalCase) this rule doesn't like
|
|
57
62
|
# things like check_1, check_2, etc and wants check1, check2, etc. I
|
|
@@ -80,6 +85,11 @@ Style/CommentAnnotation:
|
|
|
80
85
|
- "XX\
|
|
81
86
|
X"
|
|
82
87
|
|
|
88
|
+
Style/DocumentationMethod:
|
|
89
|
+
Enabled: true
|
|
90
|
+
Include:
|
|
91
|
+
- 'lib/checkoff/*.rb'
|
|
92
|
+
|
|
83
93
|
Style/StringLiterals:
|
|
84
94
|
EnforcedStyle: single_quotes
|
|
85
95
|
SupportedStyles:
|
|
@@ -109,13 +119,21 @@ Style/TrailingCommaInHashLiteral:
|
|
|
109
119
|
Style/TrivialAccessors:
|
|
110
120
|
ExactNameMatch: true
|
|
111
121
|
|
|
122
|
+
Lint:
|
|
123
|
+
Severity: error
|
|
124
|
+
|
|
125
|
+
Metrics:
|
|
126
|
+
Severity: error
|
|
127
|
+
|
|
112
128
|
AllCops:
|
|
113
129
|
NewCops: enable
|
|
114
130
|
TargetRubyVersion: 3.0
|
|
115
131
|
Exclude:
|
|
116
132
|
- 'bin/*'
|
|
117
133
|
- 'vendor/**/*'
|
|
134
|
+
- 'sorbet/**/*'
|
|
118
135
|
|
|
119
136
|
require:
|
|
120
|
-
- rubocop-rake
|
|
121
137
|
- rubocop-minitest
|
|
138
|
+
- rubocop-performance
|
|
139
|
+
- rubocop-rake
|
data/.rubocop_todo.yml
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# This configuration was generated by
|
|
2
|
+
# `rubocop --auto-gen-config --auto-gen-only-exclude --no-exclude-limit --no-auto-gen-timestamp`
|
|
3
|
+
# using RuboCop version 1.59.0.
|
|
4
|
+
# The point is for the user to remove these configuration records
|
|
5
|
+
# one by one as the offenses are removed from the code base.
|
|
6
|
+
# Note that changes in the inspected code, or installation of new
|
|
7
|
+
# versions of RuboCop, may require this file to be generated again.
|
|
8
|
+
|
|
9
|
+
# Offense count: 20
|
|
10
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
|
|
11
|
+
Metrics/AbcSize:
|
|
12
|
+
Exclude:
|
|
13
|
+
- 'lib/checkoff/internal/asana_event_filter.rb'
|
|
14
|
+
- 'lib/checkoff/task_searches.rb'
|
|
15
|
+
- 'lib/checkoff/timelines.rb'
|
|
16
|
+
- 'test/unit/test_portfolios.rb'
|
|
17
|
+
- 'test/unit/test_task_selectors.rb'
|
|
18
|
+
- 'test/unit/test_tasks.rb'
|
|
19
|
+
- 'test/unit/test_timelines.rb'
|
|
20
|
+
|
|
21
|
+
# Offense count: 9
|
|
22
|
+
# Configuration parameters: CountComments, Max, CountAsOne.
|
|
23
|
+
Metrics/ClassLength:
|
|
24
|
+
Exclude:
|
|
25
|
+
- 'lib/checkoff/attachments.rb'
|
|
26
|
+
- 'lib/checkoff/custom_fields.rb'
|
|
27
|
+
- 'lib/checkoff/projects.rb'
|
|
28
|
+
- 'lib/checkoff/sections.rb'
|
|
29
|
+
- 'lib/checkoff/tasks.rb'
|
|
30
|
+
- 'lib/checkoff/timing.rb'
|
|
31
|
+
- 'test/unit/test_sections.rb'
|
|
32
|
+
- 'test/unit/test_tasks.rb'
|
|
33
|
+
- 'test/unit/test_timelines.rb'
|
|
34
|
+
|
|
35
|
+
# Offense count: 4
|
|
36
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
37
|
+
Metrics/CyclomaticComplexity:
|
|
38
|
+
Exclude:
|
|
39
|
+
- 'lib/checkoff/internal/asana_event_filter.rb'
|
|
40
|
+
- 'lib/checkoff/internal/task_timing.rb'
|
|
41
|
+
- 'lib/checkoff/timelines.rb'
|
|
42
|
+
|
|
43
|
+
# Offense count: 12
|
|
44
|
+
# Configuration parameters: CountComments, Max, CountAsOne, AllowedMethods, AllowedPatterns.
|
|
45
|
+
Metrics/MethodLength:
|
|
46
|
+
Exclude:
|
|
47
|
+
- 'lib/checkoff/attachments.rb'
|
|
48
|
+
- 'lib/checkoff/internal/asana_event_filter.rb'
|
|
49
|
+
- 'lib/checkoff/internal/search_url/date_param_converter.rb'
|
|
50
|
+
- 'lib/checkoff/my_tasks.rb'
|
|
51
|
+
- 'lib/checkoff/task_searches.rb'
|
|
52
|
+
- 'lib/checkoff/tasks.rb'
|
|
53
|
+
- 'lib/checkoff/timelines.rb'
|
|
54
|
+
- 'lib/checkoff/timing.rb'
|
|
55
|
+
|
|
56
|
+
# Offense count: 2
|
|
57
|
+
# Configuration parameters: AllowedMethods, AllowedPatterns, Max.
|
|
58
|
+
Metrics/PerceivedComplexity:
|
|
59
|
+
Exclude:
|
|
60
|
+
- 'lib/checkoff/timelines.rb'
|
|
61
|
+
|
|
62
|
+
# Offense count: 2
|
|
63
|
+
# Configuration parameters: MinSize.
|
|
64
|
+
Performance/CollectionLiteralInLoop:
|
|
65
|
+
Exclude:
|
|
66
|
+
- 'lib/checkoff/tasks.rb'
|
|
67
|
+
- 'test/unit/test_helper.rb'
|
|
68
|
+
|
|
69
|
+
# Offense count: 1
|
|
70
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
71
|
+
Performance/InefficientHashSearch:
|
|
72
|
+
Exclude:
|
|
73
|
+
- 'lib/checkoff/internal/asana_event_filter.rb'
|
|
74
|
+
|
|
75
|
+
# Offense count: 1
|
|
76
|
+
# This cop supports unsafe autocorrection (--autocorrect-all).
|
|
77
|
+
# Configuration parameters: AllowRegexpMatch.
|
|
78
|
+
Performance/RedundantEqualityComparisonBlock:
|
|
79
|
+
Exclude:
|
|
80
|
+
- 'lib/checkoff/internal/selector_classes/task.rb'
|
|
81
|
+
|
|
82
|
+
# Offense count: 13
|
|
83
|
+
# Configuration parameters: RequireForNonPublicMethods.
|
|
84
|
+
Style/DocumentationMethod:
|
|
85
|
+
Exclude:
|
|
86
|
+
- 'spec/**/*'
|
|
87
|
+
- 'test/**/*'
|
|
88
|
+
- 'lib/checkoff/cli.rb'
|
|
89
|
+
- 'lib/checkoff/clients.rb'
|
|
90
|
+
- 'lib/checkoff/tags.rb'
|
data/.solargraph.yml
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
1
|
---
|
|
2
2
|
include:
|
|
3
|
+
# process first
|
|
4
|
+
- "config/annotations*.rb"
|
|
3
5
|
- "**/*.rb"
|
|
6
|
+
- "**/.*.rb"
|
|
7
|
+
- "lib/tasks/*.rake"
|
|
4
8
|
- ".git-hooks/**/*.rb"
|
|
9
|
+
- "script/*"
|
|
10
|
+
- "bin/*"
|
|
11
|
+
- "bin/overcommit_branch"
|
|
5
12
|
exclude:
|
|
13
|
+
- script/.rubocop.yml
|
|
14
|
+
- vendor/**/*
|
|
6
15
|
- spec/**/*
|
|
7
16
|
- feature/**/*
|
|
8
17
|
- test/**/*
|
|
9
|
-
- vendor/**/*
|
|
10
18
|
- ".bundle/**/*"
|
|
19
|
+
- ".markdownlint_style.rb"
|
|
11
20
|
require: []
|
|
12
21
|
domains: []
|
|
13
22
|
reporters:
|
data/DEVELOPMENT.md
CHANGED
data/Gemfile
CHANGED
|
@@ -7,8 +7,10 @@ gemspec
|
|
|
7
7
|
|
|
8
8
|
gem 'bump'
|
|
9
9
|
gem 'bundler'
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
gem 'brakeman'
|
|
11
12
|
gem 'mdl'
|
|
13
|
+
|
|
12
14
|
# not a direct dependency - but updates a lot and confuses
|
|
13
15
|
# bump+overcommit+bundler when it unexpectedly updates during the
|
|
14
16
|
# CircleCI publish step
|
|
@@ -18,21 +20,22 @@ gem 'mime-types', ['=3.5.1']
|
|
|
18
20
|
gem 'minitest-profile'
|
|
19
21
|
gem 'minitest-reporters'
|
|
20
22
|
gem 'mocha', ['>= 2']
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
# so let's favor the more recent version...
|
|
24
|
-
gem 'overcommit', ['>=0.60.0', '<0.61.0']
|
|
23
|
+
gem 'ostruct'
|
|
24
|
+
gem 'overcommit', ['>=0.64.0', '<0.65.0']
|
|
25
25
|
gem 'pry'
|
|
26
|
-
gem 'punchlist'
|
|
27
|
-
gem 'rake'
|
|
26
|
+
gem 'punchlist', ['>=1.3.1']
|
|
27
|
+
gem 'rake'
|
|
28
28
|
gem 'rbs'
|
|
29
29
|
gem 'rubocop', ['~> 1.52']
|
|
30
30
|
gem 'rubocop-minitest'
|
|
31
|
+
gem 'rubocop-performance'
|
|
31
32
|
gem 'rubocop-rake'
|
|
32
33
|
# ensure version with branch coverage
|
|
33
34
|
gem 'simplecov', ['>=0.18.0']
|
|
34
35
|
gem 'simplecov-lcov'
|
|
35
|
-
gem 'solargraph',
|
|
36
|
+
gem 'solargraph',
|
|
37
|
+
git: 'https://github.com/apiology/solargraph',
|
|
38
|
+
branch: 'master'
|
|
36
39
|
gem 'undercover'
|
|
37
40
|
gem 'webmock'
|
|
38
41
|
gem 'yard'
|