Skip to content
This repository was archived by the owner on Oct 12, 2023. It is now read-only.

Commit dc8407d

Browse files
committed
Add rubocop check
1 parent f59ed92 commit dc8407d

File tree

8 files changed

+97
-21
lines changed

8 files changed

+97
-21
lines changed

.rubocop.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
inherit_from: .rubocop_todo.yml
2+
3+
AllCops:
4+
Exclude:
5+
- bin/**
6+
DisplayCopNames: true
7+
8+
Lint/AssignmentInCondition:
9+
Enabled: false
10+
11+
Metrics/AbcSize:
12+
Max: 30
13+
14+
Metrics/LineLength:
15+
Max: 128
16+
17+
Metrics/MethodLength:
18+
Enabled: false
19+
20+
Rails/HasAndBelongsToMany:
21+
Enabled: false
22+
23+
Style/AlignParameters:
24+
Enabled: false
25+
26+
Style/AsciiComments:
27+
Enabled: false
28+
29+
Style/BlockComments:
30+
Enabled: false
31+
32+
Style/ClassAndModuleChildren:
33+
Enabled: false
34+
35+
Style/Documentation:
36+
Enabled: false
37+
38+
Style/GuardClause:
39+
Enabled: false
40+
41+
Style/NumericLiterals:
42+
MinDigits: 10
43+
44+
Style/PercentLiteralDelimiters:
45+
PreferredDelimiters:
46+
'%': '{}'
47+
48+
Style/RedundantSelf:
49+
Enabled: false
50+
51+
Style/SignalException:
52+
Enabled: false
53+
54+
Style/SpaceBeforeFirstArg:
55+
Enabled: false
56+
57+
Style/TrailingCommaInArguments:
58+
EnforcedStyleForMultiline: comma
59+
60+
Style/TrailingCommaInLiteral:
61+
EnforcedStyleForMultiline: comma

.rubocop_todo.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# This configuration was generated by
2+
# `rubocop --auto-gen-config`
3+
# on 2016-01-25 23:55:46 +0900 using RuboCop version 0.36.0.
4+
# The point is for the user to remove these configuration records
5+
# one by one as the offenses are removed from the code base.
6+
# Note that changes in the inspected code, or installation of new
7+
# versions of RuboCop, may require this file to be generated again.
8+
9+
# Offense count: 1
10+
# Cop supports --auto-correct.
11+
Style/MutableConstant:
12+
Exclude:
13+
- 'lib/validation_examples_matcher/version.rb'

Rakefile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
require "bundler/gem_tasks"
2-
require "rspec/core/rake_task"
1+
require 'bundler/gem_tasks'
2+
require 'rspec/core/rake_task'
3+
require 'rubocop/rake_task'
34

45
RSpec::Core::RakeTask.new(:spec)
6+
RuboCop::RakeTask.new
57

6-
task :default => :spec
8+
task default: [:rubocop, :spec]

lib/validation_examples_matcher.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
require "validation_examples_matcher/version"
1+
require 'validation_examples_matcher/version'
22
require 'rspec/expectations'
33

44
module ValidationExamplesMatcher
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
# frozen_string_literal: true
12
module ValidationExamplesMatcher
2-
VERSION = "0.1.0"
3+
VERSION = '0.1.0'
34
end

spec/unit_tests/be_invalid_on_matcher_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
end
6060
end
6161

62-
6362
it 'is registered with failure_message block' do
6463
expect(failure_message_block).to be_kind_of(Proc)
6564
end

spec/unit_tests/be_valid_on_matcher_spec.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@
5959
end
6060
end
6161

62-
6362
it 'is registered with failure_message block' do
6463
expect(failure_message_block).to be_kind_of(Proc)
6564
end

validation_examples_matcher.gemspec

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,29 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
33
require 'validation_examples_matcher/version'
44

55
Gem::Specification.new do |spec|
6-
spec.name = "validation_examples_matcher"
6+
spec.name = 'validation_examples_matcher'
77
spec.version = ValidationExamplesMatcher::VERSION
8-
spec.authors = ["Hirokazu Nishioka"]
9-
spec.email = ["hiro@nisshiee.org"]
8+
spec.authors = ['Hirokazu Nishioka']
9+
spec.email = ['hiro@nisshiee.org']
1010

11-
spec.summary = %q{Validation matcher with examples for RSpec}
12-
spec.description = %q{validation_examples_matcher provides rspec matcher testing validations with examples.}
13-
# spec.homepage = "TODO: Put your gem's website or public repo URL here."
14-
spec.license = "MIT"
11+
spec.summary = 'Validation matcher with examples for RSpec'
12+
spec.description = 'validation_examples_matcher provides rspec matcher testing validations with examples.'
13+
spec.homepage = 'https://github.com/nisshiee/validation_examples_matcher'
14+
spec.license = 'MIT'
1515

1616
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17-
spec.bindir = "exe"
17+
spec.bindir = 'exe'
1818
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19-
spec.require_paths = ["lib"]
19+
spec.require_paths = ['lib']
2020

2121
spec.required_ruby_version = '>= 2.0'
2222

2323
spec.add_runtime_dependency 'rspec-expectations', '~> 3.0'
2424

25-
spec.add_development_dependency "bundler", "~> 1.11"
26-
spec.add_development_dependency "rake", "~> 10.0"
27-
spec.add_development_dependency "rspec", "~> 3.0"
28-
spec.add_development_dependency "activemodel", "~> 4.2.5"
29-
spec.add_development_dependency "pry-byebug", "~> 3.3.0"
25+
spec.add_development_dependency 'bundler', '~> 1.11'
26+
spec.add_development_dependency 'rake', '~> 10.0'
27+
spec.add_development_dependency 'rspec', '~> 3.0'
28+
spec.add_development_dependency 'activemodel', '~> 4.2.5'
29+
spec.add_development_dependency 'pry-byebug', '~> 3.3.0'
30+
spec.add_development_dependency 'rubocop', '>= 0.36.0', '< 0.37.0'
3031
end

0 commit comments

Comments
 (0)