rubocop-zuno 3.7.0 → 4.0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abeffc4f1ebb6d9b00823168fc7f249b7c3a6a3d3b3b9396c1563702d2f807d7
4
- data.tar.gz: ba21fcf47c8a865f8c09a5900924cde984216cfb06f75bf646084e630de1beeb
3
+ metadata.gz: c1e3ebc0f9cc20ba64a567f51be91f58526da27ea646a81de15508dfd5fa1dd1
4
+ data.tar.gz: fc0694c79dfd2641c671d73a2bec3f0df5117e6c45b11bed4d80b09d73e99ca3
5
5
  SHA512:
6
- metadata.gz: 1b2188b5d86409077d9735eb1a812d701e47eef1ae5f334ad1722c7b6cda36ab16573b17f0ab68bffd6ecf6a745882c19d8cf1fc9b07e1f519d6bba6d7f40710
7
- data.tar.gz: 571d4ccdf9d83e5b51d15f492314148eca9e123d8c5a36a3c16d741f365855e6b755b2bffa3ddaaa94c5df57fd1e77e5a1aa0c3c21fd8c340f21634a3552a8a1
6
+ metadata.gz: d6993828c2a427e789769932d023f8b205602c95ab62e0ceb89c2e2ab1e26d019c17c39abc008b6ee73c6ba914cfa0b425f215db45483067391cbf6e24b5c0ab
7
+ data.tar.gz: 20192b8523c440f61c1626efd71de74277199224dd920ff6d34d840ffa8533f26d91d02a103ac7fa862d784340d2d99157166cdbf2f1875129e610a23ac72b4e
data/README.md CHANGED
@@ -7,7 +7,7 @@ Base [Rubocop](https://rubocop.org) settings for all Zuno Ruby projects.
7
7
 
8
8
  ## Requirements
9
9
 
10
- - Ruby >= 3.0
10
+ - Ruby >= 3.2
11
11
 
12
12
  ## Installation
13
13
 
@@ -31,7 +31,7 @@ bundle
31
31
  Put this into your .rubocop.yml.
32
32
 
33
33
  ```yml
34
- require:
34
+ plugins:
35
35
  - rubocop-zuno
36
36
  ```
37
37
 
@@ -73,19 +73,20 @@ The following Rubocop gems are also installed with this gem:
73
73
  - [rubocop-rake](https://github.com/rubocop-hq/rubocop-rake)
74
74
  - [rubocop-rspec](https://github.com/rubocop-hq/rubocop-rspec)
75
75
 
76
- To enable these add the following to your `.rubocop.yml` file.
76
+ `rubocop-rails` and `rubocop-rspec` are loaded automatically when you inherit `rails.yml` or `rspec.yml` from this gem.
77
+
78
+ If you want to use cops from `rubocop-faker` or `rubocop-factory_bot`, add the relevant plugin to your `.rubocop.yml` file.
77
79
 
78
80
  ```yml
81
+ plugins:
82
+ - rubocop-zuno
83
+ - rubocop-faker # if your project uses the Faker gem
84
+ - rubocop-factory_bot # if your project uses FactoryBot
85
+
79
86
  inherit_gem:
80
87
  rubocop-zuno:
81
- # .... add cops
82
-
83
- require:
84
- - rubocop-faker # if your project is using the Faker gem then add this
85
- - rubocop-performance # Add this for performance cops
86
- - rubocop-rails # if your project is a Rails app/engine then add this, plus the - rails.yml setting above
87
- - rubocop-rake # if your project is using rake then add this
88
- - rubocop-rspec # if your project is using rspec then add this, plus the - rspec.yml setting above
88
+ - rails.yml # if your project is a Rails app or engine
89
+ - rspec.yml # if your project uses RSpec
89
90
  ```
90
91
 
91
92
  ## Editor Plugins
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.7.0
1
+ 4.0.0
data/config/default.yml CHANGED
@@ -1,3 +1,7 @@
1
+ plugins:
2
+ - rubocop-performance
3
+ - rubocop-rake
4
+
1
5
  AllCops:
2
6
  Exclude:
3
7
  - "**/*/schema.rb"
@@ -0,0 +1,31 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "lint_roller"
4
+
5
+ module RuboCop
6
+ module Zuno
7
+ # A plugin that integrates RuboCop Zuno with RuboCop's plugin system.
8
+ class Plugin < LintRoller::Plugin
9
+ def about
10
+ LintRoller::About.new(
11
+ name: "rubocop-zuno",
12
+ version: RuboCop::Zuno::VERSION,
13
+ homepage: "https://github.com/zuno-tech/rubocop-zuno",
14
+ description: "Base RuboCop settings for all Zuno Ruby projects"
15
+ )
16
+ end
17
+
18
+ def supported?(context)
19
+ context.engine == :rubocop
20
+ end
21
+
22
+ def rules(_context)
23
+ LintRoller::Rules.new(
24
+ type: :path,
25
+ config_format: :rubocop,
26
+ value: CONFIG_DEFAULT
27
+ )
28
+ end
29
+ end
30
+ end
31
+ end
data/lib/rubocop-zuno.rb CHANGED
@@ -4,8 +4,6 @@ require "rubocop"
4
4
 
5
5
  require_relative "rubocop/zuno"
6
6
  require_relative "rubocop/zuno/version"
7
- require_relative "rubocop/zuno/inject"
8
-
9
- RuboCop::Zuno::Inject.defaults!
7
+ require_relative "rubocop/zuno/plugin"
10
8
 
11
9
  require_relative "rubocop/cop/zuno_cops"
data/rails.yml CHANGED
@@ -1,3 +1,6 @@
1
+ plugins:
2
+ - rubocop-rails
3
+
1
4
  Rails/ApplicationController:
2
5
  Exclude:
3
6
  - spec/**/*
data/rspec.yml CHANGED
@@ -1,3 +1,7 @@
1
+ plugins:
2
+ - rubocop-rspec
3
+ - rubocop-rspec_rails
4
+
1
5
  # Excluding as we set up the rake specs as 'describe "rake namespace:task", type: :task do' which determines what task
2
6
  # is being tested, and this cop doesn't like having a describe block without a class or module name.
3
7
  RSpec/DescribeClass:
@@ -8,15 +12,18 @@ RSpec/DescribeClass:
8
12
  RSpec/DescribedClassModuleWrapping:
9
13
  Enabled: true
10
14
 
11
- # This is to prevent Rubocop from bugging on a spec helper that doesn't contain an example, which the support ones don't
12
- RSpec/LeadingSubject:
13
- Exclude:
14
- - spec/support
15
-
16
15
  # Allow arrays, hashes, and method calls to be counted as one line in examples
17
16
  RSpec/ExampleLength:
18
17
  CountAsOne: ["array", "hash", "method_call"]
19
18
 
19
+ # Multi-line examples must have a description
20
+ RSpec/ExampleWithoutDescription:
21
+ EnforcedStyle: single_line_only
22
+
23
+ # This is to prevent Rubocop from bugging on a spec helper that doesn't contain an example, which the support ones don't
24
+ RSpec/LeadingSubject:
25
+ Exclude:
26
+ - spec/support
20
27
  # Because 5 is a bit mean
21
28
  RSpec/MultipleMemoizedHelpers:
22
29
  Max: 10
@@ -24,7 +31,3 @@ RSpec/MultipleMemoizedHelpers:
24
31
  # Allow there to be a max of 4 example groups deep in Rspec tests
25
32
  RSpec/NestedGroups:
26
33
  Max: 4
27
-
28
- # Multi-line examples must have a description
29
- RSpec/ExampleWithoutDescription:
30
- EnforcedStyle: single_line_only
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-zuno
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.0
4
+ version: 4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zuno
@@ -9,20 +9,34 @@ bindir: bin
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: lint_roller
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '1.1'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '1.1'
12
26
  - !ruby/object:Gem::Dependency
13
27
  name: rubocop
14
28
  requirement: !ruby/object:Gem::Requirement
15
29
  requirements:
16
30
  - - '='
17
31
  - !ruby/object:Gem::Version
18
- version: 1.86.0
32
+ version: 1.86.1
19
33
  type: :runtime
20
34
  prerelease: false
21
35
  version_requirements: !ruby/object:Gem::Requirement
22
36
  requirements:
23
37
  - - '='
24
38
  - !ruby/object:Gem::Version
25
- version: 1.86.0
39
+ version: 1.86.1
26
40
  - !ruby/object:Gem::Dependency
27
41
  name: rubocop-factory_bot
28
42
  requirement: !ruby/object:Gem::Requirement
@@ -138,7 +152,7 @@ files:
138
152
  - lib/rubocop/cop/zuno/api_type_parameters.rb
139
153
  - lib/rubocop/cop/zuno_cops.rb
140
154
  - lib/rubocop/zuno.rb
141
- - lib/rubocop/zuno/inject.rb
155
+ - lib/rubocop/zuno/plugin.rb
142
156
  - lib/rubocop/zuno/version.rb
143
157
  - rails.yml
144
158
  - rspec.yml
@@ -146,6 +160,7 @@ homepage: https://github.com/zuno-tech/rubocop-zuno
146
160
  licenses:
147
161
  - MIT
148
162
  metadata:
163
+ default_lint_roller_plugin: RuboCop::Zuno::Plugin
149
164
  rubygems_mfa_required: 'true'
150
165
  rdoc_options: []
151
166
  require_paths:
@@ -1,25 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # The original code is from https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop/rspec/inject.rb
4
- # See https://github.com/rubocop/rubocop-rspec/blob/master/MIT-LICENSE.md
5
- module RuboCop
6
- module Zuno
7
- # Because RuboCop doesn't yet support plugins, we have to monkey patch in a
8
- # bit of our configuration.
9
- module Inject
10
- def self.defaults!
11
- path = CONFIG_DEFAULT.to_s
12
- hash = ConfigLoader.send(:load_yaml_configuration, path)
13
- config = Config.new(hash, path).tap(&:make_excludes_absolute)
14
-
15
- # Using Rails.logger here will cause an error.
16
- # See https://github.com/zuno-tech/rubocop-zuno/pull/187
17
- # rubocop:disable Rails/Output
18
- puts "configuration from #{path}" if ConfigLoader.debug?
19
- # rubocop:enable Rails/Output
20
- config = ConfigLoader.merge_with_default(config, path)
21
- ConfigLoader.instance_variable_set(:@default_configuration, config)
22
- end
23
- end
24
- end
25
- end