diff --git a/.github/workflows/ruby.yml b/.github/workflows/ruby.yml index 50e78c0..fe45cbc 100644 --- a/.github/workflows/ruby.yml +++ b/.github/workflows/ruby.yml @@ -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 diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..dd0cfb5 --- /dev/null +++ b/.rubocop.yml @@ -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 } diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 2d23b37..e1438f1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -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 @@ -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 \ No newline at end of file +[Bundler]: https://bundler.io/ +[Slack]: https://join.slack.com/t/stytch/shared_invite/zt-nil4wo92-jApJ9Cl32cJbEd9esKkvyg diff --git a/stytch.gemspec b/stytch.gemspec index b3bc21e..48564a1 100644 --- a/stytch.gemspec +++ b/stytch.gemspec @@ -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