From 1c2f0655d3de1f041dfa23e554ea60a0f4c8c6f3 Mon Sep 17 00:00:00 2001 From: Grant Hutchins Date: Tue, 10 Dec 2024 09:43:12 -0600 Subject: [PATCH 1/2] Remove RubyMine metadata --- .gitignore | 1 + .idea/.gitignore | 8 -------- .idea/misc.xml | 4 ---- .idea/modules.xml | 8 -------- .idea/rspec-common.iml | 41 ----------------------------------------- .idea/vcs.xml | 6 ------ 6 files changed, 1 insertion(+), 67 deletions(-) delete mode 100644 .idea/.gitignore delete mode 100644 .idea/misc.xml delete mode 100644 .idea/modules.xml delete mode 100644 .idea/rspec-common.iml delete mode 100644 .idea/vcs.xml 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 From 378d82471224e68538b4b6fca167a171fbc04661 Mon Sep 17 00:00:00 2001 From: Grant Hutchins Date: Mon, 9 Dec 2024 13:26:44 -0600 Subject: [PATCH 2/2] Clean up repo for standard gem --- .github/workflows/ci.yml | 8 +++++++- Rakefile | 4 ++-- .../common/extensions/active_storage/service/memory.rb | 2 -- lib/rspec/common/extensions/elasticsearch/client.rb | 2 -- .../common/extensions/elasticsearch/response_builder.rb | 2 -- lib/rspec/common/helpers/controller_exceptions.rb | 2 -- lib/rspec/common/helpers/exceptions.rb | 4 +--- lib/rspec/common/matchers/elasticsearch.rb | 2 -- lib/rspec/common/matchers/models.rb | 2 -- lib/rspec/common/matchers/rollbar.rb | 2 -- lib/rspec/common/matchers/views/json.rb | 4 ---- 11 files changed, 10 insertions(+), 24 deletions(-) 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/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