-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* autofix rubocop errors * ignore relevant_search specs
- Loading branch information
Showing
20 changed files
with
141 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Danger | ||
on: [pull_request] | ||
jobs: | ||
danger: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
- run: | | ||
# Personal access token for dangerpr-bot - public, but base64 encoded to avoid tripping up GitHub | ||
TOKEN=$(echo -n Z2hwX0xNQ3VmanBFeTBvYkZVTWh6NVNqVFFBOEUxU25abzBqRUVuaAo= | base64 --decode) | ||
DANGER_GITHUB_API_TOKEN=$TOKEN bundle exec danger --verbose |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: Rubocop | ||
on: [push, pull_request] | ||
jobs: | ||
lint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: 2.7 | ||
bundler-cache: true | ||
- run: bundle exec rubocop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: Test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
entry: | ||
- { ruby: 'jruby-9.4.5.0', mongo: 'mongo:4.4', mongoid: '5' } | ||
- { ruby: '2.7.1', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: '3.0.5', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: '3.1.3', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: 'jruby-9.4.5.0', mongo: 'mongo:4.4', mongoid: '6' } | ||
- { ruby: '2.7.1', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: '3.0.5', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: '3.1.3', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: 'jruby-9.4.5.0', mongo: 'mongo:4.4', mongoid: '7' } | ||
- { ruby: '2.7.1', mongo: 'mongo:4.4', mongoid: '8' } | ||
- { ruby: '3.0.5', mongo: 'mongo:4.4', mongoid: '8' } | ||
- { ruby: '3.1.3', mongo: 'mongo:4.4', mongoid: '8' } | ||
experimental: [false] | ||
|
||
name: test (ruby=${{ matrix.entry.ruby }}, mongo=${{ matrix.entry.mongo }}, mongoid=${{ matrix.entry.mongoid }}) | ||
runs-on: ubuntu-latest | ||
|
||
continue-on-error: ${{ matrix.experimental }} | ||
|
||
services: | ||
mongo: | ||
image: ${{ matrix.entry.mongo }} | ||
ports: ["27017:27017"] | ||
|
||
env: | ||
MONGOID_VERSION: ${{ matrix.entry.mongoid }} | ||
COVERAGE: ${{ matrix.entry.coverage }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Ruby | ||
uses: ruby/setup-ruby@v1 | ||
with: | ||
ruby-version: ${{ matrix.entry.ruby }} | ||
bundler-cache: true | ||
|
||
- name: Run tests | ||
run: bundle exec rspec | ||
|
||
- name: Code Climate | ||
if: ${{ env.CC_TEST_REPORTER_ID != '' && success() && matrix.entry.coverage == 'true' }} | ||
uses: paambaati/[email protected] | ||
env: | ||
CC_TEST_REPORTER_ID: ${{ vars.CC_TEST_REPORTER_ID }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
AllCops: | ||
TargetRubyVersion: 2.7 | ||
Exclude: | ||
- vendor/**/* | ||
-Metrics/BlockLength: | ||
Enabled: false | ||
Metrics/CyclomaticComplexity: | ||
Max: 20 | ||
Metrics/PerceivedComplexity: | ||
Max: 30 | ||
Metrics/AbcSize: | ||
Max: 100 | ||
Exclude: | ||
- 'spec/**/*' | ||
|
||
inherit_from: .rubocop_todo.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
# frozen_string_literal: true | ||
|
||
danger.import_dangerfile(gem: 'mongoid-danger') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rubygems' | ||
require 'rake' | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Mongoid::Search::Log | ||
cattr_accessor :silent | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
module Mongoid::Search | ||
class Railtie < Rails::Railtie | ||
rake_tasks do | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Product | ||
include Mongoid::Document | ||
include Mongoid::Search | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
class Tag | ||
include Mongoid::Document | ||
include Mongoid::Search | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
# frozen_string_literal: true | ||
|
||
autoload :Product, 'models/product.rb' | ||
class Variant < Product | ||
field :color | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters