assistant 0.0.2 → 1.0.0.rc1
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/.editorconfig +13 -0
- data/.github/PULL_REQUEST_TEMPLATE.md +39 -0
- data/.github/dependabot.yml +4 -0
- data/.github/workflows/ci.yml +140 -0
- data/.github/workflows/docs.yml +64 -0
- data/.github/workflows/release.yml +46 -0
- data/.gitignore +5 -1
- data/.markdownlint.json +6 -0
- data/.opencode/.gitignore +4 -0
- data/.opencode/opencode.json +13 -0
- data/.opencode/skills/create-pr/SKILL.md +138 -0
- data/.opencode/skills/ruby-services/SKILL.md +81 -0
- data/.rubocop.yml +40 -148
- data/.ruby-version +1 -1
- data/.yardopts +17 -0
- data/CHANGELOG.md +434 -0
- data/CONTRIBUTING.md +131 -0
- data/Gemfile +10 -0
- data/Gemfile.lock +264 -94
- data/README.md +125 -16
- data/Rakefile +53 -3
- data/SECURITY.md +50 -0
- data/Steepfile +49 -0
- data/_config.yml +87 -0
- data/assistant.gemspec +33 -20
- data/docs/api-reference.md +264 -0
- data/docs/changelog.md +26 -0
- data/docs/deprecations.md +86 -0
- data/docs/examples/cli-handler.md +17 -0
- data/docs/examples/composing-services.md +17 -0
- data/docs/examples/execute-callbacks.md +17 -0
- data/docs/examples/index.md +29 -0
- data/docs/examples/instrumentation-notifier.md +17 -0
- data/docs/examples/rails-service.md +17 -0
- data/docs/examples/rbs-generator.md +17 -0
- data/docs/examples/sidekiq-worker.md +17 -0
- data/docs/getting-started.md +136 -0
- data/docs/guides/composing-services.md +222 -0
- data/docs/guides/index.md +25 -0
- data/docs/guides/inputs.md +333 -0
- data/docs/guides/logging-and-results.md +202 -0
- data/docs/guides/rbs-and-types.md +16 -0
- data/docs/guides/validation.md +180 -0
- data/docs/index.md +69 -0
- data/docs/roadmap.md +33 -0
- data/exe/assistant-rbs +7 -0
- data/lib/assistant/execute_callbacks.rb +103 -0
- data/lib/assistant/execute_callbacks.rbs +30 -0
- data/lib/assistant/input_builder/accessors.rb +36 -0
- data/lib/assistant/input_builder/accessors.rbs +10 -0
- data/lib/assistant/input_builder/default_option.rb +41 -0
- data/lib/assistant/input_builder/default_option.rbs +11 -0
- data/lib/assistant/input_builder/dsl.rb +37 -0
- data/lib/assistant/input_builder/dsl.rbs +12 -0
- data/lib/assistant/input_builder/optional_option.rb +45 -0
- data/lib/assistant/input_builder/optional_option.rbs +10 -0
- data/lib/assistant/input_builder/registry.rb +27 -0
- data/lib/assistant/input_builder/registry.rbs +13 -0
- data/lib/assistant/input_builder/require_validator.rb +104 -0
- data/lib/assistant/input_builder/require_validator.rbs +24 -0
- data/lib/assistant/input_builder/type_validator.rb +47 -0
- data/lib/assistant/input_builder/type_validator.rbs +18 -0
- data/lib/assistant/input_builder.rb +28 -0
- data/lib/assistant/input_builder.rbs +15 -0
- data/lib/assistant/log_item.rb +75 -17
- data/lib/assistant/log_item.rbs +40 -0
- data/lib/assistant/log_list.rb +44 -12
- data/lib/assistant/log_list.rbs +48 -0
- data/lib/assistant/rbs_generator/cli.rb +109 -0
- data/lib/assistant/rbs_generator/cli.rbs +24 -0
- data/lib/assistant/rbs_generator/renderer.rb +67 -0
- data/lib/assistant/rbs_generator/renderer.rbs +11 -0
- data/lib/assistant/rbs_generator/writer.rb +65 -0
- data/lib/assistant/rbs_generator/writer.rbs +24 -0
- data/lib/assistant/rbs_generator.rb +38 -0
- data/lib/assistant/rbs_generator.rbs +5 -0
- data/lib/assistant/refinements/string_blankness.rb +14 -0
- data/lib/assistant/refinements/string_blankness.rbs +6 -0
- data/lib/assistant/service.rb +328 -8
- data/lib/assistant/service.rbs +86 -0
- data/lib/assistant/version.rb +5 -1
- data/lib/assistant/version.rbs +5 -0
- data/lib/assistant.rb +53 -4
- data/lib/assistant.rbs +25 -0
- data/mise.toml +6 -0
- data/sig/examples/greeter.rbs +14 -0
- metadata +128 -112
- data/.circleci/config.yml +0 -45
- data/.fasterer.yml +0 -19
- data/.rspec +0 -3
- data/.rubocop_todo.yml +0 -0
data/.rubocop.yml
CHANGED
|
@@ -1,49 +1,36 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
inherit_from: .rubocop_todo.yml
|
|
4
|
-
require:
|
|
5
|
-
- rubocop/cop/internal_affairs
|
|
1
|
+
plugins:
|
|
6
2
|
- rubocop-performance
|
|
7
|
-
- rubocop-
|
|
3
|
+
- rubocop-minitest
|
|
8
4
|
- rubocop-rake
|
|
5
|
+
- rubocop-style-compact_nesting
|
|
9
6
|
|
|
10
7
|
AllCops:
|
|
11
8
|
NewCops: enable
|
|
9
|
+
TargetRubyVersion: 3.4
|
|
10
|
+
SuggestExtensions: false
|
|
12
11
|
Exclude:
|
|
13
12
|
- 'vendor/**/*'
|
|
14
|
-
- 'spec/fixtures/**/*'
|
|
15
13
|
- 'tmp/**/*'
|
|
16
14
|
- '.git/**/*'
|
|
17
15
|
- 'bin/*'
|
|
18
|
-
|
|
19
|
-
SuggestExtensions: false
|
|
16
|
+
- 'Gemfile.lock'
|
|
20
17
|
|
|
21
18
|
Gemspec/DevelopmentDependencies:
|
|
22
|
-
|
|
19
|
+
EnforcedStyle: gemspec
|
|
20
|
+
|
|
21
|
+
Gemspec/DependencyVersion:
|
|
22
|
+
Enabled: true
|
|
23
23
|
|
|
24
|
-
Naming/
|
|
25
|
-
# Method define macros for dynamically generated method.
|
|
24
|
+
Naming/PredicatePrefix:
|
|
26
25
|
MethodDefinitionMacros:
|
|
27
26
|
- define_method
|
|
28
27
|
- define_singleton_method
|
|
29
|
-
- def_node_matcher
|
|
30
|
-
- def_node_search
|
|
31
28
|
|
|
32
|
-
|
|
29
|
+
# Tests use simple `def execute = true` to fabricate services; the boolean
|
|
30
|
+
# return doesn't make these predicate methods.
|
|
31
|
+
Naming/PredicateMethod:
|
|
33
32
|
Exclude:
|
|
34
|
-
-
|
|
35
|
-
- lib/rubocop/cop/offense.rb
|
|
36
|
-
|
|
37
|
-
Style/FormatStringToken:
|
|
38
|
-
# Because we parse a lot of source codes from strings. Percent arrays
|
|
39
|
-
# look like unannotated format string tokens to this cop.
|
|
40
|
-
Exclude:
|
|
41
|
-
- spec/**/*
|
|
42
|
-
|
|
43
|
-
Style/IpAddresses:
|
|
44
|
-
# The test for this cop includes strings that would cause offenses
|
|
45
|
-
Exclude:
|
|
46
|
-
- spec/rubocop/cop/style/ip_addresses_spec.rb
|
|
33
|
+
- 'test/**/*.rb'
|
|
47
34
|
|
|
48
35
|
Layout/EndOfLine:
|
|
49
36
|
EnforcedStyle: lf
|
|
@@ -54,13 +41,6 @@ Layout/ClassStructure:
|
|
|
54
41
|
Layout/RedundantLineBreak:
|
|
55
42
|
Enabled: true
|
|
56
43
|
|
|
57
|
-
Layout/TrailingWhitespace:
|
|
58
|
-
AllowInHeredoc: false
|
|
59
|
-
|
|
60
|
-
Lint/AmbiguousBlockAssociation:
|
|
61
|
-
Exclude:
|
|
62
|
-
- 'spec/**/*.rb'
|
|
63
|
-
|
|
64
44
|
Layout/HashAlignment:
|
|
65
45
|
EnforcedHashRocketStyle:
|
|
66
46
|
- key
|
|
@@ -71,133 +51,45 @@ Layout/HashAlignment:
|
|
|
71
51
|
|
|
72
52
|
Layout/LineLength:
|
|
73
53
|
Max: 120
|
|
74
|
-
AllowedPatterns:
|
|
75
|
-
- !ruby/regexp /\A +(it|describe|context|shared_examples|include_examples|it_behaves_like) ["']/
|
|
76
54
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
- 'spec/**/*.rb'
|
|
80
|
-
|
|
81
|
-
Lint/UselessAccessModifier:
|
|
82
|
-
MethodCreatingMethods:
|
|
83
|
-
- 'def_matcher'
|
|
84
|
-
- 'def_node_matcher'
|
|
55
|
+
Style/RequireOrder:
|
|
56
|
+
Enabled: true
|
|
85
57
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
58
|
+
# Project convention: hybrid compact nesting enforced by
|
|
59
|
+
# rubocop-style-compact_nesting's Style/CompactModuleNesting. Namespace
|
|
60
|
+
# chains collapse to a single `module A::B::C` line; when the innermost
|
|
61
|
+
# definition is a class, it's nested separately inside the compact wrapper.
|
|
62
|
+
# That plugin disables Style/ClassAndModuleChildren by default.
|
|
90
63
|
|
|
64
|
+
# Test files use anonymous Class.new(...) blocks and dynamic define_method,
|
|
65
|
+
# which inflates length/metrics counts that don't reflect real complexity.
|
|
91
66
|
Metrics/BlockLength:
|
|
92
67
|
Exclude:
|
|
93
68
|
- 'Rakefile'
|
|
94
69
|
- '**/*.rake'
|
|
95
|
-
- '
|
|
70
|
+
- 'test/**/*.rb'
|
|
96
71
|
- '**/*.gemspec'
|
|
97
72
|
|
|
98
73
|
Metrics/ClassLength:
|
|
99
74
|
Exclude:
|
|
100
|
-
-
|
|
101
|
-
- lib/rubocop/options.rb
|
|
102
|
-
|
|
103
|
-
Metrics/ModuleLength:
|
|
104
|
-
Exclude:
|
|
105
|
-
- 'spec/**/*.rb'
|
|
106
|
-
|
|
107
|
-
Naming/InclusiveLanguage:
|
|
108
|
-
Enabled: true
|
|
109
|
-
CheckStrings: true
|
|
110
|
-
FlaggedTerms:
|
|
111
|
-
' a offense':
|
|
112
|
-
Suggestions:
|
|
113
|
-
- an offense
|
|
114
|
-
auto-correct:
|
|
115
|
-
Suggestions:
|
|
116
|
-
- autocorrect
|
|
117
|
-
auto_correct:
|
|
118
|
-
Suggestions:
|
|
119
|
-
- autocorrect
|
|
120
|
-
behaviour:
|
|
121
|
-
Suggestions:
|
|
122
|
-
- behavior
|
|
123
|
-
offence:
|
|
124
|
-
Suggestions:
|
|
125
|
-
- offense
|
|
126
|
-
'does not registers':
|
|
127
|
-
Suggestions:
|
|
128
|
-
- does not register
|
|
129
|
-
Exclude:
|
|
130
|
-
- lib/rubocop/cop/naming/inclusive_language.rb
|
|
131
|
-
- lib/rubocop/cop/mixin/auto_corrector.rb
|
|
132
|
-
- spec/rubocop/cop/naming/inclusive_language_spec.rb
|
|
133
|
-
|
|
134
|
-
RSpec:
|
|
135
|
-
Language:
|
|
136
|
-
Expectations:
|
|
137
|
-
- expect_autocorrect_options_for_autocorrect
|
|
138
|
-
- expect_autocorrect_options_for_autocorrect_all
|
|
139
|
-
- expect_autocorrect_options_for_fix_layout
|
|
140
|
-
- expect_correction
|
|
141
|
-
- expect_feature_loader
|
|
142
|
-
- expect_no_offenses
|
|
143
|
-
- expect_offense
|
|
144
|
-
|
|
145
|
-
RSpec/FilePath:
|
|
146
|
-
Exclude:
|
|
147
|
-
- spec/rubocop/cop/internal_affairs/redundant_let_rubocop_config_new_spec.rb
|
|
148
|
-
- spec/rubocop/formatter/junit_formatter_spec.rb
|
|
149
|
-
|
|
150
|
-
RSpec/PredicateMatcher:
|
|
151
|
-
EnforcedStyle: explicit
|
|
152
|
-
|
|
153
|
-
RSpec/MessageSpies:
|
|
154
|
-
EnforcedStyle: receive
|
|
155
|
-
|
|
156
|
-
RSpec/NestedGroups:
|
|
157
|
-
Max: 7
|
|
75
|
+
- 'test/**/*.rb'
|
|
158
76
|
|
|
159
|
-
|
|
160
|
-
Enabled: false
|
|
161
|
-
|
|
162
|
-
Performance/CollectionLiteralInLoop:
|
|
77
|
+
Metrics/MethodLength:
|
|
163
78
|
Exclude:
|
|
164
|
-
- '
|
|
165
|
-
- 'spec/**/*.rb'
|
|
166
|
-
|
|
167
|
-
Performance/EndWith:
|
|
168
|
-
SafeMultiline: false
|
|
169
|
-
|
|
170
|
-
Performance/StartWith:
|
|
171
|
-
SafeMultiline: false
|
|
172
|
-
|
|
173
|
-
RSpec/StubbedMock:
|
|
174
|
-
Enabled: false
|
|
79
|
+
- 'test/**/*.rb'
|
|
175
80
|
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
InternalAffairs/ExampleHeredocDelimiter:
|
|
181
|
-
Include:
|
|
182
|
-
- 'spec/rubocop/cop/**/*.rb'
|
|
183
|
-
|
|
184
|
-
InternalAffairs/UndefinedConfig:
|
|
185
|
-
Include:
|
|
186
|
-
- 'lib/rubocop/cop/**/*.rb'
|
|
187
|
-
Exclude:
|
|
188
|
-
- 'lib/rubocop/cop/correctors/**/*.rb'
|
|
189
|
-
- 'lib/rubocop/cop/mixin/**/*.rb'
|
|
190
|
-
|
|
191
|
-
InternalAffairs/StyleDetectedApiUse:
|
|
192
|
-
Exclude:
|
|
193
|
-
- 'lib/rubocop/cop/mixin/percent_array.rb'
|
|
194
|
-
|
|
195
|
-
InternalAffairs/NumblockHandler:
|
|
81
|
+
# Test files use anonymous Class.new blocks with multiple assertions
|
|
82
|
+
# that inflate ABC counts beyond the cop's heuristic without reflecting
|
|
83
|
+
# real branching complexity.
|
|
84
|
+
Metrics/AbcSize:
|
|
196
85
|
Exclude:
|
|
197
|
-
- '
|
|
86
|
+
- 'test/**/*.rb'
|
|
198
87
|
|
|
199
|
-
|
|
200
|
-
|
|
88
|
+
Naming/MethodParameterName:
|
|
89
|
+
AllowedNames:
|
|
90
|
+
- a
|
|
91
|
+
- b
|
|
92
|
+
- c
|
|
201
93
|
|
|
202
|
-
|
|
203
|
-
|
|
94
|
+
Minitest/MultipleAssertions:
|
|
95
|
+
Max: 8
|
data/.ruby-version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
3.4.1
|
data/.yardopts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
--output-dir doc
|
|
2
|
+
--markup markdown
|
|
3
|
+
--readme README.md
|
|
4
|
+
--no-private
|
|
5
|
+
--protected
|
|
6
|
+
lib/**/*.rb
|
|
7
|
+
-
|
|
8
|
+
docs/getting-started.md
|
|
9
|
+
docs/api-reference.md
|
|
10
|
+
docs/guides/inputs.md
|
|
11
|
+
docs/guides/validation.md
|
|
12
|
+
docs/guides/logging-and-results.md
|
|
13
|
+
docs/guides/composing-services.md
|
|
14
|
+
CHANGELOG.md
|
|
15
|
+
CONTRIBUTING.md
|
|
16
|
+
SECURITY.md
|
|
17
|
+
CODE_OF_CONDUCT.md
|