diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c532c05..9ad3bc6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,19 @@ on: env: RSPEC_CI: true jobs: + rubocop: + name: Rubocop + runs-on: 'ubuntu-20.04' + steps: + - uses: actions/checkout@v4 + - uses: ruby/setup-ruby@v1 + with: + ruby-version: '3.3' + - run: script/update_rubygems_and_install_bundler + - run: bundle install --standalone + - run: bundle binstubs --all + - run: bundle exec rubocop + test: name: Ruby ${{ matrix.ruby }} ${{ matrix.name_extra || '' }} runs-on: ${{ matrix.os || 'ubuntu-20.04' }} @@ -52,5 +65,6 @@ jobs: bundler: ${{ matrix.bundler || 2 }} ruby-version: ${{ matrix.ruby }} - run: script/update_rubygems_and_install_bundler - - run: bundle install --binstubs --standalone + - run: bundle install --standalone + - run: bundle binstubs --all - run: script/test_all diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..86c8ba4 --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,46 @@ +AllCops: + NewCops: enable + SuggestExtensions: false + +Metrics/BlockLength: + Enabled: true + Exclude: + - spec/**/*_spec.rb + +Layout/LineLength: + Max: 120 + +Lint/NestedMethodDefinition: + Exclude: + - lib/rspec/its.rb + +Lint/SendWithMixinArgument: + Exclude: + - lib/rspec/its.rb + +Metrics/AbcSize: + Exclude: + - lib/rspec/its.rb + +Metrics/MethodLength: + Max: 25 + +Naming/PredicateName: + Exclude: + - lib/rspec/its.rb + +Style/CaseEquality: + Exclude: + - lib/rspec/its/subject.rb + +Style/SignalException: + Exclude: + - features/**/*.rb + +Style/SpecialGlobalVars: + Exclude: + - rspec-its.gemspec + +# We don't care about single vs double quotes. +Style/StringLiterals: + Enabled: false diff --git a/Gemfile b/Gemfile index eb60617..0211017 100644 --- a/Gemfile +++ b/Gemfile @@ -24,3 +24,4 @@ gem 'cucumber', '>= 1.3.8' gem 'ffi', '~> 1.15.0' gem 'matrix', '~> 0.4.2' gem 'rake', '~> 13.0.0' +gem 'rubocop', '~> 1.68.0'