Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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


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

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/Finch-API/finch-api-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.FINCH_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.FINCH_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 == 'Finch-API/finch-api-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.FINCH_RUBYGEMS_HOST || secrets.RUBYGEMS_HOST }}
GEM_HOST_API_KEY: ${{ secrets.FINCH_GEM_HOST_API_KEY || secrets.GEM_HOST_API_KEY }}
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.prism.log
.idea/
.ruby-lsp/
.yardoc/
doc/
sorbet/
Brewfile.lock.json
bin/tapioca
*.gem
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"
}
212 changes: 212 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,212 @@
---
# 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

# 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)?
- "FinchAPI::(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

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

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

Metrics/AbcSize:
Enabled: false

Metrics/ClassLength:
Enabled: false

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/MethodLength:
Enabled: false

Metrics/ParameterLists:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false

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

Naming/MethodParameterName:
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"

# Fairly useful in tests for pattern matching.
Style/CaseEquality:
Exclude:
- "test/**/*"

# 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
2 changes: 2 additions & 0 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
configured_endpoints: 41
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/finch%2Ffinch-7a816d4a5f0039230590a6662f3513d5756344ca662761ecbc49016593f65836.yml
1 change: 1 addition & 0 deletions .yardopts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
--markup markdown
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog

## 0.1.0-alpha.1 (2025-03-05)

Full Changelog: [v0.0.1-alpha.0...v0.1.0-alpha.1](https://github.com/Finch-API/finch-api-ruby/compare/v0.0.1-alpha.0...v0.1.0-alpha.1)

### Features

* **api:** manual updates ([#1](https://github.com/Finch-API/finch-api-ruby/issues/1)) ([4273cd2](https://github.com/Finch-API/finch-api-ruby/commit/4273cd2fd27dfb2c0d3c4f73ec0169ff1dfbd501))
25 changes: 25 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# frozen_string_literal: true

source "https://rubygems.org"

gemspec

group :development do
gem "async"
gem "minitest"
gem "minitest-focus"
gem "minitest-hooks"
gem "minitest-proveit"
gem "minitest-rg"
gem "rake"
gem "rbs"
gem "rubocop"
gem "sorbet"
gem "steep"
gem "syntax_tree"
# TODO: using a fork for now, the prettier below has a bug
gem "syntax_tree-rbs", github: "stainless-api/syntax_tree-rbs", branch: "main"
gem "tapioca"
gem "webrick"
gem "yard"
end
Loading