Skip to content

Commit

Permalink
dev: Add Rubocop for linting (#94)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremy-stytch authored Sep 11, 2023
1 parent 987e677 commit ef272aa
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 2 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/ruby.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,16 @@ jobs:
bundler-cache: true

- run: bundle exec rspec

lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3

- uses: ruby/setup-ruby@v1
with:
# Match the minimum supported Ruby version in the gemspec.
ruby-version: '2.7'
bundler-cache: true

- run: bundle exec rubocop
15 changes: 15 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
require:
- rubocop-rspec

AllCops:
NewCops: disable
# The target Ruby version must match the one in stytch.gemspec.
TargetRubyVersion: 2.7

Layout: { Enabled: false }
Metrics: { Enabled: false }
Style: { Enabled: false }

RSpec/DescribedClass: { Enabled: false }
RSpec/ExampleLength: { Enabled: false }
RSpec/MultipleExpectations: { Enabled: false }
7 changes: 5 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Thanks for contributing to Stytch's Ruby library! If you run into trouble, find
## Setup

1. Clone this repo.
2. To test your changes locally, update your GEMFILE with `gem 'stytch', path: '../stytch'` where `../stytch` is the path to your cloned copy of stytch-ruby.
2. Install development dependencies using [Bundler]: `bundle install`

To test your changes locally in another project, update your `GEMFILE` with `gem 'stytch', path: '../stytch'` where `../stytch` is the path to your cloned copy of stytch-ruby.

## Issues and Pull Requests

Expand All @@ -15,4 +17,5 @@ If you have non-trivial changes you'd like us to incorporate, please open an iss

When you're ready for someone to look at your issue or PR, assign `@stytchauth/client-libraries` (GitHub should do this automatically). If we don't acknowledge it within one business day, please escalate it by tagging `@stytchauth/engineering` in a comment or letting us know in [Slack].

[Slack]: https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg
[Bundler]: https://bundler.io/
[Slack]: https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg
2 changes: 2 additions & 0 deletions stytch.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -30,4 +30,6 @@ Gem::Specification.new do |spec|
spec.add_dependency 'jwt', '>= 2.3.0'

spec.add_development_dependency 'rspec', '~> 3.11.0'
spec.add_development_dependency 'rubocop', '1.56.3'
spec.add_development_dependency 'rubocop-rspec', '2.24.0'
end

0 comments on commit ef272aa

Please sign in to comment.