umts-custom-cops 0.3.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +6 -1
- data/.travis.yml +14 -9
- data/Gemfile +2 -0
- data/LICENSE.txt +1 -1
- data/README.md +0 -2
- data/Rakefile +2 -0
- data/bin/console +1 -0
- data/lib/umts-custom-cops.rb +2 -0
- data/lib/umts-custom-cops/be_matcher_for_non_duplicable_types.rb +4 -2
- data/lib/umts-custom-cops/predicate_method_matcher.rb +3 -1
- data/lib/umts-custom-cops/version.rb +3 -1
- data/umts-custom-cops.gemspec +13 -9
- metadata +28 -38
- data/.bundler.version +0 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3fd3babbd34390821e6966e35cc99538218c43bceb35b5dc4dc888711d811d38
|
4
|
+
data.tar.gz: 439c6e906a47df2bacb02ac0f4023c96409ffa0534feb8da3e23a588ad54a678
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6924bc7f455be47fe691f52418bce0550b2de075e4b8c95e6b0a2090b8d214db36f9923a4d47240f935111bb01869f6f37ebd61016163421a0fb02ed272afa51
|
7
|
+
data.tar.gz: c91ae1f325772c354ab34c9fcea65b13705265e62f38444824bc5156843fe01ad9056f0fb5db0655e23ec57eae760ec6433065a98dbe5750d5b5355b7c6dc1d0
|
data/.rubocop.yml
CHANGED
data/.travis.yml
CHANGED
@@ -1,16 +1,21 @@
|
|
1
1
|
language: ruby
|
2
2
|
rvm:
|
3
|
-
- 2.
|
4
|
-
- 2.
|
5
|
-
- 2.
|
6
|
-
-
|
7
|
-
- 2.6.1
|
3
|
+
- 2.5.8
|
4
|
+
- 2.6.5
|
5
|
+
- 2.7.2
|
6
|
+
- 3.0.0
|
8
7
|
env: CODECLIMATE_REPO_TOKEN=c356c22cc5b342d3cba9a1fb9d71b63b52de9b9daa1f54c07f959f90da05c8ff
|
9
|
-
before_install:
|
10
|
-
|
8
|
+
before_install:
|
9
|
+
- gem update --system
|
10
|
+
- gem install bundler
|
11
|
+
before_script:
|
12
|
+
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
13
|
+
- chmod +x ./cc-test-reporter
|
14
|
+
- ./cc-test-reporter before-build
|
15
|
+
script:
|
11
16
|
- bundle exec rake
|
12
|
-
|
13
|
-
-
|
17
|
+
after_script:
|
18
|
+
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
14
19
|
notifications:
|
15
20
|
email:
|
16
21
|
on_success: change
|
data/Gemfile
CHANGED
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) 2020 UMass Transit Services
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/README.md
CHANGED
@@ -3,8 +3,6 @@
|
|
3
3
|
Custom Rubocops, currently all related to RSpec, used for UMass Transit's
|
4
4
|
internal Rails development purposes.
|
5
5
|
|
6
|
-
Primary contributor is @dfaulken.
|
7
|
-
|
8
6
|
A lot of the ideas for this came from some reading of the rubocop source
|
9
7
|
code, so thanks to the RuboCop team for making it public.
|
10
8
|
|
data/Rakefile
CHANGED
data/bin/console
CHANGED
data/lib/umts-custom-cops.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubocop'
|
2
4
|
|
3
5
|
module RuboCop
|
@@ -7,14 +9,14 @@ module RuboCop
|
|
7
9
|
#
|
8
10
|
# See the specs for examples.
|
9
11
|
class BeMatcherForNonDuplicableTypes < Cop
|
10
|
-
MSG = 'Prefer `be` matcher to `eq` or `eql` for non-duplicable types.'
|
12
|
+
MSG = 'Prefer `be` matcher to `eq` or `eql` for non-duplicable types.'
|
11
13
|
|
12
14
|
def_node_matcher :eq_on_non_duplicable_type?, <<-PATTERN
|
13
15
|
(send
|
14
16
|
_expectation {:to :not_to}
|
15
17
|
(send
|
16
18
|
_context {:eq :eql}
|
17
|
-
{true false nil
|
19
|
+
{true false nil}
|
18
20
|
)
|
19
21
|
)
|
20
22
|
PATTERN
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require 'rubocop'
|
2
4
|
|
3
5
|
module RuboCop
|
@@ -6,7 +8,7 @@ module RuboCop
|
|
6
8
|
# See the specs for examples.
|
7
9
|
class PredicateMethodMatcher < Cop
|
8
10
|
MESSAGE =
|
9
|
-
'Prefer predicate matcher over checking the return value of a predicate method.'
|
11
|
+
'Prefer predicate matcher over checking the return value of a predicate method.'
|
10
12
|
|
11
13
|
def_node_matcher :generic_equality_expectation, <<-PATTERN
|
12
14
|
(send
|
data/umts-custom-cops.gemspec
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
lib = File.expand_path('lib', __dir__)
|
2
4
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
5
|
require 'umts-custom-cops/version'
|
@@ -15,20 +17,22 @@ Gem::Specification.new do |spec|
|
|
15
17
|
|
16
18
|
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
17
19
|
# delete this section to allow pushing this gem to any host.
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
20
|
+
raise <<~MSG unless spec.respond_to?(:metadata)
|
21
|
+
RubyGems 2.0 or newer is required to protect against public gem pushes.
|
22
|
+
MSG
|
23
|
+
|
24
|
+
spec.metadata['allowed_push_host'] = 'https://rubygems.org'
|
22
25
|
|
23
26
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(spec)/}) }
|
24
27
|
spec.require_paths = ['lib']
|
25
28
|
|
26
|
-
spec.
|
27
|
-
|
29
|
+
spec.required_ruby_version = '>= 2.5.0'
|
30
|
+
|
31
|
+
spec.add_dependency 'rubocop', '~> 1.10'
|
28
32
|
|
29
|
-
spec.add_development_dependency 'bundler',
|
30
|
-
spec.add_development_dependency 'codeclimate-test-reporter', '~> 1.0'
|
33
|
+
spec.add_development_dependency 'bundler', '~> 2.1', '>= 2.1.4'
|
31
34
|
spec.add_development_dependency 'pry-byebug'
|
32
|
-
spec.add_development_dependency 'rake', '~>
|
35
|
+
spec.add_development_dependency 'rake', '~> 13.0'
|
36
|
+
spec.add_development_dependency 'rspec', '~> 3.0'
|
33
37
|
spec.add_development_dependency 'simplecov'
|
34
38
|
end
|
metadata
CHANGED
@@ -1,99 +1,91 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: umts-custom-cops
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UMass Transit Services
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: rubocop
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '1.10'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '
|
27
|
-
- !ruby/object:Gem::Dependency
|
28
|
-
name: rubocop
|
29
|
-
requirement: !ruby/object:Gem::Requirement
|
30
|
-
requirements:
|
31
|
-
- - '='
|
32
|
-
- !ruby/object:Gem::Version
|
33
|
-
version: 0.65.0
|
34
|
-
type: :runtime
|
35
|
-
prerelease: false
|
36
|
-
version_requirements: !ruby/object:Gem::Requirement
|
37
|
-
requirements:
|
38
|
-
- - '='
|
39
|
-
- !ruby/object:Gem::Version
|
40
|
-
version: 0.65.0
|
26
|
+
version: '1.10'
|
41
27
|
- !ruby/object:Gem::Dependency
|
42
28
|
name: bundler
|
43
29
|
requirement: !ruby/object:Gem::Requirement
|
44
30
|
requirements:
|
45
31
|
- - "~>"
|
46
32
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1
|
33
|
+
version: '2.1'
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: 2.1.4
|
48
37
|
type: :development
|
49
38
|
prerelease: false
|
50
39
|
version_requirements: !ruby/object:Gem::Requirement
|
51
40
|
requirements:
|
52
41
|
- - "~>"
|
53
42
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1
|
43
|
+
version: '2.1'
|
44
|
+
- - ">="
|
45
|
+
- !ruby/object:Gem::Version
|
46
|
+
version: 2.1.4
|
55
47
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
48
|
+
name: pry-byebug
|
57
49
|
requirement: !ruby/object:Gem::Requirement
|
58
50
|
requirements:
|
59
|
-
- - "
|
51
|
+
- - ">="
|
60
52
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
53
|
+
version: '0'
|
62
54
|
type: :development
|
63
55
|
prerelease: false
|
64
56
|
version_requirements: !ruby/object:Gem::Requirement
|
65
57
|
requirements:
|
66
|
-
- - "
|
58
|
+
- - ">="
|
67
59
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
60
|
+
version: '0'
|
69
61
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
62
|
+
name: rake
|
71
63
|
requirement: !ruby/object:Gem::Requirement
|
72
64
|
requirements:
|
73
|
-
- - "
|
65
|
+
- - "~>"
|
74
66
|
- !ruby/object:Gem::Version
|
75
|
-
version: '0'
|
67
|
+
version: '13.0'
|
76
68
|
type: :development
|
77
69
|
prerelease: false
|
78
70
|
version_requirements: !ruby/object:Gem::Requirement
|
79
71
|
requirements:
|
80
|
-
- - "
|
72
|
+
- - "~>"
|
81
73
|
- !ruby/object:Gem::Version
|
82
|
-
version: '0'
|
74
|
+
version: '13.0'
|
83
75
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
76
|
+
name: rspec
|
85
77
|
requirement: !ruby/object:Gem::Requirement
|
86
78
|
requirements:
|
87
79
|
- - "~>"
|
88
80
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
81
|
+
version: '3.0'
|
90
82
|
type: :development
|
91
83
|
prerelease: false
|
92
84
|
version_requirements: !ruby/object:Gem::Requirement
|
93
85
|
requirements:
|
94
86
|
- - "~>"
|
95
87
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
88
|
+
version: '3.0'
|
97
89
|
- !ruby/object:Gem::Dependency
|
98
90
|
name: simplecov
|
99
91
|
requirement: !ruby/object:Gem::Requirement
|
@@ -115,7 +107,6 @@ executables: []
|
|
115
107
|
extensions: []
|
116
108
|
extra_rdoc_files: []
|
117
109
|
files:
|
118
|
-
- ".bundler.version"
|
119
110
|
- ".gitignore"
|
120
111
|
- ".gitmodules"
|
121
112
|
- ".rspec"
|
@@ -145,15 +136,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
145
136
|
requirements:
|
146
137
|
- - ">="
|
147
138
|
- !ruby/object:Gem::Version
|
148
|
-
version:
|
139
|
+
version: 2.5.0
|
149
140
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
150
141
|
requirements:
|
151
142
|
- - ">="
|
152
143
|
- !ruby/object:Gem::Version
|
153
144
|
version: '0'
|
154
145
|
requirements: []
|
155
|
-
|
156
|
-
rubygems_version: 2.7.8
|
146
|
+
rubygems_version: 3.0.1
|
157
147
|
signing_key:
|
158
148
|
specification_version: 4
|
159
149
|
summary: Custom Rails-specific Rubocop cops for our internal development purposes
|
data/.bundler.version
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
~> 1.17.3
|