diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 704f345..9714d42 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -18,4 +18,10 @@ jobs:
bundler-cache: true
- name: Run rake
run: bundle exec rake
-
+ lint:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Lint with Standard
+ uses: standardrb/standard-ruby-action@v1
+ with:
+ autofix: false
\ No newline at end of file
diff --git a/.gitignore b/.gitignore
index c852870..d9a091c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
/.bundle/
+/.idea/
/.yardoc
/_yardoc/
/coverage/
diff --git a/.idea/.gitignore b/.idea/.gitignore
deleted file mode 100644
index 13566b8..0000000
--- a/.idea/.gitignore
+++ /dev/null
@@ -1,8 +0,0 @@
-# Default ignored files
-/shelf/
-/workspace.xml
-# Editor-based HTTP Client requests
-/httpRequests/
-# Datasource local storage ignored files
-/dataSources/
-/dataSources.local.xml
diff --git a/.idea/misc.xml b/.idea/misc.xml
deleted file mode 100644
index a21b452..0000000
--- a/.idea/misc.xml
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
-
-
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
deleted file mode 100644
index f9dc4ca..0000000
--- a/.idea/modules.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/rspec-common.iml b/.idea/rspec-common.iml
deleted file mode 100644
index 3c1515f..0000000
--- a/.idea/rspec-common.iml
+++ /dev/null
@@ -1,41 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
deleted file mode 100644
index 94a25f7..0000000
--- a/.idea/vcs.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/Rakefile b/Rakefile
index bbb0962..bbd0d3b 100644
--- a/Rakefile
+++ b/Rakefile
@@ -3,7 +3,7 @@ require "bundler/setup"
require "rspec/core/rake_task"
RSpec::Core::RakeTask.new(:spec)
+task default: :spec
require "standard/rake"
-
-task default: %w[spec standard]
+task default: :standard unless ENV["CI"]
diff --git a/lib/rspec/common/extensions/active_storage/service/memory.rb b/lib/rspec/common/extensions/active_storage/service/memory.rb
index 255f7b7..9888030 100644
--- a/lib/rspec/common/extensions/active_storage/service/memory.rb
+++ b/lib/rspec/common/extensions/active_storage/service/memory.rb
@@ -12,10 +12,8 @@
module ActiveStorage
class Service::MemoryService < Service
# We explicity do NOT want the super behavior from ActiveStorage
- # rubocop:disable Lint/MissingSuper
def initialize(**config)
end
- # rubocop:enable Lint/MissingSuper
def reset!
@storage = nil
diff --git a/lib/rspec/common/extensions/elasticsearch/client.rb b/lib/rspec/common/extensions/elasticsearch/client.rb
index 85f7983..bc10c35 100644
--- a/lib/rspec/common/extensions/elasticsearch/client.rb
+++ b/lib/rspec/common/extensions/elasticsearch/client.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Lint/SuppressedException
begin
require "elasticsearch/model"
@@ -63,4 +62,3 @@ def respond_to_missing?(*)
def elasticsearch_return(*args, **kwargs)
Doubles::Elasticsearch::Client.return(*args, **kwargs)
end
-# rubocop:enable Lint/SuppressedException
diff --git a/lib/rspec/common/extensions/elasticsearch/response_builder.rb b/lib/rspec/common/extensions/elasticsearch/response_builder.rb
index 3b311be..d9c09c8 100644
--- a/lib/rspec/common/extensions/elasticsearch/response_builder.rb
+++ b/lib/rspec/common/extensions/elasticsearch/response_builder.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Lint/SuppressedException
begin
require "elasticsearch/model"
@@ -32,4 +31,3 @@ def response
end
rescue LoadError
end
-# rubocop:enable Lint/SuppressedException
diff --git a/lib/rspec/common/helpers/controller_exceptions.rb b/lib/rspec/common/helpers/controller_exceptions.rb
index 7a0a830..28a8352 100644
--- a/lib/rspec/common/helpers/controller_exceptions.rb
+++ b/lib/rspec/common/helpers/controller_exceptions.rb
@@ -8,7 +8,6 @@
#
# config.before { config.include(RSpec::Common::Helpers::ControllerExceptions, type: :controller) }
-# rubocop:disable Metrics/MethodLength
module RSpec::Common
module Helpers
module ControllerExceptions
@@ -34,4 +33,3 @@ def process(...)
end
end
end
-# rubocop:enable Metrics/MethodLength
diff --git a/lib/rspec/common/helpers/exceptions.rb b/lib/rspec/common/helpers/exceptions.rb
index 1d1258c..8e2886e 100644
--- a/lib/rspec/common/helpers/exceptions.rb
+++ b/lib/rspec/common/helpers/exceptions.rb
@@ -1,17 +1,15 @@
module RSpec::Common
module Helpers
module Exceptions
- # rubocop:disable Lint/RescueException
def fallible(suppress: :runtime)
raise ArgumentError unless %i[none runtime all].include?(suppress)
yield
rescue
raise if suppress == :none
- rescue Exception
+ rescue Exception # standard:disable Lint/RescueException
raise unless suppress == :all
end
- # rubocop:enable Lint/RescueException
end
end
end
diff --git a/lib/rspec/common/matchers/elasticsearch.rb b/lib/rspec/common/matchers/elasticsearch.rb
index 2b1658f..431902d 100644
--- a/lib/rspec/common/matchers/elasticsearch.rb
+++ b/lib/rspec/common/matchers/elasticsearch.rb
@@ -48,7 +48,6 @@
end
end
-# rubocop:disable Metrics/BlockLength
RSpec::Matchers.define :search_elasticsearch_index do |index|
chain :with_query do |query|
@query = query
@@ -99,4 +98,3 @@
message
end
end
-# rubocop:enable Metrics/BlockLength
diff --git a/lib/rspec/common/matchers/models.rb b/lib/rspec/common/matchers/models.rb
index 1d0d762..04bb264 100644
--- a/lib/rspec/common/matchers/models.rb
+++ b/lib/rspec/common/matchers/models.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Metrics/BlockLength
RSpec::Matchers.define :create_record do |model_class|
supports_block_expectations
@@ -50,4 +49,3 @@ def filter_by_proc_attributes(relation)
end
end
end
-# rubocop:enable Metrics/BlockLength
diff --git a/lib/rspec/common/matchers/rollbar.rb b/lib/rspec/common/matchers/rollbar.rb
index 4a6463e..593baa4 100644
--- a/lib/rspec/common/matchers/rollbar.rb
+++ b/lib/rspec/common/matchers/rollbar.rb
@@ -1,4 +1,3 @@
-# rubocop:disable Metrics/BlockLength
RSpec::Matchers.define :send_rollbar_report do |level|
supports_block_expectations
@@ -47,4 +46,3 @@ def failure_message
message
end
end
-# rubocop:enable Metrics/BlockLength
diff --git a/lib/rspec/common/matchers/views/json.rb b/lib/rspec/common/matchers/views/json.rb
index 69738b4..a8f738f 100644
--- a/lib/rspec/common/matchers/views/json.rb
+++ b/lib/rspec/common/matchers/views/json.rb
@@ -67,7 +67,6 @@ def generate_results_for(json)
hash.dig(*keys) if hash.is_a?(Hash)
end
- # rubocop:disable Naming/PredicateName
def has_keys?
hash = parent.results_for(actual)
@@ -80,7 +79,6 @@ def has_keys?
end
end
end
- # rubocop:enable Naming/PredicateName
end
class JsonArrayMatcher
@@ -201,8 +199,6 @@ def initialize
JsonArrayMatcher.new(JsonMatcherRoot.instance)
end
-# rubocop:disable Naming/PredicateName
define_method :have_json_element do |*elements|
JsonElementMatcher.new(JsonMatcherRoot.instance, *elements)
end
-# rubocop:enable Naming/PredicateName