ezcater_rubocop 8.1.0 → 10.1.0
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/.github/workflows/release.yml +23 -0
- data/CHANGELOG.md +13 -1
- data/Gemfile.lock +14 -10
- data/README.md +2 -1
- data/conf/rubocop.yml +4 -1
- data/config/default.yml +6 -0
- data/ezcater_rubocop.gemspec +2 -2
- data/lib/ezcater_rubocop/version.rb +1 -1
- data/lib/ezcater_rubocop.rb +1 -0
- data/lib/rubocop/cop/ezcater/rspec_no_resolve_class_field.rb +38 -0
- metadata +13 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 71c0339727c6e2f10a7feb608f5ddeeb1a6c1300fd10e2bffac5f930c60c1f16
|
4
|
+
data.tar.gz: 9493e102e561b4421bdf0251c2ea94340b29f663eec2b472c71de7f7945c1cad
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7f499de02f76fe35e019a2e1a7d417ecdbb52c5ae91ea947d3771870d7af3df5b4aefe107e52567101cf6cb6c8f36633e016951eca235320551430f2d37b0d94
|
7
|
+
data.tar.gz: b2d058f36bbabbff2658cbba0ec6a586c45c9fa5ac4ef80f898de8688353bd791a655cbb6014dce474ee47ca198fa1c3c885f2ae5d3b8acb464ffb51eb02ddd2
|
@@ -0,0 +1,23 @@
|
|
1
|
+
name: Release Gem
|
2
|
+
on: workflow_dispatch
|
3
|
+
|
4
|
+
jobs:
|
5
|
+
push:
|
6
|
+
name: Push gem to RubyGems.org
|
7
|
+
runs-on: ubuntu-latest
|
8
|
+
|
9
|
+
permissions:
|
10
|
+
id-token: write # IMPORTANT: this permission is mandatory for trusted publishing
|
11
|
+
contents: write # IMPORTANT: this permission is required for `rake release` to push the release tag
|
12
|
+
|
13
|
+
steps:
|
14
|
+
# Set up
|
15
|
+
- uses: actions/checkout@v4
|
16
|
+
- name: Set up Ruby
|
17
|
+
uses: ruby/setup-ruby@v1
|
18
|
+
with:
|
19
|
+
bundler-cache: true
|
20
|
+
ruby-version: ruby
|
21
|
+
|
22
|
+
# Release
|
23
|
+
- uses: rubygems/release-gem@v1
|
data/CHANGELOG.md
CHANGED
@@ -6,7 +6,19 @@ 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
|
-
##
|
9
|
+
## 10.1.0 (September 23, 2025)
|
10
|
+
|
11
|
+
- Update deprecated syntax `max` to `exclude_limit` for the `MultipleExpectations` rule.
|
12
|
+
|
13
|
+
## 10.0.0 (August 20, 2025)
|
14
|
+
|
15
|
+
- Add `Ezcater/RspecNoResolveClassField` cop, which prevents using the deprecated GraphQL testing interface `resolve_class_field`.
|
16
|
+
|
17
|
+
## 9.0.0 (February 24, 2025)
|
18
|
+
|
19
|
+
- Add support for `plugin` architecture in `rubocop >= 1.72.0` and `rubocop-rails >= 2.28.0`
|
20
|
+
|
21
|
+
## 8.1.0 (February 20, 2025)
|
10
22
|
|
11
23
|
- Pin maximum versions of `rubocop` and `rubocop-rails` to the versions before they moved to the `plugin` architecture in 1.72 and 2.28, respectively
|
12
24
|
|
data/Gemfile.lock
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
ezcater_rubocop (
|
4
|
+
ezcater_rubocop (10.1.0)
|
5
5
|
parser (>= 2.6)
|
6
|
-
rubocop (>= 1.
|
6
|
+
rubocop (>= 1.72.0, < 2.0)
|
7
7
|
rubocop-graphql (>= 0.14.0, < 1.0)
|
8
|
-
rubocop-rails (>= 2.
|
8
|
+
rubocop-rails (>= 2.28.0, < 3.0)
|
9
9
|
rubocop-rspec (>= 2.22.0, < 2.28.0)
|
10
10
|
|
11
11
|
GEM
|
@@ -36,8 +36,9 @@ GEM
|
|
36
36
|
drb (2.2.1)
|
37
37
|
i18n (1.14.7)
|
38
38
|
concurrent-ruby (~> 1.0)
|
39
|
-
json (2.10.
|
39
|
+
json (2.10.2)
|
40
40
|
language_server-protocol (3.17.0.4)
|
41
|
+
lint_roller (1.1.0)
|
41
42
|
logger (1.6.6)
|
42
43
|
method_source (1.1.0)
|
43
44
|
minitest (5.25.4)
|
@@ -52,7 +53,7 @@ GEM
|
|
52
53
|
byebug (~> 11.0)
|
53
54
|
pry (>= 0.13, < 0.15)
|
54
55
|
racc (1.8.1)
|
55
|
-
rack (3.1.
|
56
|
+
rack (3.1.16)
|
56
57
|
rainbow (3.1.1)
|
57
58
|
rake (13.2.1)
|
58
59
|
regexp_parser (2.10.0)
|
@@ -71,9 +72,10 @@ GEM
|
|
71
72
|
rspec-support (3.13.2)
|
72
73
|
rspec_junit_formatter (0.6.0)
|
73
74
|
rspec-core (>= 2, < 4, != 2.12.0)
|
74
|
-
rubocop (1.
|
75
|
+
rubocop (1.72.2)
|
75
76
|
json (~> 2.3)
|
76
|
-
language_server-protocol (
|
77
|
+
language_server-protocol (~> 3.17.0.2)
|
78
|
+
lint_roller (~> 1.1.0)
|
77
79
|
parallel (~> 1.10)
|
78
80
|
parser (>= 3.3.0.2)
|
79
81
|
rainbow (>= 2.2.2, < 4.0)
|
@@ -89,11 +91,12 @@ GEM
|
|
89
91
|
rubocop (~> 1.61)
|
90
92
|
rubocop-graphql (0.19.0)
|
91
93
|
rubocop (>= 0.87, < 2)
|
92
|
-
rubocop-rails (2.
|
94
|
+
rubocop-rails (2.30.2)
|
93
95
|
activesupport (>= 4.2.0)
|
96
|
+
lint_roller (~> 1.1)
|
94
97
|
rack (>= 1.1)
|
95
|
-
rubocop (>= 1.
|
96
|
-
rubocop-ast (>= 1.
|
98
|
+
rubocop (>= 1.72.1, < 2.0)
|
99
|
+
rubocop-ast (>= 1.38.0, < 2.0)
|
97
100
|
rubocop-rspec (2.27.1)
|
98
101
|
rubocop (~> 1.40)
|
99
102
|
rubocop-capybara (~> 2.17)
|
@@ -114,6 +117,7 @@ GEM
|
|
114
117
|
|
115
118
|
PLATFORMS
|
116
119
|
arm64-darwin-24
|
120
|
+
x86_64-linux
|
117
121
|
|
118
122
|
DEPENDENCIES
|
119
123
|
bundler
|
data/README.md
CHANGED
@@ -92,6 +92,7 @@ not add cops with `enabled: false` unless you want that cop to always be disable
|
|
92
92
|
* [RequireGqlErrorHelpers](https://github.com/ezcater/ezcater_rubocop/blob/main/lib/rubocop/cop/ezcater/require_gql_error_helpers.rb) - Use the helpers provided by `GQLErrors` instead of raising `GraphQL::ExecutionError` directly.
|
93
93
|
* [RspecDotNotSelfDot](https://github.com/ezcater/ezcater_rubocop/blob/main/lib/rubocop/cop/ezcater/rspec_dot_not_self_dot.rb) - Enforce ".<class method>" instead of "self.<class method>" and "::<class method>" for example group description.
|
94
94
|
* [RspecMatchOrderedArray](https://github.com/ezcater/ezcater_rubocop/blob/main/lib/rubocop/cop/ezcater/rspec_match_ordered_array.rb) - Enforce use of `match_ordered_array` matcher instead of `eq` matcher. This matcher comes from the [ezcater_matchers](https://github.com/ezcater/ezcater_matchers) gem.
|
95
|
+
* [RspecNoResolveClassField](https://github.com/ezcater/ezcater_rubocop/blob/main/lib/rubocop/cop/ezcater/rspec_no_resolve_class_field.rb) - Do not use deprecated GraphQL testing interface `resolve_class_field`.
|
95
96
|
* [RspecRequireBrowserMock](https://github.com/ezcater/ezcater_rubocop/blob/main/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.
|
96
97
|
* [RspecRequireFeatureFlagMock](https://github.com/ezcater/ezcater_rubocop/blob/main/lib/rubocop/cop/ezcater/rspec_require_feature_flag_mock.rb) - Enforce use of `mock_feature_flag` helper instead of mocking `FeatureFlag.is_active?` directly.
|
97
98
|
* [RspecRequireHttpStatusMatcher](https://github.com/ezcater/ezcater_rubocop/blob/main/lib/rubocop/cop/ezcater/rspec_require_http_status_matcher.rb) - Use the HTTP status code matcher, like `expect(response).to have_http_status :bad_request`, rather than `expect(response.code).to eq 400`
|
@@ -108,7 +109,7 @@ To install this gem onto your local machine, run `bundle exec rake install`.
|
|
108
109
|
|
109
110
|
### Releasing a New Version
|
110
111
|
|
111
|
-
To release a new version, update the version number in `version.rb`, merge your PR to `main`, and then run
|
112
|
+
To release a new version, update the version number in `version.rb`, merge your PR to `main`, and then manually run the "Release Gem" GitHub Action, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
112
113
|
|
113
114
|
## Contributing
|
114
115
|
|
data/conf/rubocop.yml
CHANGED
@@ -1,5 +1,8 @@
|
|
1
1
|
require: ezcater_rubocop
|
2
2
|
|
3
|
+
plugins:
|
4
|
+
- rubocop-rails
|
5
|
+
|
3
6
|
AllCops:
|
4
7
|
DisplayCopNames: true
|
5
8
|
NewCops: disable
|
@@ -82,7 +85,7 @@ RSpec/MessageExpectation:
|
|
82
85
|
EnforcedStyle: allow
|
83
86
|
|
84
87
|
RSpec/MultipleExpectations:
|
85
|
-
|
88
|
+
exclude_limit: 5
|
86
89
|
|
87
90
|
RSpec/NestedGroups:
|
88
91
|
Max: 5
|
data/config/default.yml
CHANGED
@@ -75,6 +75,12 @@ GraphQL/ExtractInputType:
|
|
75
75
|
Exclude:
|
76
76
|
- "**/input_objects/**/*.rb"
|
77
77
|
|
78
|
+
Ezcater/RspecNoResolveClassField:
|
79
|
+
Description: "Do not use `resolve_class_field` in spec files."
|
80
|
+
Enabled: true
|
81
|
+
Include:
|
82
|
+
- "**/*_spec.rb"
|
83
|
+
|
78
84
|
Ezcater/Migration/BigintForeignKey:
|
79
85
|
Description: "Use `bigint` instead of `integer` for all foreign keys."
|
80
86
|
Include:
|
data/ezcater_rubocop.gemspec
CHANGED
@@ -52,8 +52,8 @@ Gem::Specification.new do |spec|
|
|
52
52
|
spec.add_development_dependency "simplecov"
|
53
53
|
|
54
54
|
spec.add_runtime_dependency "parser", ">= 2.6"
|
55
|
-
spec.add_runtime_dependency "rubocop", ">= 1.
|
55
|
+
spec.add_runtime_dependency "rubocop", ">= 1.72.0", "< 2.0"
|
56
56
|
spec.add_runtime_dependency "rubocop-graphql", ">= 0.14.0", "< 1.0"
|
57
|
-
spec.add_runtime_dependency "rubocop-rails", ">= 2.
|
57
|
+
spec.add_runtime_dependency "rubocop-rails", ">= 2.28.0", "< 3.0"
|
58
58
|
spec.add_runtime_dependency "rubocop-rspec", ">= 2.22.0", "< 2.28.0"
|
59
59
|
end
|
data/lib/ezcater_rubocop.rb
CHANGED
@@ -31,5 +31,6 @@ require_relative "rubocop/cop/ezcater/rspec_require_browser_mock"
|
|
31
31
|
require_relative "rubocop/cop/ezcater/rspec_require_feature_flag_mock"
|
32
32
|
require_relative "rubocop/cop/ezcater/rspec_require_http_status_matcher"
|
33
33
|
require_relative "rubocop/cop/ezcater/rspec_dot_not_self_dot"
|
34
|
+
require_relative "rubocop/cop/ezcater/rspec_no_resolve_class_field"
|
34
35
|
require_relative "rubocop/cop/ezcater/style_dig"
|
35
36
|
require_relative "rubocop/cop/ezcater/migration/bigint_foreign_key"
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module Cop
|
5
|
+
module Ezcater
|
6
|
+
# Do not use `resolve_class_field`.
|
7
|
+
#
|
8
|
+
# @example
|
9
|
+
#
|
10
|
+
# # bad
|
11
|
+
# resolve_class_field(:user, :name)
|
12
|
+
# resolve_class_field(:user, [:name])
|
13
|
+
# obj.resolve_class_field(:user, :name)
|
14
|
+
#
|
15
|
+
# # good
|
16
|
+
# execute(EzrailsSchema, query, variables: { id: }, context: graphql_context)
|
17
|
+
#
|
18
|
+
# More information: https://engportal.ezcater.com/docs/default/component/dev-handbook/technology/graphql/backend_implementation/testing/#recommendation
|
19
|
+
#
|
20
|
+
class RspecNoResolveClassField < Base
|
21
|
+
MSG = "Do not use `resolve_class_field`. Use a query instead."
|
22
|
+
|
23
|
+
def_node_matcher :resolve_class_field_call?, <<~PATTERN
|
24
|
+
{
|
25
|
+
(send nil? :resolve_class_field ...)
|
26
|
+
(send _ :resolve_class_field ...)
|
27
|
+
}
|
28
|
+
PATTERN
|
29
|
+
|
30
|
+
def on_send(node)
|
31
|
+
return unless resolve_class_field_call?(node)
|
32
|
+
|
33
|
+
add_offense(node, message: MSG)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ezcater_rubocop
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 10.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ezCater, Inc
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
12
11
|
dependencies:
|
13
12
|
- !ruby/object:Gem::Dependency
|
14
13
|
name: bundler
|
@@ -114,20 +113,20 @@ dependencies:
|
|
114
113
|
requirements:
|
115
114
|
- - ">="
|
116
115
|
- !ruby/object:Gem::Version
|
117
|
-
version: 1.
|
116
|
+
version: 1.72.0
|
118
117
|
- - "<"
|
119
118
|
- !ruby/object:Gem::Version
|
120
|
-
version:
|
119
|
+
version: '2.0'
|
121
120
|
type: :runtime
|
122
121
|
prerelease: false
|
123
122
|
version_requirements: !ruby/object:Gem::Requirement
|
124
123
|
requirements:
|
125
124
|
- - ">="
|
126
125
|
- !ruby/object:Gem::Version
|
127
|
-
version: 1.
|
126
|
+
version: 1.72.0
|
128
127
|
- - "<"
|
129
128
|
- !ruby/object:Gem::Version
|
130
|
-
version:
|
129
|
+
version: '2.0'
|
131
130
|
- !ruby/object:Gem::Dependency
|
132
131
|
name: rubocop-graphql
|
133
132
|
requirement: !ruby/object:Gem::Requirement
|
@@ -154,20 +153,20 @@ dependencies:
|
|
154
153
|
requirements:
|
155
154
|
- - ">="
|
156
155
|
- !ruby/object:Gem::Version
|
157
|
-
version: 2.
|
156
|
+
version: 2.28.0
|
158
157
|
- - "<"
|
159
158
|
- !ruby/object:Gem::Version
|
160
|
-
version:
|
159
|
+
version: '3.0'
|
161
160
|
type: :runtime
|
162
161
|
prerelease: false
|
163
162
|
version_requirements: !ruby/object:Gem::Requirement
|
164
163
|
requirements:
|
165
164
|
- - ">="
|
166
165
|
- !ruby/object:Gem::Version
|
167
|
-
version: 2.
|
166
|
+
version: 2.28.0
|
168
167
|
- - "<"
|
169
168
|
- !ruby/object:Gem::Version
|
170
|
-
version:
|
169
|
+
version: '3.0'
|
171
170
|
- !ruby/object:Gem::Dependency
|
172
171
|
name: rubocop-rspec
|
173
172
|
requirement: !ruby/object:Gem::Requirement
|
@@ -200,6 +199,7 @@ files:
|
|
200
199
|
- ".github/PULL_REQUEST_TEMPLATE.md"
|
201
200
|
- ".github/workflows/codeql.yml"
|
202
201
|
- ".github/workflows/dependency-review.yml"
|
202
|
+
- ".github/workflows/release.yml"
|
203
203
|
- ".tool-versions"
|
204
204
|
- CHANGELOG.md
|
205
205
|
- Gemfile
|
@@ -227,6 +227,7 @@ files:
|
|
227
227
|
- lib/rubocop/cop/ezcater/require_gql_error_helpers.rb
|
228
228
|
- lib/rubocop/cop/ezcater/rspec_dot_not_self_dot.rb
|
229
229
|
- lib/rubocop/cop/ezcater/rspec_match_ordered_array.rb
|
230
|
+
- lib/rubocop/cop/ezcater/rspec_no_resolve_class_field.rb
|
230
231
|
- lib/rubocop/cop/ezcater/rspec_require_browser_mock.rb
|
231
232
|
- lib/rubocop/cop/ezcater/rspec_require_feature_flag_mock.rb
|
232
233
|
- lib/rubocop/cop/ezcater/rspec_require_http_status_matcher.rb
|
@@ -238,7 +239,6 @@ licenses:
|
|
238
239
|
- MIT
|
239
240
|
metadata:
|
240
241
|
allowed_push_host: https://rubygems.org
|
241
|
-
post_install_message:
|
242
242
|
rdoc_options: []
|
243
243
|
require_paths:
|
244
244
|
- lib
|
@@ -253,8 +253,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
253
253
|
- !ruby/object:Gem::Version
|
254
254
|
version: '0'
|
255
255
|
requirements: []
|
256
|
-
rubygems_version: 3.
|
257
|
-
signing_key:
|
256
|
+
rubygems_version: 3.6.9
|
258
257
|
specification_version: 4
|
259
258
|
summary: ezCater custom cops and shared configuration
|
260
259
|
test_files: []
|