Skip to content

Commit 3477406

Browse files
committed
Enable RuboCop on CI
When running `bundle exec rake` in the local environment, RuboCop is executed, but it was not included in the CI workflow. This PR enables RuboCop execution in the CI workflow. RuboCop performs static analysis on the source code using Ruby 3.2, in accordance with the gemspec setting `spec.required_ruby_version = ">= 3.2.0"`: https://github.com/modelcontextprotocol/ruby-sdk/blob/6b49222edb8709821a58bbe39cb85fd5409882eb/model_context_protocol.gemspec#L16 In other words, it is not necessary to run RuboCop under every Ruby version from 3.2 to head, so it is defined as a separate job from the test job.
1 parent 6b49222 commit 3477406

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

.github/workflows/ci.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,14 @@ jobs:
2222
run: bundle install
2323
- run: bundle exec rake test
2424
continue-on-error: ${{ matrix.entry.allowed-failure }}
25+
26+
rubocop:
27+
runs-on: ubuntu-latest
28+
name: RuboCop
29+
steps:
30+
- uses: actions/checkout@v3
31+
- uses: ruby/setup-ruby@v1
32+
with:
33+
ruby-version: 3.2 # Specify the oldest supported Ruby version.
34+
bundler-cache: true
35+
- run: bundle exec rake rubocop

0 commit comments

Comments
 (0)