Skip to content

Commit 118f001

Browse files
nficanoclaude
andcommitted
add CI, CONTRIBUTING, STYLE, lefthook; tidy runtime and specs; drop planning docs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 1f05e0b commit 118f001

13 files changed

Lines changed: 173 additions & 2020 deletions

File tree

.github/workflows/ruby.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Ruby
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
lint:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- uses: ruby/setup-ruby@v1
13+
with:
14+
ruby-version: .ruby-version
15+
bundler-cache: true
16+
- run: bundle exec rubocop --parallel
17+
- run: bundle exec bundle-audit check --update
18+
19+
test:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v4
23+
- uses: ruby/setup-ruby@v1
24+
with:
25+
ruby-version: .ruby-version
26+
bundler-cache: true
27+
- run: bundle exec rspec
28+
29+
docs:
30+
runs-on: ubuntu-latest
31+
steps:
32+
- uses: actions/checkout@v4
33+
- uses: ruby/setup-ruby@v1
34+
with:
35+
ruby-version: .ruby-version
36+
bundler-cache: true
37+
- run: bundle exec yard --fail-on-warning

.rubocop.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
plugins:
22
- rubocop-rspec
33
- rubocop-performance
4+
- rubocop-rake
45

56
AllCops:
67
TargetRubyVersion: 3.4
@@ -20,16 +21,17 @@ Style/StringLiterals:
2021
Style/StringLiteralsInInterpolation:
2122
EnforcedStyle: single_quotes
2223

24+
# YARD docstrings exist where they add protocol value; blanket top-level
25+
# class/module comments are not required for this gem.
2326
Style/Documentation:
2427
Enabled: false
2528

2629
Style/FrozenStringLiteralComment:
2730
Enabled: true
2831
EnforcedStyle: always
2932

30-
Naming/AccessorMethodName:
31-
Enabled: false
32-
33+
# Protocol/runtime objects are intentionally larger than Sandi Metz-style
34+
# service classes; these limits flag outliers without forcing extra indirection.
3335
Metrics/MethodLength:
3436
Max: 40
3537

@@ -58,16 +60,20 @@ Metrics/ParameterLists:
5860
Max: 8
5961
CountKeywordArgs: false
6062

63+
# Short names are allowed for narrow protocol ids and tiny block locals.
6164
Naming/MethodParameterName:
6265
AllowedNames:
6366
- a
6467
- b
6568
- id
6669
- kw
6770

71+
# Integration specs are organized by protocol scenario first, not by a single
72+
# nested umbrella describe.
6873
RSpec/MultipleDescribes:
6974
Enabled: false
7075

76+
# Keep implementation files readable without forcing awkward envelope wrapping.
7177
Layout/LineLength:
7278
Max: 110
7379
Exclude:
@@ -76,15 +82,11 @@ Layout/LineLength:
7682
RSpec/ExampleLength:
7783
Max: 60
7884

85+
# Some manager command methods return booleans to signal whether a state change
86+
# happened; forcing `?` names there would misrepresent them as pure predicates.
7987
Naming/PredicateMethod:
8088
Enabled: false
8189

82-
Lint/DuplicateBranch:
83-
Enabled: false
84-
85-
Style/MultilineBlockChain:
86-
Enabled: false
87-
8890
RSpec/MultipleExpectations:
8991
Max: 8
9092

@@ -99,6 +101,8 @@ RSpec/DescribeClass:
99101
- 'spec/integration/**/*'
100102
- 'spec/e2e/**/*'
101103

104+
# Specs are grouped by test layer (`unit`, `integration`, `e2e`) instead of
105+
# mirroring the source tree exactly.
102106
RSpec/SpecFilePathFormat:
103107
Enabled: false
104108

CONFORMANCE.md

Lines changed: 0 additions & 59 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Contributing
2+
3+
## Environment
4+
5+
- Use Ruby `3.4.8`.
6+
- This repository includes both `.ruby-version` and `.tool-versions`.
7+
- If your shell does not activate the project Ruby automatically, make sure
8+
your version manager does before running Bundler commands. With `asdf`, use
9+
`asdf exec bundle exec ...` as a fallback.
10+
11+
## Setup
12+
13+
1. `bundle install`
14+
2. Install `lefthook` if you do not already have it.
15+
3. `lefthook install`
16+
17+
## Local checks
18+
19+
Run these before opening a pull request:
20+
21+
- `bundle exec rubocop`
22+
- `bundle exec rspec`
23+
- `bundle exec bundle-audit check --update`
24+
- `bundle exec yard --fail-on-warning`
25+
- `bundle exec rake`
26+
27+
`spec/spec_helper.rb` enforces a minimum SimpleCov line coverage floor. If a
28+
refactor reduces coverage, add or fix tests in the same change.
29+
30+
## Change discipline
31+
32+
- Preserve public behavior unless the change is explicitly approved.
33+
- Read the implementation, its tests, and its callers before refactoring.
34+
- Keep commits single-purpose and easy to review.
35+
- Log architectural follow-up work in `REFACTOR_BACKLOG.md` instead of mixing
36+
design changes into an idiom pass.

Gemfile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ source 'https://rubygems.org'
55
gemspec
66

77
group :development, :test do
8+
gem 'bundler-audit', require: false
89
gem 'rake', '~> 13.0'
910
gem 'rspec', '~> 3.13'
1011
gem 'rubocop', '~> 1.60', require: false
1112
gem 'rubocop-performance', require: false
13+
gem 'rubocop-rake', require: false
1214
gem 'rubocop-rspec', require: false
1315
gem 'simplecov', '~> 0.22', require: false
1416
gem 'yard', '~> 0.9', require: false

Gemfile.lock

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ GEM
4040
protocol-websocket (~> 0.17)
4141
base64 (0.3.0)
4242
bigdecimal (4.1.2)
43+
bundler-audit (0.9.3)
44+
bundler (>= 1.2.0)
45+
thor (~> 1.0)
4346
console (1.34.3)
4447
fiber-annotation
4548
fiber-local (~> 1.1)
@@ -122,6 +125,9 @@ GEM
122125
lint_roller (~> 1.1)
123126
rubocop (>= 1.75.0, < 2.0)
124127
rubocop-ast (>= 1.47.1, < 2.0)
128+
rubocop-rake (0.7.1)
129+
lint_roller (~> 1.1)
130+
rubocop (>= 1.72.1)
125131
rubocop-rspec (3.9.0)
126132
lint_roller (~> 1.1)
127133
rubocop (~> 1.81)
@@ -143,6 +149,7 @@ GEM
143149
sqlite3 (2.9.4-x86_64-darwin)
144150
sqlite3 (2.9.4-x86_64-linux-gnu)
145151
sqlite3 (2.9.4-x86_64-linux-musl)
152+
thor (1.5.0)
146153
traces (0.18.2)
147154
unicode-display_width (3.2.0)
148155
unicode-emoji (~> 4.1)
@@ -163,10 +170,12 @@ PLATFORMS
163170

164171
DEPENDENCIES
165172
arcp!
173+
bundler-audit
166174
rake (~> 13.0)
167175
rspec (~> 3.13)
168176
rubocop (~> 1.60)
169177
rubocop-performance
178+
rubocop-rake
170179
rubocop-rspec
171180
simplecov (~> 0.22)
172181
yard (~> 0.9)

0 commit comments

Comments
 (0)