From 89c29e6b1fa91c1d2a7d3eba7e4d2809f8030830 Mon Sep 17 00:00:00 2001 From: James Couball Date: Tue, 17 Sep 2024 23:10:31 -0700 Subject: [PATCH] Use shared Rubocop config --- .rubocop.yml | 39 +++++---------------------------------- Rakefile | 12 ++---------- discovery_v1.gemspec | 1 + 3 files changed, 8 insertions(+), 44 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 23da149..c2aae47 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,36 +1,7 @@ +inherit_gem: + main_branch_shared_rubocop_config: config/rubocop.yml + AllCops: - NewCops: enable - # Output extra information for each offense to make it easier to diagnose: - DisplayCopNames: true - DisplayStyleGuide: true - ExtraDetails: true - SuggestExtensions: false - # RuboCop enforces rules depending on the oldest version of Ruby which - # your project supports: + # Pin this project to Ruby 3.1 in case the shared config above is upgraded to 3.2 + # or later. TargetRubyVersion: 3.1 - -Gemspec/DevelopmentDependencies: - EnforcedStyle: gemspec - -# The default max line length is 80 characters -Layout/LineLength: - Max: 120 - -# The DSL for RSpec and the gemspec file make it very hard to limit block length: -Metrics/BlockLength: - Exclude: - - "spec/spec_helper.rb" - - "spec/**/*_spec.rb" - - "*.gemspec" - -Metrics/ModuleLength: - CountAsOne: ['hash'] - -# When writing minitest tests, it is very hard to limit test class length: -Metrics/ClassLength: - CountAsOne: ['hash'] - Exclude: - - "test/**/*_test.rb" - -Style/AsciiComments: - Enabled: false diff --git a/Rakefile b/Rakefile index 960bb27..51f21c4 100644 --- a/Rakefile +++ b/Rakefile @@ -48,17 +48,9 @@ CLEAN << 'rspec-report.xml' require 'rubocop/rake_task' -RuboCop::RakeTask.new do |t| - t.options = %w[ - --display-cop-names - --display-style-guide - --extra-details - --format progress - --format json --out rubocop-report.json - ] -end +RuboCop::RakeTask.new -CLEAN << 'rubocop-report.json' +# YARD unless RUBY_PLATFORM == 'java' # yard:build diff --git a/discovery_v1.gemspec b/discovery_v1.gemspec index 8bbea51..467996c 100644 --- a/discovery_v1.gemspec +++ b/discovery_v1.gemspec @@ -36,6 +36,7 @@ Gem::Specification.new do |spec| spec.add_development_dependency 'bundler-audit', '~> 0.9' spec.add_development_dependency 'create_github_release', '~> 1.5' + spec.add_development_dependency 'main_branch_shared_rubocop_config', '~> 0.1' spec.add_development_dependency 'rake', '~> 13.2' spec.add_development_dependency 'rspec', '~> 3.13' spec.add_development_dependency 'rubocop', '~> 1.66'