shoryuken 6.2.1 → 7.0.2

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.
Files changed (205) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/push.yml +36 -0
  3. data/.github/workflows/specs.yml +49 -44
  4. data/.github/workflows/verify-action-pins.yml +16 -0
  5. data/.gitignore +4 -1
  6. data/.rspec +3 -1
  7. data/.rubocop.yml +6 -1
  8. data/.ruby-version +1 -0
  9. data/.yard-lint.yml +279 -0
  10. data/CHANGELOG.md +308 -139
  11. data/Gemfile +1 -8
  12. data/Gemfile.lint +9 -0
  13. data/Gemfile.lint.lock +69 -0
  14. data/README.md +16 -33
  15. data/Rakefile +6 -10
  16. data/bin/clean_sqs +52 -0
  17. data/bin/cli/base.rb +22 -2
  18. data/bin/cli/sqs.rb +74 -7
  19. data/bin/integrations +275 -0
  20. data/bin/scenario +154 -0
  21. data/bin/shoryuken +3 -2
  22. data/docker-compose.yml +6 -0
  23. data/lib/{shoryuken/extensions/active_job_extensions.rb → active_job/extensions.rb} +20 -6
  24. data/lib/active_job/queue_adapters/shoryuken_adapter.rb +208 -0
  25. data/lib/active_job/queue_adapters/shoryuken_concurrent_send_adapter.rb +78 -0
  26. data/lib/shoryuken/active_job/current_attributes.rb +139 -0
  27. data/lib/shoryuken/active_job/job_wrapper.rb +28 -0
  28. data/lib/shoryuken/body_parser.rb +11 -1
  29. data/lib/shoryuken/client.rb +16 -0
  30. data/lib/shoryuken/default_exception_handler.rb +11 -0
  31. data/lib/shoryuken/default_worker_registry.rb +39 -11
  32. data/lib/shoryuken/environment_loader.rb +85 -15
  33. data/lib/shoryuken/errors.rb +36 -0
  34. data/lib/shoryuken/fetcher.rb +41 -3
  35. data/lib/shoryuken/helpers/atomic_boolean.rb +58 -0
  36. data/lib/shoryuken/helpers/atomic_counter.rb +104 -0
  37. data/lib/shoryuken/helpers/atomic_hash.rb +182 -0
  38. data/lib/shoryuken/helpers/hash_utils.rb +56 -0
  39. data/lib/shoryuken/helpers/string_utils.rb +65 -0
  40. data/lib/shoryuken/helpers/timer_task.rb +80 -0
  41. data/lib/shoryuken/inline_message.rb +22 -0
  42. data/lib/shoryuken/launcher.rb +55 -0
  43. data/lib/shoryuken/logging/base.rb +26 -0
  44. data/lib/shoryuken/logging/pretty.rb +25 -0
  45. data/lib/shoryuken/logging/without_timestamp.rb +25 -0
  46. data/lib/shoryuken/logging.rb +43 -15
  47. data/lib/shoryuken/manager.rb +84 -5
  48. data/lib/shoryuken/message.rb +116 -1
  49. data/lib/shoryuken/middleware/chain.rb +141 -43
  50. data/lib/shoryuken/middleware/entry.rb +30 -0
  51. data/lib/shoryuken/middleware/server/active_record.rb +10 -0
  52. data/lib/shoryuken/middleware/server/auto_delete.rb +12 -0
  53. data/lib/shoryuken/middleware/server/auto_extend_visibility.rb +37 -11
  54. data/lib/shoryuken/middleware/server/exponential_backoff_retry.rb +34 -3
  55. data/lib/shoryuken/middleware/server/non_retryable_exception.rb +95 -0
  56. data/lib/shoryuken/middleware/server/timing.rb +13 -0
  57. data/lib/shoryuken/options.rb +154 -13
  58. data/lib/shoryuken/polling/base_strategy.rb +127 -0
  59. data/lib/shoryuken/polling/queue_configuration.rb +103 -0
  60. data/lib/shoryuken/polling/strict_priority.rb +41 -0
  61. data/lib/shoryuken/polling/weighted_round_robin.rb +44 -0
  62. data/lib/shoryuken/processor.rb +37 -3
  63. data/lib/shoryuken/queue.rb +99 -8
  64. data/lib/shoryuken/runner.rb +54 -16
  65. data/lib/shoryuken/util.rb +32 -7
  66. data/lib/shoryuken/version.rb +4 -1
  67. data/lib/shoryuken/worker/default_executor.rb +23 -1
  68. data/lib/shoryuken/worker/inline_executor.rb +33 -2
  69. data/lib/shoryuken/worker.rb +224 -0
  70. data/lib/shoryuken/worker_registry.rb +35 -0
  71. data/lib/shoryuken.rb +27 -38
  72. data/renovate.json +62 -0
  73. data/shoryuken.gemspec +8 -4
  74. data/spec/integration/.rspec +1 -0
  75. data/spec/integration/active_job/adapter_configuration/configuration_spec.rb +26 -0
  76. data/spec/integration/active_job/bulk_enqueue/bulk_enqueue_spec.rb +53 -0
  77. data/spec/integration/active_job/current_attributes/bulk_enqueue_spec.rb +50 -0
  78. data/spec/integration/active_job/current_attributes/complex_types_spec.rb +55 -0
  79. data/spec/integration/active_job/current_attributes/empty_context_spec.rb +41 -0
  80. data/spec/integration/active_job/current_attributes/full_context_spec.rb +63 -0
  81. data/spec/integration/active_job/current_attributes/partial_context_spec.rb +57 -0
  82. data/spec/integration/active_job/custom_attributes/number_attributes_spec.rb +37 -0
  83. data/spec/integration/active_job/custom_attributes/string_attributes_spec.rb +39 -0
  84. data/spec/integration/active_job/error_handling/job_wrapper_spec.rb +53 -0
  85. data/spec/integration/active_job/fifo_and_attributes/deduplication_spec.rb +86 -0
  86. data/spec/integration/active_job/keyword_arguments/keyword_arguments_spec.rb +63 -0
  87. data/spec/integration/active_job/retry/discard_on_spec.rb +43 -0
  88. data/spec/integration/active_job/retry/retry_on_spec.rb +36 -0
  89. data/spec/integration/active_job/roundtrip/roundtrip_spec.rb +52 -0
  90. data/spec/integration/active_job/scheduled/scheduled_spec.rb +76 -0
  91. data/spec/integration/active_record_middleware/active_record_middleware_spec.rb +84 -0
  92. data/spec/integration/auto_delete/auto_delete_spec.rb +53 -0
  93. data/spec/integration/auto_extend_visibility/auto_extend_visibility_spec.rb +57 -0
  94. data/spec/integration/aws_config/aws_config_spec.rb +59 -0
  95. data/spec/integration/batch_processing/batch_processing_spec.rb +37 -0
  96. data/spec/integration/body_parser/json_parser_spec.rb +45 -0
  97. data/spec/integration/body_parser/proc_parser_spec.rb +54 -0
  98. data/spec/integration/body_parser/text_parser_spec.rb +43 -0
  99. data/spec/integration/concurrent_processing/concurrent_processing_spec.rb +45 -0
  100. data/spec/integration/custom_group_polling_strategy/custom_group_polling_strategy_spec.rb +87 -0
  101. data/spec/integration/dead_letter_queue/dead_letter_queue_spec.rb +91 -0
  102. data/spec/integration/exception_handlers/exception_handlers_spec.rb +69 -0
  103. data/spec/integration/exponential_backoff/exponential_backoff_spec.rb +67 -0
  104. data/spec/integration/fifo_ordering/fifo_ordering_spec.rb +44 -0
  105. data/spec/integration/large_payloads/large_payloads_spec.rb +30 -0
  106. data/spec/integration/launcher/launcher_spec.rb +40 -0
  107. data/spec/integration/message_attributes/message_attributes_spec.rb +54 -0
  108. data/spec/integration/message_operations/message_operations_spec.rb +59 -0
  109. data/spec/integration/middleware_chain/empty_chain_spec.rb +11 -0
  110. data/spec/integration/middleware_chain/execution_order_spec.rb +33 -0
  111. data/spec/integration/middleware_chain/removal_spec.rb +31 -0
  112. data/spec/integration/middleware_chain/short_circuit_spec.rb +40 -0
  113. data/spec/integration/non_retryable_exception/non_retryable_exception_spec.rb +149 -0
  114. data/spec/integration/polling_strategies/polling_strategies_spec.rb +46 -0
  115. data/spec/integration/queue_operations/queue_operations_spec.rb +84 -0
  116. data/spec/integration/rails/rails_72/Gemfile +6 -0
  117. data/spec/integration/rails/rails_72/activejob_adapter_spec.rb +98 -0
  118. data/spec/integration/rails/rails_80/Gemfile +6 -0
  119. data/spec/integration/rails/rails_80/activejob_adapter_spec.rb +98 -0
  120. data/spec/integration/rails/rails_80/continuation_spec.rb +79 -0
  121. data/spec/integration/rails/rails_81/Gemfile +6 -0
  122. data/spec/integration/rails/rails_81/activejob_adapter_spec.rb +98 -0
  123. data/spec/integration/rails/rails_81/continuation_spec.rb +79 -0
  124. data/spec/integration/retry_behavior/retry_behavior_spec.rb +45 -0
  125. data/spec/integration/spec_helper.rb +7 -0
  126. data/spec/integration/strict_priority_polling/strict_priority_polling_spec.rb +58 -0
  127. data/spec/integration/visibility_timeout/visibility_timeout_spec.rb +37 -0
  128. data/spec/integration/worker_enqueueing/worker_enqueueing_spec.rb +60 -0
  129. data/spec/integration/worker_groups/worker_groups_spec.rb +79 -0
  130. data/spec/integration/worker_lifecycle/worker_lifecycle_spec.rb +33 -0
  131. data/spec/integrations_helper.rb +243 -0
  132. data/spec/lib/active_job/extensions_spec.rb +225 -0
  133. data/spec/lib/active_job/queue_adapters/shoryuken_adapter_spec.rb +29 -0
  134. data/spec/{shoryuken/extensions/active_job_concurrent_send_adapter_spec.rb → lib/active_job/queue_adapters/shoryuken_concurrent_send_adapter_spec.rb} +5 -4
  135. data/spec/{shoryuken/extensions/active_job_wrapper_spec.rb → lib/shoryuken/active_job/job_wrapper_spec.rb} +6 -5
  136. data/spec/{shoryuken → lib/shoryuken}/body_parser_spec.rb +2 -4
  137. data/spec/{shoryuken → lib/shoryuken}/client_spec.rb +1 -1
  138. data/spec/{shoryuken → lib/shoryuken}/default_exception_handler_spec.rb +9 -10
  139. data/spec/{shoryuken → lib/shoryuken}/default_worker_registry_spec.rb +1 -2
  140. data/spec/{shoryuken → lib/shoryuken}/environment_loader_spec.rb +10 -9
  141. data/spec/{shoryuken → lib/shoryuken}/fetcher_spec.rb +23 -26
  142. data/spec/lib/shoryuken/helpers/atomic_boolean_spec.rb +196 -0
  143. data/spec/lib/shoryuken/helpers/atomic_counter_spec.rb +177 -0
  144. data/spec/lib/shoryuken/helpers/atomic_hash_spec.rb +307 -0
  145. data/spec/lib/shoryuken/helpers/hash_utils_spec.rb +145 -0
  146. data/spec/lib/shoryuken/helpers/string_utils_spec.rb +124 -0
  147. data/spec/lib/shoryuken/helpers/timer_task_spec.rb +298 -0
  148. data/spec/lib/shoryuken/helpers_integration_spec.rb +96 -0
  149. data/spec/lib/shoryuken/inline_message_spec.rb +196 -0
  150. data/spec/{shoryuken → lib/shoryuken}/launcher_spec.rb +23 -2
  151. data/spec/lib/shoryuken/logging_spec.rb +242 -0
  152. data/spec/{shoryuken → lib/shoryuken}/manager_spec.rb +1 -2
  153. data/spec/lib/shoryuken/message_spec.rb +109 -0
  154. data/spec/{shoryuken → lib/shoryuken}/middleware/chain_spec.rb +1 -1
  155. data/spec/lib/shoryuken/middleware/entry_spec.rb +68 -0
  156. data/spec/lib/shoryuken/middleware/server/active_record_spec.rb +133 -0
  157. data/spec/{shoryuken → lib/shoryuken}/middleware/server/auto_delete_spec.rb +1 -1
  158. data/spec/{shoryuken → lib/shoryuken}/middleware/server/auto_extend_visibility_spec.rb +51 -1
  159. data/spec/{shoryuken → lib/shoryuken}/middleware/server/exponential_backoff_retry_spec.rb +1 -1
  160. data/spec/lib/shoryuken/middleware/server/non_retryable_exception_spec.rb +214 -0
  161. data/spec/{shoryuken → lib/shoryuken}/middleware/server/timing_spec.rb +1 -1
  162. data/spec/{shoryuken → lib/shoryuken}/options_spec.rb +49 -6
  163. data/spec/lib/shoryuken/polling/base_strategy_spec.rb +280 -0
  164. data/spec/lib/shoryuken/polling/queue_configuration_spec.rb +195 -0
  165. data/spec/{shoryuken → lib/shoryuken}/polling/strict_priority_spec.rb +1 -1
  166. data/spec/{shoryuken → lib/shoryuken}/polling/weighted_round_robin_spec.rb +1 -1
  167. data/spec/{shoryuken → lib/shoryuken}/processor_spec.rb +1 -1
  168. data/spec/{shoryuken → lib/shoryuken}/queue_spec.rb +2 -3
  169. data/spec/{shoryuken → lib/shoryuken}/runner_spec.rb +1 -3
  170. data/spec/{shoryuken → lib/shoryuken}/util_spec.rb +2 -2
  171. data/spec/lib/shoryuken/version_spec.rb +17 -0
  172. data/spec/{shoryuken → lib/shoryuken}/worker/default_executor_spec.rb +1 -1
  173. data/spec/lib/shoryuken/worker/inline_executor_spec.rb +105 -0
  174. data/spec/lib/shoryuken/worker_registry_spec.rb +63 -0
  175. data/spec/{shoryuken → lib/shoryuken}/worker_spec.rb +15 -11
  176. data/spec/{shoryuken_spec.rb → lib/shoryuken_spec.rb} +1 -1
  177. data/spec/shared_examples_for_active_job.rb +40 -15
  178. data/spec/spec_helper.rb +48 -2
  179. metadata +295 -101
  180. data/.codeclimate.yml +0 -20
  181. data/.devcontainer/Dockerfile +0 -17
  182. data/.devcontainer/base.Dockerfile +0 -43
  183. data/.devcontainer/devcontainer.json +0 -35
  184. data/.github/FUNDING.yml +0 -12
  185. data/.github/dependabot.yml +0 -6
  186. data/.github/workflows/stale.yml +0 -20
  187. data/.reek.yml +0 -5
  188. data/Appraisals +0 -42
  189. data/gemfiles/.gitignore +0 -1
  190. data/gemfiles/aws_sdk_core_2.gemfile +0 -21
  191. data/gemfiles/rails_4_2.gemfile +0 -20
  192. data/gemfiles/rails_5_2.gemfile +0 -21
  193. data/gemfiles/rails_6_0.gemfile +0 -21
  194. data/gemfiles/rails_6_1.gemfile +0 -21
  195. data/gemfiles/rails_7_0.gemfile +0 -22
  196. data/lib/shoryuken/core_ext.rb +0 -69
  197. data/lib/shoryuken/extensions/active_job_adapter.rb +0 -103
  198. data/lib/shoryuken/extensions/active_job_concurrent_send_adapter.rb +0 -50
  199. data/lib/shoryuken/polling/base.rb +0 -67
  200. data/shoryuken.jpg +0 -0
  201. data/spec/integration/launcher_spec.rb +0 -128
  202. data/spec/shoryuken/core_ext_spec.rb +0 -40
  203. data/spec/shoryuken/extensions/active_job_adapter_spec.rb +0 -7
  204. data/spec/shoryuken/extensions/active_job_base_spec.rb +0 -84
  205. data/spec/shoryuken/worker/inline_executor_spec.rb +0 -49
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6168df5d49a143c56908e559afcaddc28f7416176881429069cd12680db867c6
4
- data.tar.gz: 1c3a73c4e269457b29962f0a0ac9ba56093ab58cbfab7b00c9aa79c0eb7cb186
3
+ metadata.gz: 63763ea11f3377475150b2270c7162fa5cb9a35e39cdd2a534e353837dc3e6ff
4
+ data.tar.gz: f265d74ebdb8a087cb658a8f442489523305e7cd551e5fae4ae16f9709f238ae
5
5
  SHA512:
6
- metadata.gz: 3ba49924964a3c98336a3b68e008d831549247574d2f180c72e600bef1dfbcdfa142a863d5e49b100f226d6d5aaf3e0b00fc972968e0ec3502121f10661f9c10
7
- data.tar.gz: 9cc7f3b45550ff308213ceb72f2098a0bd1ae868c4b1401fbe3fe1a0cb8b43467c347ac2b396e0bcb2148f1d9927a46da43951a8550d027c0e9ba28db0739840
6
+ metadata.gz: 012a20c2c6cf74c8af2be01f046e137f74df8f6ca0746bc3c05f3dfc6eb45d0bf320a4a6493917c8c12371f94dafb0777873eb71d4298f097ecdb1bf9f9b2fd5
7
+ data.tar.gz: e257ec56be80a862449937cf882fd2dfb42037c4b9e1bbfe2987463a45e7bd0857a18a94bafd225ecb3e170180a62d59b4e3cd926d863246621d6c5683bce9a1
@@ -0,0 +1,36 @@
1
+ name: Push Gem
2
+
3
+ on:
4
+ push:
5
+ tags:
6
+ - v*
7
+
8
+ permissions:
9
+ contents: read
10
+
11
+ jobs:
12
+ push:
13
+ if: github.repository_owner == 'ruby-shoryuken'
14
+ runs-on: ubuntu-latest
15
+ environment: deployment
16
+
17
+ permissions:
18
+ contents: write
19
+ id-token: write
20
+
21
+ steps:
22
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
23
+ with:
24
+ fetch-depth: 0
25
+
26
+ - name: Set up Ruby
27
+ uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
28
+ with:
29
+ bundler-cache: false
30
+
31
+ - name: Bundle install
32
+ run: |
33
+ bundle install --jobs 4 --retry 3
34
+
35
+ # Release
36
+ - uses: rubygems/release-gem@6317d8d1f7e28c24d28f6eff169ea854948bd9f7 # v1.2.0
@@ -1,65 +1,70 @@
1
1
  name: Specs
2
-
3
2
  on:
4
3
  - push
5
4
  - pull_request
6
-
5
+ permissions:
6
+ contents: read
7
7
  jobs:
8
- all_specs:
9
- name: All Specs
8
+ specs:
9
+ name: Specs
10
10
  strategy:
11
11
  matrix:
12
- ruby: ['2.4', '2.5', '2.6', '2.7', '3.0', '3.1', '3.2']
13
- gemfile: ['Gemfile', 'gemfiles/aws_sdk_core_2.gemfile']
14
- runs-on: ubuntu-20.04
15
- services:
16
- moto_sqs:
17
- image: quay.io/cjlarose/moto-sqs-server:1.1.0
18
- ports:
19
- - 5000:5000
20
- env:
21
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
12
+ ruby: ['3.2', '3.3', '3.4', '4.0']
13
+ runs-on: ubuntu-latest
22
14
  steps:
23
15
  - name: Checkout code
24
- uses: actions/checkout@v2
25
- - uses: ruby/setup-ruby@v1
16
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
17
+
18
+ - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
26
19
  with:
27
20
  ruby-version: ${{ matrix.ruby }}
28
21
  bundler-cache: true
22
+
29
23
  - name: Run specs
30
24
  run: bundle exec rake spec
31
- - name: Run integration specs
32
- run: bundle exec rake spec:integration
33
- rails_specs:
34
- name: Rails Specs
25
+
26
+ integrations:
27
+ name: Integrations
35
28
  strategy:
36
29
  matrix:
37
- rails: ['4.2', '5.2', '6.0', '6.1', '7.0']
38
- include:
39
- - rails: '4.2'
40
- ruby: '2.2'
41
- gemfile: gemfiles/rails_4_2.gemfile
42
- - rails: '5.2'
43
- ruby: '2.5'
44
- gemfile: gemfiles/rails_5_2.gemfile
45
- - rails: '6.0'
46
- ruby: '2.6'
47
- gemfile: gemfiles/rails_6_0.gemfile
48
- - rails: '6.1'
49
- ruby: '3.0'
50
- gemfile: gemfiles/rails_6_1.gemfile
51
- - rails: '7.0'
52
- ruby: '3.1'
53
- gemfile: gemfiles/rails_7_0.gemfile
54
- runs-on: ubuntu-20.04
55
- env:
56
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
30
+ ruby: ['3.2', '3.3', '3.4', '4.0']
31
+ runs-on: ubuntu-latest
57
32
  steps:
58
33
  - name: Checkout code
59
- uses: actions/checkout@v2
60
- - uses: ruby/setup-ruby@v1
34
+ uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
35
+
36
+ - name: Start ElasticMQ
37
+ run: docker compose up -d
38
+
39
+ - name: Wait for ElasticMQ
40
+ run: |
41
+ timeout 30s bash -c '
42
+ until curl -s http://localhost:9324/health; do
43
+ echo "Waiting for ElasticMQ..."
44
+ sleep 1
45
+ done
46
+ '
47
+
48
+ - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
61
49
  with:
62
50
  ruby-version: ${{ matrix.ruby }}
63
51
  bundler-cache: true
64
- - name: Run Rails specs
65
- run: bundle exec rake spec:rails
52
+
53
+ - name: Run integration specs
54
+ run: bundle exec rake spec:integration
55
+
56
+ ci-success:
57
+ name: CI Success
58
+ runs-on: ubuntu-latest
59
+ if: always()
60
+ needs:
61
+ - specs
62
+ - integrations
63
+ steps:
64
+ - name: Check all jobs passed
65
+ if: |
66
+ contains(needs.*.result, 'failure') ||
67
+ contains(needs.*.result, 'cancelled') ||
68
+ contains(needs.*.result, 'skipped')
69
+ run: exit 1
70
+ - run: echo "All CI checks passed!"
@@ -0,0 +1,16 @@
1
+ name: Verify Action Pins
2
+ on:
3
+ pull_request:
4
+ paths:
5
+ - '.github/workflows/**'
6
+ jobs:
7
+ verify:
8
+ runs-on: ubuntu-latest
9
+ steps:
10
+ - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
11
+ - name: Check SHA pins
12
+ run: |
13
+ if grep -E -r "uses: .*/.*@(v[0-9]+|main|master)($|[[:space:]]|$)" --include="*.yml" --include="*.yaml" .github/workflows/ | grep -v "#"; then
14
+ echo "::error::Actions should use SHA pins, not tags or branch names"
15
+ exit 1
16
+ fi
data/.gitignore CHANGED
@@ -25,4 +25,7 @@ shoryuken.yml
25
25
  *.log
26
26
  .env
27
27
  rubocop.html
28
- .byebug_history
28
+ .byebug_history
29
+ spec/integration/**/Gemfile.lock
30
+ spec/integration/**/vendor/
31
+ spec/integration/**/.bundle/
data/.rspec CHANGED
@@ -1 +1,3 @@
1
- --color
1
+ --color
2
+ --require spec_helper
3
+ --exclude-pattern "spec/integration/**/*"
data/.rubocop.yml CHANGED
@@ -1,7 +1,12 @@
1
1
  AllCops:
2
2
  Exclude:
3
3
  - '**/Gemfile'
4
- TargetRubyVersion: 2.4
4
+ TargetRubyVersion: 3.4
5
+
6
+ Metrics/BlockLength:
7
+ AllowedMethods:
8
+ - describe
9
+ - context
5
10
 
6
11
  Metrics/PerceivedComplexity:
7
12
  Enabled: false
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 4.0.2
data/.yard-lint.yml ADDED
@@ -0,0 +1,279 @@
1
+ # YARD-Lint Configuration
2
+ # See https://github.com/mensfeld/yard-lint for documentation
3
+
4
+ # Global settings for all validators
5
+ AllValidators:
6
+ YardOptions:
7
+ - "--private"
8
+ - "--protected"
9
+ Exclude:
10
+ - "\\.git"
11
+ - vendor/**/*
12
+ - node_modules/**/*
13
+ - spec/**/*
14
+ - test/**/*
15
+ - bin/**/*
16
+ - examples/**/*
17
+ - test_workers/**/*
18
+ FailOnSeverity: convention
19
+ MinCoverage: 100
20
+ DiffMode:
21
+ DefaultBaseRef:
22
+
23
+ # Documentation validators
24
+ Documentation/UndocumentedObjects:
25
+ Description: Checks for classes, modules, and methods without documentation.
26
+ Enabled: true
27
+ Severity: error
28
+ ExcludedMethods:
29
+ - initialize/0
30
+ - "/^_/"
31
+
32
+ Documentation/UndocumentedMethodArguments:
33
+ Description: Checks for method parameters without @param tags.
34
+ Enabled: true
35
+ Severity: error
36
+
37
+ Documentation/UndocumentedBooleanMethods:
38
+ Description: Checks that question mark methods document their boolean return.
39
+ Enabled: true
40
+ Severity: error
41
+
42
+ Documentation/UndocumentedOptions:
43
+ Description: Detects methods with options hash parameters but no @option tags.
44
+ Enabled: true
45
+ Severity: error
46
+
47
+ Documentation/MarkdownSyntax:
48
+ Description: Detects common markdown syntax errors in documentation.
49
+ Enabled: true
50
+ Severity: error
51
+
52
+ Documentation/EmptyCommentLine:
53
+ Description: Detects empty comment lines at the start or end of documentation blocks.
54
+ Enabled: true
55
+ Severity: convention
56
+ EnabledPatterns:
57
+ Leading: true
58
+ Trailing: true
59
+
60
+ Documentation/BlankLineBeforeDefinition:
61
+ Description: Detects blank lines between YARD documentation and method definition.
62
+ Enabled: true
63
+ Severity: convention
64
+ OrphanedSeverity: convention
65
+ EnabledPatterns:
66
+ SingleBlankLine: true
67
+ OrphanedDocs: true
68
+
69
+ # Tags validators
70
+ Tags/Order:
71
+ Description: Enforces consistent ordering of YARD tags.
72
+ Enabled: true
73
+ Severity: error
74
+ EnforcedOrder:
75
+ - param
76
+ - option
77
+ - return
78
+ - raise
79
+ - example
80
+
81
+ Tags/InvalidTypes:
82
+ Description: Validates type definitions in @param, @return, @option tags.
83
+ Enabled: true
84
+ Severity: error
85
+ ValidatedTags:
86
+ - param
87
+ - option
88
+ - return
89
+
90
+ Tags/TypeSyntax:
91
+ Description: Validates YARD type syntax using YARD parser.
92
+ Enabled: true
93
+ Severity: error
94
+ ValidatedTags:
95
+ - param
96
+ - option
97
+ - return
98
+ - yieldreturn
99
+
100
+ Tags/MeaninglessTag:
101
+ Description: Detects @param/@option tags on classes, modules, or constants.
102
+ Enabled: true
103
+ Severity: error
104
+ CheckedTags:
105
+ - param
106
+ - option
107
+ InvalidObjectTypes:
108
+ - class
109
+ - module
110
+ - constant
111
+
112
+ Tags/CollectionType:
113
+ Description: Validates Hash collection syntax consistency.
114
+ Enabled: true
115
+ Severity: error
116
+ EnforcedStyle: long
117
+ ValidatedTags:
118
+ - param
119
+ - option
120
+ - return
121
+ - yieldreturn
122
+
123
+ Tags/TagTypePosition:
124
+ Description: Validates type annotation position in tags.
125
+ Enabled: true
126
+ Severity: error
127
+ CheckedTags:
128
+ - param
129
+ - option
130
+ EnforcedStyle: type_after_name
131
+
132
+ Tags/ApiTags:
133
+ Description: Enforces @api tags on public objects.
134
+ Enabled: false
135
+ Severity: error
136
+ AllowedApis:
137
+ - public
138
+ - private
139
+ - internal
140
+
141
+ Tags/OptionTags:
142
+ Description: Requires @option tags for methods with options parameters.
143
+ Enabled: true
144
+ Severity: error
145
+
146
+ Tags/ExampleSyntax:
147
+ Description: Validates Ruby syntax in @example tags.
148
+ Enabled: true
149
+ Severity: warning
150
+
151
+ Tags/RedundantParamDescription:
152
+ Description: Detects meaningless parameter descriptions that add no value.
153
+ Enabled: true
154
+ Severity: convention
155
+ CheckedTags:
156
+ - param
157
+ - option
158
+ Articles:
159
+ - The
160
+ - the
161
+ - A
162
+ - a
163
+ - An
164
+ - an
165
+ MaxRedundantWords: 6
166
+ GenericTerms:
167
+ - object
168
+ - instance
169
+ - value
170
+ - data
171
+ - item
172
+ - element
173
+ EnabledPatterns:
174
+ ArticleParam: true
175
+ PossessiveParam: true
176
+ TypeRestatement: true
177
+ ParamToVerb: true
178
+ IdPattern: true
179
+ DirectionalDate: true
180
+ TypeGeneric: true
181
+
182
+ Tags/InformalNotation:
183
+ Description: Detects informal tag notation patterns like "Note:" instead of @note.
184
+ Enabled: true
185
+ Severity: warning
186
+ CaseSensitive: false
187
+ RequireStartOfLine: true
188
+ Patterns:
189
+ Note: "@note"
190
+ Todo: "@todo"
191
+ TODO: "@todo"
192
+ FIXME: "@todo"
193
+ See: "@see"
194
+ See also: "@see"
195
+ Warning: "@deprecated"
196
+ Deprecated: "@deprecated"
197
+ Author: "@author"
198
+ Version: "@version"
199
+ Since: "@since"
200
+ Returns: "@return"
201
+ Raises: "@raise"
202
+ Example: "@example"
203
+
204
+ Tags/NonAsciiType:
205
+ Description: Detects non-ASCII characters in type annotations.
206
+ Enabled: true
207
+ Severity: warning
208
+ ValidatedTags:
209
+ - param
210
+ - option
211
+ - return
212
+ - yieldreturn
213
+ - yieldparam
214
+
215
+ Tags/TagGroupSeparator:
216
+ Description: Enforces blank line separators between different YARD tag groups.
217
+ Enabled: false
218
+ Severity: convention
219
+ TagGroups:
220
+ param:
221
+ - param
222
+ - option
223
+ return:
224
+ - return
225
+ error:
226
+ - raise
227
+ - throws
228
+ example:
229
+ - example
230
+ meta:
231
+ - see
232
+ - note
233
+ - todo
234
+ - deprecated
235
+ - since
236
+ - version
237
+ - api
238
+ yield:
239
+ - yield
240
+ - yieldparam
241
+ - yieldreturn
242
+ RequireAfterDescription: false
243
+
244
+ # Warnings validators - catches YARD parser errors
245
+ Warnings/UnknownTag:
246
+ Description: Detects unknown YARD tags.
247
+ Enabled: true
248
+ Severity: error
249
+
250
+ Warnings/UnknownDirective:
251
+ Description: Detects unknown YARD directives.
252
+ Enabled: true
253
+ Severity: error
254
+
255
+ Warnings/InvalidTagFormat:
256
+ Description: Detects malformed tag syntax.
257
+ Enabled: true
258
+ Severity: error
259
+
260
+ Warnings/InvalidDirectiveFormat:
261
+ Description: Detects malformed directive syntax.
262
+ Enabled: true
263
+ Severity: error
264
+
265
+ Warnings/DuplicatedParameterName:
266
+ Description: Detects duplicate @param tags.
267
+ Enabled: true
268
+ Severity: error
269
+
270
+ Warnings/UnknownParameterName:
271
+ Description: Detects @param tags for non-existent parameters.
272
+ Enabled: true
273
+ Severity: error
274
+
275
+ # Semantic validators
276
+ Semantic/AbstractMethods:
277
+ Description: Ensures @abstract methods do not have real implementations.
278
+ Enabled: true
279
+ Severity: error