Skip to content

Commit

Permalink
Linting and cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
pboling committed Mar 24, 2021
1 parent 24afb4f commit 9b0454e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 54 deletions.
8 changes: 8 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,11 @@ Sequel/SaveChanges:

Lint/UselessMethodDefinition:
Enabled: false

RSpec/FilePath:
Include:
- spec
- spec_orms

RSpec/BeforeAfterAll:
Enabled: false
51 changes: 3 additions & 48 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-03-24 02:03:11 UTC using RuboCop version 1.11.0.
# on 2021-03-24 02:21:52 UTC using RuboCop version 1.11.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -13,14 +13,6 @@ Gemspec/RequiredRubyVersion:
Exclude:
- 'omniauth-identity.gemspec'

# Offense count: 2
# Configuration parameters: AllowedMethods.
# AllowedMethods: enums
Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec_orms/active_record_spec.rb'
- 'spec_orms/sequel_spec.rb'

# Offense count: 1
# Configuration parameters: AllowComments.
Lint/EmptyClass:
Expand All @@ -32,13 +24,6 @@ Lint/MissingSuper:
Exclude:
- 'lib/omniauth/identity/secure_password.rb'

# Offense count: 1
Lint/UselessAssignment:
Exclude:
- '**/*.md'
- '**/*.markdown'
- 'Rakefile'

# Offense count: 2
# Configuration parameters: IgnoredMethods, CountRepeatedAttributes.
Metrics/AbcSize:
Expand Down Expand Up @@ -90,16 +75,6 @@ Naming/PredicateName:
- 'spec/**/*'
- 'lib/omniauth/identity/secure_password.rb'

# Offense count: 3
RSpec/BeforeAfterAll:
Exclude:
- 'spec/spec_helper.rb'
- 'spec/rails_helper.rb'
- 'spec/support/**/*.rb'
- 'spec_orms/couch_potato_spec.rb'
- 'spec_orms/nobrainer_spec.rb'
- 'spec_orms/sequel_spec.rb'

# Offense count: 6
# Configuration parameters: Prefixes.
# Prefixes: when, with, without
Expand All @@ -119,26 +94,6 @@ RSpec/ExpectInHook:
Exclude:
- 'spec/omniauth/strategies/identity_spec.rb'

# Offense count: 8
# Configuration parameters: Include, CustomTransform, IgnoreMethods, SpecSuffixOnly.
# Include: **/*_spec*rb*, **/spec/**/*
RSpec/FilePath:
Exclude:
- 'spec/omniauth/identity/model_spec.rb'
- 'spec/omniauth/identity/secure_password_spec.rb'
- 'spec/omniauth/strategies/identity_spec.rb'
- 'spec_orms/active_record_spec.rb'
- 'spec_orms/couch_potato_spec.rb'
- 'spec_orms/mongoid_spec.rb'
- 'spec_orms/nobrainer_spec.rb'
- 'spec_orms/sequel_spec.rb'

# Offense count: 2
RSpec/LeakyConstantDeclaration:
Exclude:
- 'spec_orms/active_record_spec.rb'
- 'spec_orms/sequel_spec.rb'

# Offense count: 8
# Configuration parameters: .
# SupportedStyles: have_received, receive
Expand Down Expand Up @@ -172,11 +127,11 @@ RSpec/StubbedMock:
# Offense count: 5
RSpec/SubjectStub:
Exclude:
- 'spec_orms/active_record_spec.rb'
- 'spec/omniauth/identity/models/active_record_spec.rb'
- 'spec/omniauth/identity/models/sequel_spec.rb'
- 'spec_orms/couch_potato_spec.rb'
- 'spec_orms/mongoid_spec.rb'
- 'spec_orms/nobrainer_spec.rb'
- 'spec_orms/sequel_spec.rb'

# Offense count: 4
# Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
Expand Down
4 changes: 0 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,6 @@ rescue LoadError
task :test do
warn 'RSpec is disabled'
end
task :spec do
warn 'RSpec is disabled'
end
end

begin
Expand All @@ -39,4 +36,3 @@ end

# These tests do not require any services to be running, so this is what we run via Github Actions
task default: %i[test]

3 changes: 2 additions & 1 deletion spec/omniauth/identity/models/active_record_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
require 'active_record'
require 'anonymous_active_record'

class TestIdentity < OmniAuth::Identity::Models::ActiveRecord; end

RSpec.describe(OmniAuth::Identity::Models::ActiveRecord, sqlite3: true) do
describe 'model', type: :model do
subject(:model_klass) do
Expand All @@ -21,7 +23,6 @@ def flower
include_context 'persistable model'

describe '::table_name' do
class TestIdentity < OmniAuth::Identity::Models::ActiveRecord; end
it 'does not use STI rules for its table name' do
expect(TestIdentity.table_name).to eq('test_identities')
end
Expand Down
3 changes: 2 additions & 1 deletion spec/omniauth/identity/models/sequel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
require 'sqlite3'
require 'sequel'

DB = Sequel.sqlite

RSpec.describe(OmniAuth::Identity::Models::Sequel, sqlite3: true) do
before(:all) do
# Connect to an in-memory sqlite3 database.
DB = Sequel.sqlite
DB.create_table :sequel_test_identities do
primary_key :id
String :email, null: false
Expand Down

0 comments on commit 9b0454e

Please sign in to comment.