Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
00f0df1
feat!: support `for item in stream` style iteration on `Stream`s (#1)
stainless-app[bot] Mar 19, 2025
e5d8b78
fix: resolve tapioca derived sorbet errors (#3)
stainless-app[bot] Mar 20, 2025
07a5b4d
feat!: use tagged enums in sorbet type definitions (#4)
stainless-app[bot] Mar 20, 2025
83a2861
chore: `BaseModel` fields that are `BaseModel` typed should also acce…
stainless-app[bot] Mar 20, 2025
b5e3b7f
fix: yard example tag formatting (#6)
stainless-app[bot] Mar 20, 2025
86672a1
chore: add type annotations for enum and union member listing methods…
stainless-app[bot] Mar 20, 2025
c316306
feat: prevent tapioca from introspecting the gem internals (#8)
stainless-app[bot] Mar 21, 2025
834c2d1
feat: consistently accept `AnyHash` types in parameter positions in s…
stainless-app[bot] Mar 21, 2025
8852810
chore: recursively accept `AnyHash` for `BaseModel`s in arrays and ha…
stainless-app[bot] Mar 21, 2025
80c80b2
chore: switch to prettier looking sorbet annotations (#11)
stainless-app[bot] Mar 21, 2025
f36c4b6
fix: pages should be able to accept non-converter models (#12)
stainless-app[bot] Mar 21, 2025
354c40b
chore: reduce verbosity in type declarations (#13)
stainless-app[bot] Mar 21, 2025
e31dbfb
chore: disable dangerous rubocop auto correct rule (#14)
stainless-app[bot] Mar 21, 2025
f231c30
chore: more readable output when tests fail (#15)
stainless-app[bot] Mar 24, 2025
c8ef1a1
chore(api): new attribute targets for Auth Rules and new Financial Ac…
stainless-app[bot] Mar 25, 2025
258055f
chore: fix typos (#17)
stainless-app[bot] Mar 26, 2025
cb2b11d
release: 0.1.0-alpha.1
stainless-app[bot] Mar 26, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
45 changes: 45 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
- next

jobs:
lint:
name: lint
runs-on: ubuntu-latest
if: github.repository == 'lithic-com/lithic-ruby'

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

- name: Run lints
run: ./scripts/lint
test:
name: test
runs-on: ubuntu-latest
if: github.repository == 'lithic-com/lithic-ruby'

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

- name: Run tests
run: ./scripts/test
32 changes: 32 additions & 0 deletions .github/workflows/publish-gem.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# This workflow is triggered when a GitHub release is created.
# It can also be run manually to re-publish to rubygems.org in case it failed for some reason.
# You can run this workflow by navigating to https://www.github.com/lithic-com/lithic-python/actions/workflows/publish-gem.yml
name: Publish Gem
on:
workflow_dispatch:

release:
types: [published]

jobs:
publish:
name: publish
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
bundler-cache: false
ruby-version: '3.1'
- run: |-
bundle install

- name: Publish to RubyGems.org
run: |
bash ./bin/publish-gem
env:
# `RUBYGEMS_HOST` is only required for private gem repositories, not https://rubygems.org
RUBYGEMS_HOST: ${{ secrets.LITHIC_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.LITHIC_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
22 changes: 22 additions & 0 deletions .github/workflows/release-doctor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Release Doctor
on:
pull_request:
branches:
- main
workflow_dispatch:

jobs:
release_doctor:
name: release doctor
runs-on: ubuntu-latest
if: github.repository == 'lithic-com/lithic-ruby' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next')

steps:
- uses: actions/checkout@v4

- name: Check release environment
run: |
bash ./bin/check-release-environment
env:
RUBYGEMS_HOST: ${{ secrets.LITHIC_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.LITHIC_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
*.gem
.idea/
.prism.log
.ruby-lsp/
.yardoc/
Brewfile.lock.json
bin/tapioca
doc/
sorbet/*
!/sorbet/config
3 changes: 3 additions & 0 deletions .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
".": "0.1.0-alpha.1"
}
254 changes: 254 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,254 @@
---
# Explicitly disable pending cops for now. This is the default behaviour but
# this avoids a large warning every time we run it.
# Stop RuboCop nagging about rubocop-rake.
# Ensure that RuboCop validates according to the lowest version of Ruby that we support.
AllCops:
Exclude:
- "bin/*"
NewCops: enable
SuggestExtensions: false
TargetRubyVersion: 3.1.0

# Whether MFA is required or not should be left to the token configuration.
Gemspec/RequireMFA:
Enabled: false

# Don't require this extra line break, it can be excessive.
Layout/EmptyLineAfterGuardClause:
Enabled: false

# Don't leave complex assignment values hanging off to the right.
Layout/EndAlignment:
EnforcedStyleAlignWith: variable

Layout/FirstArrayElementLineBreak:
Enabled: true

Layout/FirstHashElementLineBreak:
Enabled: true

Layout/FirstMethodArgumentLineBreak:
Enabled: true

Layout/FirstMethodParameterLineBreak:
Enabled: true

# Set a reasonable line length; rely on other cops to correct long lines.
Layout/LineLength:
AllowedPatterns:
- "^\\s*#.*$"
- ^require(_relative)?
- "Lithic::(Models|Resources)::"
Max: 110

Layout/MultilineArrayLineBreaks:
Enabled: true

# Start the assignment on the same line variable is mentioned.
Layout/MultilineAssignmentLayout:
EnforcedStyle: same_line

Layout/MultilineHashKeyLineBreaks:
Enabled: true

Layout/MultilineMethodArgumentLineBreaks:
Enabled: true

Layout/MultilineMethodParameterLineBreaks:
Enabled: true

# Prefer compact hash literals.
Layout/SpaceInsideHashLiteralBraces:
EnforcedStyle: no_space

# This option occasionally mangles identifier names
Lint/DeprecatedConstants:
Exclude:
- "**/*.rbi"

# Fairly useful in tests for pattern assertions.
Lint/EmptyInPattern:
Exclude:
- "test/**/*"

Lint/MissingCopEnableDirective:
Exclude:
- "examples/**/*.rb"

Lint/MissingSuper:
Exclude:
- "**/*.rbi"

# Disabled for safety reasons, this option changes code semantics.
Lint/UnusedMethodArgument:
AutoCorrect: false

# This option is prone to causing accidental bugs.
Lint/UselessAssignment:
AutoCorrect: false
Exclude:
- "examples/**/*.rb"

Metrics/AbcSize:
Enabled: false

Metrics/BlockLength:
AllowedPatterns:
- assert_pattern
Exclude:
- "**/*.rbi"

Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/ModuleLength:
Exclude:
- "**/*.rbi"

Metrics/ParameterLists:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false

Naming/BlockForwarding:
Exclude:
- "**/*.rbi"

Naming/ClassAndModuleCamelCase:
Exclude:
- "**/*.rbi"

Naming/MethodParameterName:
Exclude:
- "**/*.rbi"

Naming/PredicateName:
Exclude:
- "**/*.rbi"

Naming/VariableNumber:
Enabled: false

# Nothing wrong with inline private methods.
Style/AccessModifierDeclarations:
Enabled: false

Style/AccessorGrouping:
Exclude:
- "**/*.rbi"

# Behaviour of alias_method is more predictable.
Style/Alias:
EnforcedStyle: prefer_alias_method

# And/or have confusing precedence, avoid them.
Style/AndOr:
EnforcedStyle: always

Style/BisectedAttrAccessor:
Exclude:
- "**/*.rbi"

# We prefer nested modules in lib/, but are currently using compact style for tests.
Style/ClassAndModuleChildren:
Exclude:
- "test/**/*"

# We should go back and add these docs, but ignore for now.
Style/Documentation:
Enabled: false

# Allow explicit empty elses, for clarity.
Style/EmptyElse:
Enabled: false

Style/EmptyMethod:
Exclude:
- "**/*.rbi"

# We commonly use ENV['KEY'], it's OK.
Style/FetchEnvVar:
Enabled: false

# Just to be safe, ensure nobody is mutating our internal strings.
Style/FrozenStringLiteralComment:
EnforcedStyle: always
Exclude:
- "**/*.rbi"

# Nothing wrong with clear if statements.
Style/IfUnlessModifier:
Enabled: false

# Rubocop is pretty bad about mangling single line lambdas.
Style/Lambda:
Enabled: false

# Prefer consistency in method calling syntax.
Style/MethodCallWithArgsParentheses:
AllowedMethods:
- raise
Enabled: true
Exclude:
- "**/*.gemspec"

# Perfectly fine.
Style/MultipleComparison:
Enabled: false

Style/MutableConstant:
Exclude:
- "**/*.rbi"

# Not all parameters should be named.
Style/NumberedParameters:
Enabled: false

Style/NumberedParametersLimit:
Max: 2

# Reasonable to use brackets for errors with long messages.
Style/RaiseArgs:
Enabled: false

# Be explicit about `RuntimeError`s.
Style/RedundantException:
Enabled: false

Style/RedundantInitialize:
Exclude:
- "**/*.rbi"

# Prefer slashes for regex literals.
Style/RegexpLiteral:
EnforcedStyle: slashes

# Allow explicit ifs, especially for imperative use.
Style/SafeNavigation:
Enabled: false

# We use these sparingly, where we anticipate future branches for the
# inner conditional.
Style/SoleNestedConditional:
Enabled: false

# Prefer double quotes so that interpolation can be easily added.
Style/StringLiterals:
EnforcedStyle: double_quotes

# Prefer explicit symbols for clarity; you can search for `:the_symbol`.
Style/SymbolArray:
EnforcedStyle: brackets

# This option makes examples harder to read for ruby novices.
Style/SymbolProc:
Exclude:
- "examples/**/*.rb"
10 changes: 10 additions & 0 deletions .solargraph.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
max_files: 0
include:
- '*.gemspec'
- 'Rakefile'
- 'examples/**/*.rb'
- 'lib/**/*.rb'
- 'test/lithic/test_helper.rb'
exclude:
- 'rbi/**/*'
2 changes: 2 additions & 0 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
configured_endpoints: 156
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic-fe97f820471b725722897539252e7444af7490c5a444a2e9304f5e6eec5513f3.yml
3 changes: 3 additions & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--markup markdown
--exclude /rbi
--exclude /sig
Loading