checkoff 0.201.0 → 0.203.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (148) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +130 -28
  3. data/.git-hooks/pre_commit/solargraph_typecheck.rb +12 -11
  4. data/.overcommit.yml +27 -2
  5. data/.rubocop.yml +20 -2
  6. data/.rubocop_todo.yml +90 -0
  7. data/.solargraph.yml +10 -1
  8. data/DEVELOPMENT.md +1 -1
  9. data/Gemfile +11 -8
  10. data/Gemfile.lock +66 -42
  11. data/LICENSE +1 -1
  12. data/Makefile +14 -12
  13. data/bin/brakeman +27 -0
  14. data/bin/overcommit_branch +117 -0
  15. data/bin/spoom +27 -0
  16. data/bin/srb +27 -0
  17. data/bin/srb-rbi +27 -0
  18. data/bin/tapioca +27 -0
  19. data/config/annotations_misc.rb +35 -0
  20. data/docs/cookiecutter_input.json +1 -0
  21. data/fix.sh +14 -6
  22. data/lib/checkoff/internal/search_url/simple_param_converter.rb +11 -0
  23. data/lib/checkoff/version.rb +1 -1
  24. data/requirements_dev.txt +1 -1
  25. data/sorbet/config +4 -0
  26. data/sorbet/rbi/annotations/.gitattributes +1 -0
  27. data/sorbet/rbi/annotations/activesupport.rbi +453 -0
  28. data/sorbet/rbi/annotations/faraday.rbi +17 -0
  29. data/sorbet/rbi/annotations/minitest.rbi +119 -0
  30. data/sorbet/rbi/annotations/mocha.rbi +34 -0
  31. data/sorbet/rbi/annotations/rainbow.rbi +269 -0
  32. data/sorbet/rbi/annotations/webmock.rbi +9 -0
  33. data/sorbet/rbi/dsl/.gitattributes +1 -0
  34. data/sorbet/rbi/dsl/active_support/callbacks.rbi +23 -0
  35. data/sorbet/rbi/gems/.gitattributes +1 -0
  36. data/sorbet/rbi/gems/activesupport@7.1.3.rbi +18749 -0
  37. data/sorbet/rbi/gems/addressable@2.8.6.rbi +1994 -0
  38. data/sorbet/rbi/gems/ansi@1.5.0.rbi +688 -0
  39. data/sorbet/rbi/gems/asana@0.10.6-ab9393136d9ca59b75e42a661fdddc1c65c8f7c3.rbi +6142 -0
  40. data/sorbet/rbi/gems/ast@2.4.2.rbi +585 -0
  41. data/sorbet/rbi/gems/backport@1.2.0.rbi +523 -0
  42. data/sorbet/rbi/gems/base64@0.2.0.rbi +509 -0
  43. data/sorbet/rbi/gems/benchmark@0.4.0.rbi +618 -0
  44. data/sorbet/rbi/gems/bigdecimal@3.1.5.rbi +78 -0
  45. data/sorbet/rbi/gems/builder@3.2.4.rbi +505 -0
  46. data/sorbet/rbi/gems/bump@0.10.0.rbi +169 -0
  47. data/sorbet/rbi/gems/cache@0.4.1.rbi +211 -0
  48. data/sorbet/rbi/gems/cache_method@0.2.7.rbi +293 -0
  49. data/sorbet/rbi/gems/chef-utils@18.3.0.rbi +9 -0
  50. data/sorbet/rbi/gems/childprocess@5.1.0.rbi +383 -0
  51. data/sorbet/rbi/gems/coderay@1.1.3.rbi +3427 -0
  52. data/sorbet/rbi/gems/concurrent-ruby@1.2.3.rbi +11591 -0
  53. data/sorbet/rbi/gems/connection_pool@2.4.1.rbi +9 -0
  54. data/sorbet/rbi/gems/crack@0.4.5.rbi +145 -0
  55. data/sorbet/rbi/gems/diff-lcs@1.5.1.rbi +969 -0
  56. data/sorbet/rbi/gems/docile@1.4.0.rbi +377 -0
  57. data/sorbet/rbi/gems/drb@2.2.0.rbi +1347 -0
  58. data/sorbet/rbi/gems/e2mmap@0.1.0.rbi +9 -0
  59. data/sorbet/rbi/gems/erubi@1.13.0.rbi +152 -0
  60. data/sorbet/rbi/gems/faraday-em_http@1.0.0.rbi +222 -0
  61. data/sorbet/rbi/gems/faraday-em_synchrony@1.0.0.rbi +126 -0
  62. data/sorbet/rbi/gems/faraday-excon@1.1.0.rbi +136 -0
  63. data/sorbet/rbi/gems/faraday-httpclient@1.0.1.rbi +145 -0
  64. data/sorbet/rbi/gems/faraday-multipart@1.0.4.rbi +259 -0
  65. data/sorbet/rbi/gems/faraday-net_http@1.0.1.rbi +142 -0
  66. data/sorbet/rbi/gems/faraday-net_http_persistent@1.2.0.rbi +118 -0
  67. data/sorbet/rbi/gems/faraday-patron@1.0.0.rbi +125 -0
  68. data/sorbet/rbi/gems/faraday-rack@1.0.0.rbi +133 -0
  69. data/sorbet/rbi/gems/faraday-retry@1.0.3.rbi +198 -0
  70. data/sorbet/rbi/gems/faraday@1.10.3.rbi +2729 -0
  71. data/sorbet/rbi/gems/faraday_middleware-multi_json@0.0.6.rbi +29 -0
  72. data/sorbet/rbi/gems/faraday_middleware@1.2.0.rbi +1004 -0
  73. data/sorbet/rbi/gems/gli@2.21.1.rbi +9 -0
  74. data/sorbet/rbi/gems/hashdiff@1.0.1.rbi +351 -0
  75. data/sorbet/rbi/gems/i18n@1.14.1.rbi +2326 -0
  76. data/sorbet/rbi/gems/imagen@0.1.8.rbi +340 -0
  77. data/sorbet/rbi/gems/iniparse@1.5.0.rbi +899 -0
  78. data/sorbet/rbi/gems/jaro_winkler@1.6.0.rbi +22 -0
  79. data/sorbet/rbi/gems/json@2.7.1.rbi +1562 -0
  80. data/sorbet/rbi/gems/jwt@2.7.1.rbi +1405 -0
  81. data/sorbet/rbi/gems/kramdown-parser-gfm@1.1.0.rbi +128 -0
  82. data/sorbet/rbi/gems/kramdown@2.4.0.rbi +3272 -0
  83. data/sorbet/rbi/gems/language_server-protocol@3.17.0.3.rbi +14238 -0
  84. data/sorbet/rbi/gems/logger@1.6.1.rbi +920 -0
  85. data/sorbet/rbi/gems/mdl@0.13.0.rbi +445 -0
  86. data/sorbet/rbi/gems/method_source@1.0.0.rbi +273 -0
  87. data/sorbet/rbi/gems/mime-types-data@3.2023.1205.rbi +127 -0
  88. data/sorbet/rbi/gems/mime-types@3.5.1.rbi +1252 -0
  89. data/sorbet/rbi/gems/minitest-profile@0.0.2.rbi +136 -0
  90. data/sorbet/rbi/gems/minitest-reporters@1.6.1.rbi +1014 -0
  91. data/sorbet/rbi/gems/minitest@5.21.1.rbi +1539 -0
  92. data/sorbet/rbi/gems/mixlib-cli@2.1.8.rbi +314 -0
  93. data/sorbet/rbi/gems/mixlib-config@3.0.27.rbi +581 -0
  94. data/sorbet/rbi/gems/mixlib-shellout@3.2.7.rbi +629 -0
  95. data/sorbet/rbi/gems/mocha@2.1.0.rbi +12 -0
  96. data/sorbet/rbi/gems/multi_json@1.15.0.rbi +268 -0
  97. data/sorbet/rbi/gems/multi_xml@0.6.0.rbi +102 -0
  98. data/sorbet/rbi/gems/multipart-post@2.3.0.rbi +234 -0
  99. data/sorbet/rbi/gems/mutex_m@0.2.0.rbi +94 -0
  100. data/sorbet/rbi/gems/netrc@0.11.0.rbi +159 -0
  101. data/sorbet/rbi/gems/nokogiri@1.16.7.rbi +7311 -0
  102. data/sorbet/rbi/gems/oauth2@1.4.11.rbi +833 -0
  103. data/sorbet/rbi/gems/ostruct@0.6.1.rbi +354 -0
  104. data/sorbet/rbi/gems/overcommit@0.64.0.rbi +2400 -0
  105. data/sorbet/rbi/gems/parallel@1.23.0.rbi +274 -0
  106. data/sorbet/rbi/gems/parser@3.2.2.4.rbi +7253 -0
  107. data/sorbet/rbi/gems/prism@1.2.0.rbi +39085 -0
  108. data/sorbet/rbi/gems/pry@0.14.2.rbi +10070 -0
  109. data/sorbet/rbi/gems/public_suffix@5.0.4.rbi +936 -0
  110. data/sorbet/rbi/gems/punchlist@1.3.2.rbi +173 -0
  111. data/sorbet/rbi/gems/racc@1.7.3.rbi +162 -0
  112. data/sorbet/rbi/gems/rack@3.0.8.rbi +5184 -0
  113. data/sorbet/rbi/gems/rainbow@3.1.1.rbi +403 -0
  114. data/sorbet/rbi/gems/rake@13.1.0.rbi +3022 -0
  115. data/sorbet/rbi/gems/rbi@0.2.1.rbi +4535 -0
  116. data/sorbet/rbi/gems/rbs@2.8.4.rbi +5613 -0
  117. data/sorbet/rbi/gems/regexp_parser@2.8.3.rbi +3750 -0
  118. data/sorbet/rbi/gems/reverse_markdown@2.1.1.rbi +390 -0
  119. data/sorbet/rbi/gems/rexml@3.2.6.rbi +4888 -0
  120. data/sorbet/rbi/gems/rubocop-ast@1.30.0.rbi +7061 -0
  121. data/sorbet/rbi/gems/rubocop-minitest@0.34.5.rbi +2577 -0
  122. data/sorbet/rbi/gems/rubocop-performance@1.20.2.rbi +3262 -0
  123. data/sorbet/rbi/gems/rubocop-rake@0.6.0.rbi +329 -0
  124. data/sorbet/rbi/gems/rubocop@1.59.0.rbi +57238 -0
  125. data/sorbet/rbi/gems/ruby-progressbar@1.13.0.rbi +1318 -0
  126. data/sorbet/rbi/gems/ruby2_keywords@0.0.5.rbi +9 -0
  127. data/sorbet/rbi/gems/rugged@1.6.3.rbi +1577 -0
  128. data/sorbet/rbi/gems/simplecov-html@0.12.3.rbi +217 -0
  129. data/sorbet/rbi/gems/simplecov-lcov@0.8.0.rbi +256 -0
  130. data/sorbet/rbi/gems/simplecov@0.22.0.rbi +2149 -0
  131. data/sorbet/rbi/gems/simplecov_json_formatter@0.1.4.rbi +9 -0
  132. data/sorbet/rbi/gems/solargraph@0.50.1-904b9304770a59fac393c5cc3cad481e5bdf0fd8.rbi +9396 -0
  133. data/sorbet/rbi/gems/source_finder@3.2.1.rbi +317 -0
  134. data/sorbet/rbi/gems/spoom@1.5.0.rbi +4932 -0
  135. data/sorbet/rbi/gems/tapioca@0.16.4.rbi +3604 -0
  136. data/sorbet/rbi/gems/thor@1.3.2.rbi +4378 -0
  137. data/sorbet/rbi/gems/tilt@2.4.0.rbi +933 -0
  138. data/sorbet/rbi/gems/tomlrb@2.0.3.rbi +9 -0
  139. data/sorbet/rbi/gems/tzinfo@2.0.6.rbi +5918 -0
  140. data/sorbet/rbi/gems/undercover@0.5.0.rbi +433 -0
  141. data/sorbet/rbi/gems/unicode-display_width@2.5.0.rbi +66 -0
  142. data/sorbet/rbi/gems/webmock@3.19.1.rbi +1769 -0
  143. data/sorbet/rbi/gems/yard-sorbet@0.9.0.rbi +435 -0
  144. data/sorbet/rbi/gems/yard@0.9.34.rbi +18247 -0
  145. data/sorbet/rbi/todo.rbi +11 -0
  146. data/sorbet/tapioca/config.yml +13 -0
  147. data/sorbet/tapioca/require.rb +4 -0
  148. metadata +134 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 27306c71eb86f04c2881f717bdb79bcaf5a98a500c2f98eac6e83de3d6a1e606
4
- data.tar.gz: bdb66456ccb31155310b34244f3582fcfcf0a1e2403d7b9e431fbe26f18df49e
3
+ metadata.gz: eea1d4895348c513ce00ca2e7d494843632a1d3c0a35aa94325e6d9b3e57c608
4
+ data.tar.gz: e051b9884aaceef0bc7f4abf37c837b479a927df08c42ef71ec7b23da9af2d2d
5
5
  SHA512:
6
- metadata.gz: be78a2c82ce183a0dc482ad207933aa03fdccf5791677d59b180b839ade298c14e2b370eec768f7467e57190542cbcdbeae0ed1d28a96461f94e49a61254b056
7
- data.tar.gz: 88d394107f9de38d9c3df1ef179d1cc5b5c577bc66b1858618447b397d0a202edd698d76715d2714f7c49b91de0745beabd7935e721a342e5db94187af27cd70
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
- key: gems-v2-{{ checksum "Gemfile.lock.deversioned" }}
37
+ keys:
38
+ - gems-v2-{{ checksum "Gemfile.lock" }}
39
+ - gems-v2-
40
+ - gems-
41
41
  - restore_cache:
42
- key: wheels-v1-3.12.1-{{ checksum "requirements_dev.txt" }}
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.deversioned" }}
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
- overcommit:
72
- description: "Run overcommit"
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
- bundle exec overcommit --run
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
- overcommit:
181
+ quality:
88
182
  working_directory: ~/checkoff
89
183
  docker:
90
184
  - image: apiology/circleci-ruby:latest
91
185
  steps:
92
- - when:
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: test
110
- command: make citest cicoverage
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
- - overcommit
155
- overcommit:
256
+ - quality
257
+ quality:
156
258
  jobs:
157
- - overcommit
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.each do |file|
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 generate_errors_for_file(file, errors)
32
- result = execute(['bundle', 'exec', 'solargraph', 'typecheck', '--level', 'strong', file])
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(file, 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(file, error)
48
- # Parse the result for the line number # @type [MatchData]
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, file, lineno.to_i, message)
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
- - '**/*.rb'
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
- AllowUnusedKeywordArguments: true
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
@@ -56,7 +56,7 @@ git log "v$(bump current)..."
56
56
  # Set type_of_bump to patch, minor, or major
57
57
  bump --tag --tag-prefix=v ${type_of_bump:?}
58
58
  rake release
59
- git push
59
+ git push --no-verify
60
60
  git push --tags
61
61
  ```
62
62
 
data/Gemfile CHANGED
@@ -7,8 +7,10 @@ gemspec
7
7
 
8
8
  gem 'bump'
9
9
  gem 'bundler'
10
- gem 'fakeweb'
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
- # 0.58.0 and 0.57.0 don't seem super compatible with signatures, and
22
- # magit doesn't seem to want to use the bundled version at the moment,
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', '~> 13.0'
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', ['>=0.50.0']
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'