ezcater_rubocop 0.49.4 → 0.49.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -5
- data/README.md +1 -0
- data/config/default.yml +4 -0
- data/lib/ezcater_rubocop.rb +1 -0
- data/lib/ezcater_rubocop/version.rb +1 -1
- data/lib/rubocop/cop/ezcater/rails_configuration.rb +26 -0
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 042fd2cde603837cb71e9828f944affc13c9f899
|
|
4
|
+
data.tar.gz: be970a40f1a3540c909a1ccd30af5dae8b05aee0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 685336eb500893de2e1d0e099dd4283980f1d66edf5df2447e11dc983e57c2f07d561b049653a62334197067aaf3c6f1e5f5f25406ffe695a0ba09ee7f7af461
|
|
7
|
+
data.tar.gz: 1b4f84114d5c91a1e4ed5ec63aaacab85142b528da6f636a25b141d6a4c8ffd9a1b65af0685943ecddc7297b567e5e604aa8845c5a221da53db17e85996adfb1
|
data/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
# ezcater_rubocop
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## v0.49.5
|
|
4
|
+
- Add `Ezcater/RailsConfiguration` cop.
|
|
5
|
+
|
|
6
|
+
## v0.49.4
|
|
4
7
|
- Add `Ezcater/RspecRequireGqlErrorHelpers` cop.
|
|
5
8
|
|
|
6
|
-
|
|
9
|
+
## v0.49.3
|
|
7
10
|
- Do not apply `Ezcater/StyleDig` to access using a range.
|
|
8
11
|
|
|
9
|
-
|
|
12
|
+
## v0.49.2
|
|
10
13
|
- Do not apply `Ezcater/StyleDig` to assignments to with nested access.
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
## v0.49.1
|
|
13
16
|
- Add `Ezcater/RspecRequireBrowserMock` cop.
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
## v0.49.0
|
|
16
19
|
- Initial release.
|
|
17
20
|
- Add `Ezcater/RspecRequireFeatureFlagMock` cop.
|
|
18
21
|
- Add `Ezcater/RspecDotNotSelfDot` cop.
|
data/README.md
CHANGED
|
@@ -47,6 +47,7 @@ the latest compatible version each time that the MAJOR.MINOR version of `rubocop
|
|
|
47
47
|
is updated.
|
|
48
48
|
|
|
49
49
|
## Custom Cops
|
|
50
|
+
1. [RailsConfiguration](https://github.com/ezcater/ezcater_rubocop/blob/master/lib/rubocop/cop/ezcater/rails_configuration.rb) - Enforce use of `Rails.configuration` instead of `Rails.application.config`.
|
|
50
51
|
1. [RspecDotNotSelfDot](https://github.com/ezcater/ezcater_rubocop/blob/master/lib/rubocop/cop/ezcater/rspec_dot_not_self_dot.rb) - Enforce ".<class method>" instead of "self.<class method>" for example group description.
|
|
51
52
|
1. [RspecRequireBrowserMock](https://github.com/ezcater/ezcater_rubocop/blob/master/lib/rubocop/cop/ezcater/rspec_require_browser_mock.rb) - Enforce use of `mock_ezcater_app`, `mock_chrome_browser` & `mock_custom_browser` helpers instead of mocking `Browser` or `EzBrowser` directly.
|
|
52
53
|
1. [RspecRequireFeatureFlagMock](https://github.com/ezcater/ezcater_rubocop/blob/master/lib/rubocop/cop/ezcater/rspec_require_feature_flag_mock.rb) - Enforce use of `mock_feature_flag` helper instead of mocking `FeatureFlag.is_active?` directly.
|
data/config/default.yml
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
Ezcater/RailsConfiguration:
|
|
2
|
+
Description: 'Enforce the use of `Rails.configuration` instead of `Rails.application.config`.'
|
|
3
|
+
Enabled: true
|
|
4
|
+
|
|
1
5
|
Ezcater/RspecDotNotSelfDot:
|
|
2
6
|
Description: 'Enforce ".<class method>" instead of "self.<class method>" for example group description.'
|
|
3
7
|
Enabled: true
|
data/lib/ezcater_rubocop.rb
CHANGED
|
@@ -12,6 +12,7 @@ puts "configuration from #{DEFAULT_FILES}" if RuboCop::ConfigLoader.debug?
|
|
|
12
12
|
config = RuboCop::ConfigLoader.merge_with_default(config, path)
|
|
13
13
|
RuboCop::ConfigLoader.instance_variable_set(:@default_configuration, config)
|
|
14
14
|
|
|
15
|
+
require "rubocop/cop/ezcater/rails_configuration"
|
|
15
16
|
require "rubocop/cop/ezcater/rspec_require_browser_mock"
|
|
16
17
|
require "rubocop/cop/ezcater/rspec_require_feature_flag_mock"
|
|
17
18
|
require "rubocop/cop/ezcater/rspec_require_gql_error_helpers"
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
module RuboCop
|
|
2
|
+
module Cop
|
|
3
|
+
module Ezcater
|
|
4
|
+
class RailsConfiguration < Cop
|
|
5
|
+
MSG = "Use `Rails.configuration` instead of `Rails.application.config`.".freeze
|
|
6
|
+
RAILS_CONFIGURATION = "Rails.configuration".freeze
|
|
7
|
+
|
|
8
|
+
def_node_matcher "rails_application_config", <<-PATTERN
|
|
9
|
+
(send (send (const _ :Rails) :application) :config)
|
|
10
|
+
PATTERN
|
|
11
|
+
|
|
12
|
+
def on_send(node)
|
|
13
|
+
rails_application_config(node) do
|
|
14
|
+
add_offense(node, :expression, MSG)
|
|
15
|
+
end
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def autocorrect(node)
|
|
19
|
+
lambda do |corrector|
|
|
20
|
+
corrector.replace(node.source_range, RAILS_CONFIGURATION)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
end
|
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: 0.49.
|
|
4
|
+
version: 0.49.5
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- ezCater, Inc
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2018-01-
|
|
11
|
+
date: 2018-01-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: bundler
|
|
@@ -133,6 +133,7 @@ files:
|
|
|
133
133
|
- ezcater_rubocop.gemspec
|
|
134
134
|
- lib/ezcater_rubocop.rb
|
|
135
135
|
- lib/ezcater_rubocop/version.rb
|
|
136
|
+
- lib/rubocop/cop/ezcater/rails_configuration.rb
|
|
136
137
|
- lib/rubocop/cop/ezcater/rspec_dot_not_self_dot.rb
|
|
137
138
|
- lib/rubocop/cop/ezcater/rspec_require_browser_mock.rb
|
|
138
139
|
- lib/rubocop/cop/ezcater/rspec_require_feature_flag_mock.rb
|
|
@@ -160,7 +161,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
160
161
|
version: '0'
|
|
161
162
|
requirements: []
|
|
162
163
|
rubyforge_project:
|
|
163
|
-
rubygems_version: 2.
|
|
164
|
+
rubygems_version: 2.6.13
|
|
164
165
|
signing_key:
|
|
165
166
|
specification_version: 4
|
|
166
167
|
summary: ezCater custom cops and shared configuration
|