ezcater_rubocop 1.4.1 → 2.0.0.pre0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -5
- data/bin/circle_rubocop.rb +2 -2
- data/conf/rubocop.yml +5 -5
- data/conf/rubocop_rails.yml +1 -1
- data/config/default.yml +0 -4
- data/ezcater_rubocop.gemspec +5 -3
- data/lib/ezcater_rubocop.rb +1 -1
- data/lib/ezcater_rubocop/version.rb +1 -1
- metadata +41 -14
- data/lib/rubocop/cop/ezcater/ruby_timeout.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25b91003c623532c7bfef151198086556d2cea77e615469397f80e7f012c0359
|
4
|
+
data.tar.gz: 8ef8be0def6078e2410a5876df56e0a1f91d88508e3ff2aa4b7dfdf1aecb565f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 865378735794cbb0e60e0f6ff4ff84a50ae0b95c9db016bf5d237f5464049f2246b56b1a0932f1851e73f6797fe6c4ab11784df555d224f50f6bdf32ff956760
|
7
|
+
data.tar.gz: 48b0a31fc611f52e9103f9e3f7168f02d7e44a4937bf3fda294af32abf1ec04b13defdebdb97413fe3c3586d720514b44f80f65e4bb1cfb04d791395c7b28e31
|
data/CHANGELOG.md
CHANGED
@@ -6,22 +6,25 @@ This gem is moving onto its own [Semantic Versioning](https://semver.org/) schem
|
|
6
6
|
|
7
7
|
Prior to v1.0.0 this gem was versioned based on the `MAJOR`.`MINOR` version of RuboCop. The first release of the ezcater_rubocop gem was `v0.49.0`.
|
8
8
|
|
9
|
-
##
|
10
|
-
-
|
9
|
+
## v2.0.0 (unreleased)
|
10
|
+
- Update to `rubocop` v0.78.0, `rubocop-rspec` v1.37.1 and `rubocop-rails`.
|
11
|
+
- This is being released as a major update because cops have been renamed so this is unlikely to be
|
12
|
+
a drop-in replacement.
|
11
13
|
|
12
|
-
## v1.
|
13
|
-
- Add `Ezcater/RubyTimeout` cop.
|
14
|
+
## v1.3.0 (Unreleased)
|
14
15
|
|
15
|
-
## v1.3.0
|
16
16
|
- Add `Ezcater/GraphqlFieldsNaming` cop.
|
17
17
|
|
18
18
|
## v1.2.0
|
19
|
+
|
19
20
|
- Add `Ezcater/RailsTopLevelSqlExecute` to replace `ActiveRecord::Base.connection.execute` with `execute` in `db/migrate/`.
|
20
21
|
|
21
22
|
## v1.1.1
|
23
|
+
|
22
24
|
- Exclude `lib/tasks/` for `Ezcater/RailsEnv` and `Ezcater/DirectEnvCheck`.
|
23
25
|
|
24
26
|
## v1.1.0
|
27
|
+
|
25
28
|
- Add `Ezcater/RailsEnv` cop.
|
26
29
|
- Add `Ezcater/DirectEnvCheck` cop.
|
27
30
|
|
data/bin/circle_rubocop.rb
CHANGED
data/conf/rubocop.yml
CHANGED
@@ -3,10 +3,10 @@ require: ezcater_rubocop
|
|
3
3
|
AllCops:
|
4
4
|
DisplayCopNames: true
|
5
5
|
|
6
|
-
Layout/
|
6
|
+
Layout/FirstHashElementIndentation:
|
7
7
|
EnforcedStyle: consistent
|
8
8
|
|
9
|
-
Layout/
|
9
|
+
Layout/FirstArrayElementIndentation:
|
10
10
|
EnforcedStyle: consistent
|
11
11
|
|
12
12
|
Layout/MultilineMethodCallIndentation:
|
@@ -26,7 +26,7 @@ Metrics/BlockLength:
|
|
26
26
|
Metrics/CyclomaticComplexity:
|
27
27
|
Enabled: false
|
28
28
|
|
29
|
-
|
29
|
+
Layout/LineLength:
|
30
30
|
Max: 120
|
31
31
|
Exclude:
|
32
32
|
- "Gemfile"
|
@@ -42,7 +42,7 @@ Metrics/PerceivedComplexity:
|
|
42
42
|
Naming/MemoizedInstanceVariableName:
|
43
43
|
EnforcedStyleForLeadingUnderscores: required
|
44
44
|
|
45
|
-
Naming/
|
45
|
+
Naming/MethodParameterName:
|
46
46
|
AllowedNames:
|
47
47
|
- e
|
48
48
|
- ex
|
@@ -89,7 +89,7 @@ Style/EmptyLiteral:
|
|
89
89
|
|
90
90
|
Style/FrozenStringLiteralComment:
|
91
91
|
Enabled: true
|
92
|
-
EnforcedStyle:
|
92
|
+
EnforcedStyle: always
|
93
93
|
|
94
94
|
Style/GuardClause:
|
95
95
|
Enabled: false
|
data/conf/rubocop_rails.yml
CHANGED
data/config/default.yml
CHANGED
@@ -51,7 +51,3 @@ Ezcater/StyleDig:
|
|
51
51
|
Description: 'Recommend `dig` for deeply nested access.'
|
52
52
|
Enabled: true
|
53
53
|
AutoCorrect: false
|
54
|
-
|
55
|
-
Ezcater/RubyTimeout:
|
56
|
-
Description: 'Disallow use of `Timeout.timeout` because it is unsafe and can cause unexpected behavior.'
|
57
|
-
Enabled: true
|
data/ezcater_rubocop.gemspec
CHANGED
@@ -43,13 +43,15 @@ Gem::Specification.new do |spec|
|
|
43
43
|
spec.require_paths = ["lib"]
|
44
44
|
|
45
45
|
spec.add_development_dependency "bundler", "~> 1.15"
|
46
|
+
spec.add_development_dependency "mry"
|
46
47
|
spec.add_development_dependency "pry-byebug"
|
47
48
|
spec.add_development_dependency "rake", "~> 12.3"
|
48
49
|
spec.add_development_dependency "rspec", "~> 3.0"
|
49
50
|
spec.add_development_dependency "rspec_junit_formatter"
|
50
|
-
spec.add_development_dependency "simplecov"
|
51
|
+
spec.add_development_dependency "simplecov"
|
51
52
|
|
52
53
|
spec.add_runtime_dependency "parser", "!= 2.5.1.1"
|
53
|
-
spec.add_runtime_dependency "rubocop", "~> 0.
|
54
|
-
spec.add_runtime_dependency "rubocop-
|
54
|
+
spec.add_runtime_dependency "rubocop", "~> 0.78.0"
|
55
|
+
spec.add_runtime_dependency "rubocop-rails", "~> 2.4.1"
|
56
|
+
spec.add_runtime_dependency "rubocop-rspec", "~> 1.37.1"
|
55
57
|
end
|
data/lib/ezcater_rubocop.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
require "ezcater_rubocop/version"
|
4
|
+
require "rubocop-rails"
|
4
5
|
require "rubocop-rspec"
|
5
6
|
|
6
7
|
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
@@ -18,7 +19,6 @@ require "rubocop/cop/ezcater/direct_env_check"
|
|
18
19
|
require "rubocop/cop/ezcater/graphql_fields_naming"
|
19
20
|
require "rubocop/cop/ezcater/rails_configuration"
|
20
21
|
require "rubocop/cop/ezcater/rails_env"
|
21
|
-
require "rubocop/cop/ezcater/ruby_timeout"
|
22
22
|
require "rubocop/cop/ezcater/rails_top_level_sql_execute"
|
23
23
|
require "rubocop/cop/ezcater/require_gql_error_helpers"
|
24
24
|
require "rubocop/cop/ezcater/rspec_match_ordered_array"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezcater_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0.pre0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ezCater, Inc
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -24,6 +24,20 @@ dependencies:
|
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.15'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: mry
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - ">="
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - ">="
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: pry-byebug
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -84,16 +98,16 @@ dependencies:
|
|
84
98
|
name: simplecov
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
|
-
- - "
|
101
|
+
- - ">="
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: 0
|
103
|
+
version: '0'
|
90
104
|
type: :development
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
|
-
- - "
|
108
|
+
- - ">="
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: 0
|
110
|
+
version: '0'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
112
|
name: parser
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
@@ -114,28 +128,42 @@ dependencies:
|
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: 0.
|
131
|
+
version: 0.78.0
|
118
132
|
type: :runtime
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: 0.
|
138
|
+
version: 0.78.0
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rubocop-rails
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: 2.4.1
|
146
|
+
type: :runtime
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: 2.4.1
|
125
153
|
- !ruby/object:Gem::Dependency
|
126
154
|
name: rubocop-rspec
|
127
155
|
requirement: !ruby/object:Gem::Requirement
|
128
156
|
requirements:
|
129
157
|
- - "~>"
|
130
158
|
- !ruby/object:Gem::Version
|
131
|
-
version: 1.
|
159
|
+
version: 1.37.1
|
132
160
|
type: :runtime
|
133
161
|
prerelease: false
|
134
162
|
version_requirements: !ruby/object:Gem::Requirement
|
135
163
|
requirements:
|
136
164
|
- - "~>"
|
137
165
|
- !ruby/object:Gem::Version
|
138
|
-
version: 1.
|
166
|
+
version: 1.37.1
|
139
167
|
description: ezCater custom cops and shared configuration
|
140
168
|
email:
|
141
169
|
- engineering@ezcater.com
|
@@ -169,7 +197,6 @@ files:
|
|
169
197
|
- lib/rubocop/cop/ezcater/rspec_require_browser_mock.rb
|
170
198
|
- lib/rubocop/cop/ezcater/rspec_require_feature_flag_mock.rb
|
171
199
|
- lib/rubocop/cop/ezcater/rspec_require_http_status_matcher.rb
|
172
|
-
- lib/rubocop/cop/ezcater/ruby_timeout.rb
|
173
200
|
- lib/rubocop/cop/ezcater/style_dig.rb
|
174
201
|
- lib/rubocop/rspec/language/each_selector.rb
|
175
202
|
homepage: https://github.com/ezcater/ezcater_rubocop
|
@@ -188,11 +215,11 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
188
215
|
version: '0'
|
189
216
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
190
217
|
requirements:
|
191
|
-
- - "
|
218
|
+
- - ">"
|
192
219
|
- !ruby/object:Gem::Version
|
193
|
-
version:
|
220
|
+
version: 1.3.1
|
194
221
|
requirements: []
|
195
|
-
rubygems_version: 3.0.
|
222
|
+
rubygems_version: 3.0.6
|
196
223
|
signing_key:
|
197
224
|
specification_version: 4
|
198
225
|
summary: ezCater custom cops and shared configuration
|
@@ -1,39 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module Cop
|
5
|
-
module Ezcater
|
6
|
-
# Don't use Timeout.timeout because it can cause transient errors
|
7
|
-
#
|
8
|
-
# @example
|
9
|
-
# # bad
|
10
|
-
# Timeout.timeout(5) do
|
11
|
-
# ...
|
12
|
-
# end
|
13
|
-
#
|
14
|
-
# # good
|
15
|
-
# expiry_time = Time.current + 5.seconds
|
16
|
-
# while Time.current < expiry_time
|
17
|
-
# ...
|
18
|
-
# end
|
19
|
-
#
|
20
|
-
class RubyTimeout < Cop
|
21
|
-
MSG = <<~END_MESSAGE.split("\n").join(" ")
|
22
|
-
`Timeout.timeout` is unsafe. Find an alternative to achieve the same goal.
|
23
|
-
Ex. Use the timeout capabilities of a networking library.
|
24
|
-
Ex. Iterate and check runtime after each iteration.
|
25
|
-
END_MESSAGE
|
26
|
-
|
27
|
-
def_node_matcher "timeout", <<-PATTERN
|
28
|
-
(send (const _ :Timeout) :timeout ...)
|
29
|
-
PATTERN
|
30
|
-
|
31
|
-
def on_send(node)
|
32
|
-
timeout(node) do
|
33
|
-
add_offense(node, location: :expression, message: MSG)
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|