Add and configure rubocop and rubocop-rspec

This commit is contained in:
Wilson Silva 2023-01-06 10:25:59 +07:00
parent e3ef933b4f
commit b8d663ca00
No known key found for this signature in database
GPG Key ID: 65135F94E23F82C8
2 changed files with 23 additions and 1 deletions

View File

@ -1,13 +1,33 @@
require: rubocop-rspec
AllCops: AllCops:
TargetRubyVersion: 3.2 TargetRubyVersion: 3.2
DisplayCopNames: true
NewCops: enable
# ----------------------- Style -----------------------
Style/StringLiterals: Style/StringLiterals:
Enabled: true Enabled: true
EnforcedStyle: double_quotes EnforcedStyle: single_quotes
Style/StringLiteralsInInterpolation: Style/StringLiteralsInInterpolation:
Enabled: true Enabled: true
EnforcedStyle: double_quotes EnforcedStyle: double_quotes
# ----------------------- Layout ----------------------
Layout/LineLength: Layout/LineLength:
Max: 120 Max: 120
# ---------------------- Metrics ----------------------
Metrics/BlockLength:
Exclude:
- '**/*_spec.rb'
- nostr.gemspec
# ----------------------- RSpec -----------------------
RSpec/ExampleLength:
Enabled: false

View File

@ -13,6 +13,7 @@ Gem::Specification.new do |spec|
spec.homepage = "https://github.com/wilsonsilva/nostr" spec.homepage = "https://github.com/wilsonsilva/nostr"
spec.license = "MIT" spec.license = "MIT"
spec.required_ruby_version = ">= 3.2.0" spec.required_ruby_version = ">= 3.2.0"
spec.metadata["rubygems_mfa_required"] = "true"
spec.metadata["homepage_uri"] = spec.homepage spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/wilsonsilva/nostr" spec.metadata["source_code_uri"] = "https://github.com/wilsonsilva/nostr"
@ -33,4 +34,5 @@ Gem::Specification.new do |spec|
spec.add_development_dependency "rake", "~> 13.0" spec.add_development_dependency "rake", "~> 13.0"
spec.add_development_dependency "rspec", "~> 3.12" spec.add_development_dependency "rspec", "~> 3.12"
spec.add_development_dependency "rubocop", "~> 1.42" spec.add_development_dependency "rubocop", "~> 1.42"
spec.add_development_dependency "rubocop-rspec", "2.16"
end end