Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use shared Rubocop config #16

Merged
merged 1 commit into from
Sep 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 5 additions & 34 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -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
12 changes: 2 additions & 10 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions discovery_v1.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
Loading