Skip to content

Commit 3be44a3

Browse files
chore: configure new SDK language
1 parent 0453bb6 commit 3be44a3

150 files changed

Lines changed: 15440 additions & 1 deletion

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: CI
2+
on:
3+
push:
4+
branches-ignore:
5+
- 'generated'
6+
- 'codegen/**'
7+
- 'integrated/**'
8+
- 'stl-preview-head/**'
9+
- 'stl-preview-base/**'
10+
pull_request:
11+
branches-ignore:
12+
- 'stl-preview-head/**'
13+
- 'stl-preview-base/**'
14+
15+
jobs:
16+
lint:
17+
timeout-minutes: 10
18+
name: lint
19+
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
20+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
- name: Set up Ruby
25+
uses: ruby/setup-ruby@v1
26+
with:
27+
bundler-cache: false
28+
- run: |-
29+
bundle install
30+
31+
- name: Run lints
32+
run: ./scripts/lint
33+
test:
34+
timeout-minutes: 10
35+
name: test
36+
runs-on: ${{ github.repository == 'stainless-sdks/stagehand-ruby' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }}
37+
if: github.event_name == 'push' || github.event.pull_request.head.repo.fork
38+
steps:
39+
- uses: actions/checkout@v4
40+
- name: Set up Ruby
41+
uses: ruby/setup-ruby@v1
42+
with:
43+
bundler-cache: false
44+
- run: |-
45+
bundle install
46+
47+
- name: Run tests
48+
run: ./scripts/test

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
*.gem
2+
.idea/
3+
.ignore
4+
.prism.log
5+
.ruby-lsp/
6+
.yardoc/
7+
bin/tapioca
8+
Brewfile.lock.json
9+
doc/
10+
sorbet/tapioca/*

.rubocop.yml

Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
# yaml-language-server: $schema=https://www.rubyschema.org/rubocop.json
2+
---
3+
# Explicitly disable pending cops for now. This is the default behaviour but
4+
# this avoids a large warning every time we run it.
5+
# Stop RuboCop nagging about rubocop-rake.
6+
# Ensure that RuboCop validates according to the lowest version of Ruby that we support.
7+
AllCops:
8+
Exclude:
9+
- "bin/*"
10+
NewCops: enable
11+
SuggestExtensions: false
12+
TargetRubyVersion: 3.2
13+
14+
# Whether MFA is required or not should be left to the token configuration.
15+
Gemspec/RequireMFA:
16+
Enabled: false
17+
18+
# Don't require this extra line break, it can be excessive.
19+
Layout/EmptyLineAfterGuardClause:
20+
Enabled: false
21+
22+
# Don't leave complex assignment values hanging off to the right.
23+
Layout/EndAlignment:
24+
EnforcedStyleAlignWith: variable
25+
26+
Layout/FirstArrayElementLineBreak:
27+
Enabled: true
28+
29+
Layout/FirstHashElementLineBreak:
30+
Enabled: true
31+
32+
Layout/FirstMethodArgumentLineBreak:
33+
Enabled: true
34+
35+
Layout/FirstMethodParameterLineBreak:
36+
Enabled: true
37+
38+
# Set a reasonable line length; rely on other cops to correct long lines.
39+
Layout/LineLength:
40+
AllowedPatterns:
41+
- "^\\s*#.*$"
42+
- ^require(_relative)?
43+
- "Stagehand::Internal::Type::BaseModel$"
44+
- "^\\s*[A-Z0-9_]+ = :"
45+
- "Stagehand::(Models|Resources|Test)::"
46+
Max: 110
47+
48+
Layout/MultilineArrayLineBreaks:
49+
Enabled: true
50+
51+
# Start the assignment on the same line variable is mentioned.
52+
Layout/MultilineAssignmentLayout:
53+
EnforcedStyle: same_line
54+
55+
Layout/MultilineHashKeyLineBreaks:
56+
Enabled: true
57+
58+
Layout/MultilineMethodArgumentLineBreaks:
59+
Enabled: true
60+
61+
Layout/MultilineMethodParameterLineBreaks:
62+
Enabled: true
63+
64+
# Prefer compact hash literals.
65+
Layout/SpaceInsideHashLiteralBraces:
66+
EnforcedStyle: no_space
67+
Exclude:
68+
- "**/*.rbi"
69+
70+
Lint/BooleanSymbol:
71+
Enabled: false
72+
73+
# This option occasionally mangles identifier names
74+
Lint/DeprecatedConstants:
75+
Exclude:
76+
- "**/*.rbi"
77+
78+
# We use pattern assertion in tests to ensure correctness.
79+
Lint/DuplicateMatchPattern:
80+
Exclude:
81+
- "test/**/*"
82+
83+
# Fairly useful in tests for pattern assertions.
84+
Lint/EmptyInPattern:
85+
Exclude:
86+
- "test/**/*"
87+
88+
Lint/MissingCopEnableDirective:
89+
Exclude:
90+
- "examples/**/*.rb"
91+
92+
Lint/MissingSuper:
93+
Exclude:
94+
- "**/*.rbi"
95+
96+
Lint/SymbolConversion:
97+
Exclude:
98+
- "**/*.rbi"
99+
100+
# Disabled for safety reasons, this option changes code semantics.
101+
Lint/UnusedMethodArgument:
102+
AutoCorrect: false
103+
104+
# This option is prone to causing accidental bugs.
105+
Lint/UselessAssignment:
106+
AutoCorrect: false
107+
Exclude:
108+
- "examples/**/*.rb"
109+
110+
Metrics/AbcSize:
111+
Enabled: false
112+
113+
Metrics/BlockLength:
114+
AllowedPatterns:
115+
- assert_pattern
116+
- type_alias
117+
- define_sorbet_constant!
118+
Exclude:
119+
- "**/*.rbi"
120+
121+
Metrics/ClassLength:
122+
Enabled: false
123+
124+
Metrics/CollectionLiteralLength:
125+
Exclude:
126+
- "test/**/*"
127+
128+
Metrics/CyclomaticComplexity:
129+
Enabled: false
130+
131+
Metrics/MethodLength:
132+
Enabled: false
133+
134+
Metrics/ModuleLength:
135+
Enabled: false
136+
137+
Metrics/ParameterLists:
138+
Enabled: false
139+
140+
Metrics/PerceivedComplexity:
141+
Enabled: false
142+
143+
Naming/AccessorMethodName:
144+
Enabled: false
145+
146+
# Need to preserve block identifier for documentation.
147+
Naming/BlockForwarding:
148+
Enabled: false
149+
150+
# Underscores are generally useful for disambiguation.
151+
Naming/ClassAndModuleCamelCase:
152+
Enabled: false
153+
154+
Naming/MethodParameterName:
155+
Enabled: false
156+
157+
Naming/PredicatePrefix:
158+
Exclude:
159+
- "**/*.rbi"
160+
161+
Naming/VariableNumber:
162+
Enabled: false
163+
164+
# Nothing wrong with inline private methods.
165+
Style/AccessModifierDeclarations:
166+
Enabled: false
167+
168+
Style/AccessorGrouping:
169+
Exclude:
170+
- "**/*.rbi"
171+
172+
# Behaviour of alias_method is more predictable.
173+
Style/Alias:
174+
EnforcedStyle: prefer_alias_method
175+
176+
# And/or have confusing precedence, avoid them.
177+
Style/AndOr:
178+
EnforcedStyle: always
179+
180+
Style/ArgumentsForwarding:
181+
Enabled: false
182+
183+
Style/BisectedAttrAccessor:
184+
Exclude:
185+
- "**/*.rbi"
186+
187+
# We prefer nested modules in lib/, but are currently using compact style for tests.
188+
Style/ClassAndModuleChildren:
189+
Exclude:
190+
- "test/**/*"
191+
192+
Style/CommentAnnotation:
193+
Enabled: false
194+
195+
# We should go back and add these docs, but ignore for now.
196+
Style/Documentation:
197+
Enabled: false
198+
199+
# Allow explicit empty elses, for clarity.
200+
Style/EmptyElse:
201+
Enabled: false
202+
203+
Style/EmptyMethod:
204+
Exclude:
205+
- "**/*.rbi"
206+
207+
# We commonly use ENV['KEY'], it's OK.
208+
Style/FetchEnvVar:
209+
Enabled: false
210+
211+
# Just to be safe, ensure nobody is mutating our internal strings.
212+
Style/FrozenStringLiteralComment:
213+
EnforcedStyle: always
214+
Exclude:
215+
- "**/*.rbi"
216+
217+
# Nothing wrong with clear if statements.
218+
Style/IfUnlessModifier:
219+
Enabled: false
220+
221+
# Rubocop is pretty bad about mangling single line lambdas.
222+
Style/Lambda:
223+
Enabled: false
224+
225+
# Prefer consistency in method calling syntax.
226+
Style/MethodCallWithArgsParentheses:
227+
AllowedMethods:
228+
- raise
229+
Enabled: true
230+
Exclude:
231+
- "**/*.gemspec"
232+
233+
Style/MultilineBlockChain:
234+
Enabled: false
235+
236+
# Perfectly fine.
237+
Style/MultipleComparison:
238+
Enabled: false
239+
240+
Style/MutableConstant:
241+
Exclude:
242+
- "**/*.rbi"
243+
244+
# Not all parameters should be named.
245+
Style/NumberedParameters:
246+
Enabled: false
247+
248+
Style/NumberedParametersLimit:
249+
Max: 2
250+
251+
# Reasonable to use brackets for errors with long messages.
252+
Style/RaiseArgs:
253+
Enabled: false
254+
255+
# Be explicit about `RuntimeError`s.
256+
Style/RedundantException:
257+
Enabled: false
258+
259+
Style/RedundantInitialize:
260+
Exclude:
261+
- "**/*.rbi"
262+
263+
Style/RedundantParentheses:
264+
Exclude:
265+
- "**/*.rbi"
266+
267+
# Prefer slashes for regex literals.
268+
Style/RegexpLiteral:
269+
EnforcedStyle: slashes
270+
271+
# Allow explicit ifs, especially for imperative use.
272+
Style/SafeNavigation:
273+
Enabled: false
274+
275+
Style/SignalException:
276+
Exclude:
277+
- Rakefile
278+
- "**/*.rake"
279+
280+
# We use these sparingly, where we anticipate future branches for the
281+
# inner conditional.
282+
Style/SoleNestedConditional:
283+
Enabled: false
284+
285+
# Prefer double quotes so that interpolation can be easily added.
286+
Style/StringLiterals:
287+
EnforcedStyle: double_quotes
288+
289+
# Prefer explicit symbols for clarity; you can search for `:the_symbol`.
290+
Style/SymbolArray:
291+
EnforcedStyle: brackets
292+
293+
# This option makes examples harder to read for ruby novices.
294+
Style/SymbolProc:
295+
Exclude:
296+
- "examples/**/*.rb"

.ruby-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.0

.solargraph.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
max_files: 0
3+
include:
4+
- '*.gemspec'
5+
- 'Rakefile'
6+
- 'examples/**/*.rb'
7+
- 'lib/**/*.rb'
8+
- 'test/stagehand/resource_namespaces.rb'
9+
- 'test/stagehand/test_helper.rb'
10+
exclude:
11+
- 'rbi/**/*'

.stats.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
configured_endpoints: 7
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/browserbase%2Fstagehand-0c12f985340be2a9287e8e01ff8733f7f2d02e019149d1ae95f1a8f8798c6690.yml
3+
openapi_spec_hash: efb79934e1dc63763dd4e8493b825273
4+
config_hash: 11bbada11e4722208230ed2fab917d9e

.yardopts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
--type-name-tag generic:Generic
2+
--default-return void
3+
--markup markdown
4+
--markup-provider redcarpet
5+
--exclude /rbi
6+
--exclude /sig

0 commit comments

Comments
 (0)