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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
- push
- pull_request

permissions:
contents: read

jobs:
rspec:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -64,6 +67,17 @@ jobs:
- run: bundle install
- name: Cucumber
run: bundle exec cucumber
steep:
runs-on: ubuntu-latest
name: Type Check
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- uses: ruby/setup-ruby@v1
with:
ruby-version: "3.4.9"
- run: bundle install
- run: bundle exec rbs collection install
- run: bundle exec steep check
security:
runs-on: ubuntu-latest
name: Security Audit
Expand All @@ -79,7 +93,7 @@ jobs:
status:
name: CI Status
runs-on: ubuntu-latest
needs: [rspec, standard, cucumber, security]
needs: [rspec, standard, cucumber, security, steep]
if: always()
steps:
- name: Successful CI
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ Gemfile.lock

# Claude plans
docs/plans/

# RBS collection cache
.gem_rbs_collection/
3 changes: 3 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,13 @@ This is the official OpenFeature SDK for Ruby — an implementation of the [Open

## Commands

- **Install dependencies:** `bundle install`
- **Run all tests:** `bundle exec rspec`
- **Run a single test file:** `bundle exec rspec spec/open_feature/sdk/client_spec.rb`
- **Run a specific test by line:** `bundle exec rspec spec/open_feature/sdk/client_spec.rb:43`
- **Lint:** `bundle exec standardrb`
- **Lint with autofix:** `bundle exec standardrb --fix`
- **Type check:** `bundle exec steep check`
- **Default rake (tests + lint):** `bundle exec rake`

Note: Linting uses [Standard Ruby](https://github.com/standardrb/standard) (configured via the `standard` gem), which enforces double-quoted strings and its own opinionated style. There is no `.rubocop.yml` — Standard manages RuboCop configuration internally. Do not use `bundle exec rubocop` directly as a stale RuboCop server may apply different rules; always use `bundle exec standardrb`.
Expand Down Expand Up @@ -47,5 +49,6 @@ Providers can be registered for specific domains. `Configuration#provider(domain

- All `.rb` files must have `# frozen_string_literal: true` as the first line.
- Tests live under `spec/` and mirror the `lib/` structure. `spec/specification/` contains tests mapped to OpenFeature spec requirements.
- RBS type signatures live under `sig/` and mirror the `lib/` structure. When changing any file under `lib/`, always update the corresponding `.rbs` file under `sig/` to reflect the new or modified method signatures, constants, or class structure. Run `bundle exec steep check` to verify type correctness after changes.
- Always sign git commits using the `-S` flag.
- Always include DCO sign-off in commits using the `-s` flag (i.e., `git commit -s -S`). This adds a `Signed-off-by` trailer required by the project's CI.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ group :development, :test do
gem "standard-performance"
gem "simplecov", "~> 0.22.0"
gem "simplecov-cobertura", "~> 3.0"
gem "steep", "~> 1.9"
gem "timecop", "~> 0.9.10"
end

Expand Down
59 changes: 59 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,26 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (8.1.2)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.3.1)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
json
logger (>= 1.4.2)
minitest (>= 5.1)
securerandom (>= 0.3)
tzinfo (~> 2.0, >= 2.0.5)
uri (>= 0.13.1)
ast (2.4.3)
base64 (0.3.0)
bigdecimal (4.0.1)
builder (3.3.0)
concurrent-ruby (1.3.6)
connection_pool (3.0.2)
csv (3.3.5)
cucumber (10.2.0)
base64 (~> 0.2)
builder (~> 3.2)
Expand Down Expand Up @@ -41,8 +57,12 @@ GEM
reline (>= 0.3.8)
diff-lcs (1.6.2)
docile (1.4.1)
drb (2.2.3)
erb (6.0.2)
ffi (1.17.3)
fileutils (1.8.0)
i18n (1.14.8)
concurrent-ruby (~> 1.0)
io-console (0.8.2)
irb (1.17.0)
pp (>= 0.6.0)
Expand All @@ -52,11 +72,19 @@ GEM
json (2.18.1)
language_server-protocol (3.17.0.5)
lint_roller (1.1.0)
listen (3.10.0)
logger
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
logger (1.7.0)
markly (0.15.2)
memoist3 (1.0.0)
mini_mime (1.1.5)
minitest (6.0.2)
drb (~> 2.0)
prism (~> 1.5)
multi_test (1.1.0)
mutex_m (0.3.0)
parallel (1.27.0)
parser (3.3.10.2)
ast (~> 2.4.1)
Expand All @@ -71,6 +99,12 @@ GEM
racc (1.8.1)
rainbow (3.1.1)
rake (13.3.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rbs (3.10.3)
logger
tsort
rdoc (7.2.0)
erb
psych (>= 4.0.0)
Expand Down Expand Up @@ -111,6 +145,7 @@ GEM
rubocop (>= 1.75.0, < 2.0)
rubocop-ast (>= 1.47.1, < 2.0)
ruby-progressbar (1.13.0)
securerandom (0.4.1)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
Expand All @@ -132,15 +167,38 @@ GEM
standard-performance (1.9.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.26.0)
steep (1.10.0)
activesupport (>= 5.1)
concurrent-ruby (>= 1.1.10)
csv (>= 3.0.9)
fileutils (>= 1.1.0)
json (>= 2.1.0)
language_server-protocol (>= 3.17.0.4, < 4.0)
listen (~> 3.0)
logger (>= 1.3.0)
mutex_m (>= 0.3.0)
parser (>= 3.1)
rainbow (>= 2.2.2, < 4.0)
rbs (~> 3.9)
securerandom (>= 0.1)
strscan (>= 1.0.0)
terminal-table (>= 2, < 5)
uri (>= 0.12.0)
stringio (3.2.0)
strscan (3.1.7)
sys-uname (1.5.0)
ffi (~> 1.1)
memoist3 (~> 1.0.0)
terminal-table (4.0.0)
unicode-display_width (>= 1.1.1, < 4)
timecop (0.9.10)
tsort (0.2.0)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (3.2.0)
unicode-emoji (~> 4.1)
unicode-emoji (4.2.0)
uri (1.1.1)

PLATFORMS
arm64-darwin-21
Expand All @@ -167,6 +225,7 @@ DEPENDENCIES
simplecov-cobertura (~> 3.0)
standard
standard-performance
steep (~> 1.9)
timecop (~> 0.9.10)

BUNDLED WITH
Expand Down
7 changes: 7 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,11 @@ task :cucumber do
sh "bundle exec cucumber"
end

begin
require "steep/rake_task"
Steep::RakeTask.new
rescue LoadError
# Steep not available
end

task default: %i[spec standard]
7 changes: 7 additions & 0 deletions Steepfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
D = Steep::Diagnostic

target :lib do
signature "sig"
check "lib"
configure_code_diagnostics(D::Ruby.lenient)
end
Loading
Loading