rubocop-factory_bot 2.26.1 → 2.27.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/CHANGELOG.md +6 -0
- data/README.md +7 -4
- data/lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb +1 -1
- data/lib/rubocop/factory_bot/plugin.rb +38 -0
- data/lib/rubocop/factory_bot/version.rb +1 -1
- data/lib/rubocop-factory_bot.rb +1 -5
- metadata +27 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8bb85fc163eb8e9fc141bb81dbd7d7c2d0327ec605c4aa4dcc41a1bd4bf0e841
|
4
|
+
data.tar.gz: 45987a7e1a5dc366a0c16ab841a863cc2f7866a9a8cba77e58b2a0924aaddcc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b8ebe6d629b4f2e22a081b095abe1e2e1dc34c032e4be26b9338385e7d37c7097fe85dad3ebb03e1706594becaa680b27b1119fd6e9ab661a96aaa61a9c4cbf3
|
7
|
+
data.tar.gz: b6d6fede91a931b79919d1ae081b848787de025edd2651205d83d3de641e66fe71c417c082cc79307f4661b7065105694facbf3fe0bbfbd6eeb9ba06808f03be
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,11 @@
|
|
2
2
|
|
3
3
|
## Master (Unreleased)
|
4
4
|
|
5
|
+
## 2.27.0 (2025-03-06)
|
6
|
+
|
7
|
+
- Fix a false positive for `FactoryBot/ConsistentParenthesesStyle` when using traits and omitting hash values. ([@thejonroberts])
|
8
|
+
- Make RuboCop FactoryBot work as a RuboCop plugin. ([@bquorning])
|
9
|
+
|
5
10
|
## 2.26.1 (2024-06-12)
|
6
11
|
|
7
12
|
- Bump RuboCop requirement to +1.61. ([@ydah])
|
@@ -110,6 +115,7 @@
|
|
110
115
|
[@seanpdoyle]: https://github.com/seanpdoyle
|
111
116
|
[@tdeo]: https://github.com/tdeo
|
112
117
|
[@tejasbubane]: https://github.com/tejasbubane
|
118
|
+
[@thejonroberts]: https://github.com/thejonroberts
|
113
119
|
[@vzvu3k6k]: https://github.com/vzvu3k6k
|
114
120
|
[@walf443]: https://github.com/walf443
|
115
121
|
[@ybiquitous]: https://github.com/ybiquitous
|
data/README.md
CHANGED
@@ -31,13 +31,13 @@ ways to do this:
|
|
31
31
|
Put this into your `.rubocop.yml`.
|
32
32
|
|
33
33
|
```yaml
|
34
|
-
|
34
|
+
plugins: rubocop-factory_bot
|
35
35
|
```
|
36
36
|
|
37
37
|
Alternatively, use the following array notation when specifying multiple extensions.
|
38
38
|
|
39
39
|
```yaml
|
40
|
-
|
40
|
+
plugins:
|
41
41
|
- rubocop-other-extension
|
42
42
|
- rubocop-factory_bot
|
43
43
|
```
|
@@ -45,17 +45,20 @@ require:
|
|
45
45
|
Now you can run `rubocop` and it will automatically load the RuboCop factory_bot
|
46
46
|
cops together with the standard cops.
|
47
47
|
|
48
|
+
> [!NOTE]
|
49
|
+
> The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
|
50
|
+
|
48
51
|
### Command line
|
49
52
|
|
50
53
|
```bash
|
51
|
-
rubocop --
|
54
|
+
rubocop --plugin rubocop-factory_bot
|
52
55
|
```
|
53
56
|
|
54
57
|
### Rake task
|
55
58
|
|
56
59
|
```ruby
|
57
60
|
RuboCop::RakeTask.new do |task|
|
58
|
-
task.
|
61
|
+
task.plugins << 'rubocop-factory_bot'
|
59
62
|
end
|
60
63
|
```
|
61
64
|
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lint_roller'
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
module FactoryBot
|
7
|
+
# A plugin that integrates RuboCop FactoryBot with RuboCop's plugin system.
|
8
|
+
class Plugin < LintRoller::Plugin
|
9
|
+
# :nocov:
|
10
|
+
def about
|
11
|
+
LintRoller::About.new(
|
12
|
+
name: 'rubocop-factory_bot',
|
13
|
+
version: Version::STRING,
|
14
|
+
homepage: 'https://github.com/rubocop/rubocop-factory_bot',
|
15
|
+
description: 'Code style checking for FactoryBot test files.'
|
16
|
+
)
|
17
|
+
end
|
18
|
+
# :nocov:
|
19
|
+
|
20
|
+
def supported?(context)
|
21
|
+
context.engine == :rubocop
|
22
|
+
end
|
23
|
+
|
24
|
+
def rules(_context)
|
25
|
+
project_root = Pathname.new(__dir__).join('../../..')
|
26
|
+
|
27
|
+
obsoletion = project_root.join('config', 'obsoletion.yml')
|
28
|
+
ConfigObsoletion.files << obsoletion if obsoletion.exist?
|
29
|
+
|
30
|
+
LintRoller::Rules.new(
|
31
|
+
type: :path,
|
32
|
+
config_format: :rubocop,
|
33
|
+
value: project_root.join('config/default.yml')
|
34
|
+
)
|
35
|
+
end
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
data/lib/rubocop-factory_bot.rb
CHANGED
@@ -7,12 +7,8 @@ require 'rubocop'
|
|
7
7
|
|
8
8
|
require_relative 'rubocop/factory_bot/factory_bot'
|
9
9
|
require_relative 'rubocop/factory_bot/language'
|
10
|
+
require_relative 'rubocop/factory_bot/plugin'
|
10
11
|
|
11
12
|
require_relative 'rubocop/cop/factory_bot/mixin/configurable_explicit_only'
|
12
13
|
|
13
14
|
require_relative 'rubocop/cop/factory_bot_cops'
|
14
|
-
|
15
|
-
project_root = File.join(__dir__, '..')
|
16
|
-
RuboCop::ConfigLoader.inject_defaults!(project_root)
|
17
|
-
obsoletion = File.join(project_root, 'config', 'obsoletion.yml')
|
18
|
-
RuboCop::ConfigObsoletion.files << obsoletion if File.exist?(obsoletion)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-factory_bot
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.27.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Backus
|
@@ -9,29 +9,47 @@ authors:
|
|
9
9
|
- Phil Pirozhkov
|
10
10
|
- Maxim Krizhanovsky
|
11
11
|
- Andrew Bromwich
|
12
|
-
autorequire:
|
13
12
|
bindir: bin
|
14
13
|
cert_chain: []
|
15
|
-
date:
|
14
|
+
date: 2025-03-06 00:00:00.000000000 Z
|
16
15
|
dependencies:
|
16
|
+
- !ruby/object:Gem::Dependency
|
17
|
+
name: lint_roller
|
18
|
+
requirement: !ruby/object:Gem::Requirement
|
19
|
+
requirements:
|
20
|
+
- - "~>"
|
21
|
+
- !ruby/object:Gem::Version
|
22
|
+
version: '1.1'
|
23
|
+
type: :runtime
|
24
|
+
prerelease: false
|
25
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
|
+
requirements:
|
27
|
+
- - "~>"
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '1.1'
|
17
30
|
- !ruby/object:Gem::Dependency
|
18
31
|
name: rubocop
|
19
32
|
requirement: !ruby/object:Gem::Requirement
|
20
33
|
requirements:
|
21
34
|
- - "~>"
|
22
35
|
- !ruby/object:Gem::Version
|
23
|
-
version: '1.
|
36
|
+
version: '1.72'
|
37
|
+
- - ">="
|
38
|
+
- !ruby/object:Gem::Version
|
39
|
+
version: 1.72.1
|
24
40
|
type: :runtime
|
25
41
|
prerelease: false
|
26
42
|
version_requirements: !ruby/object:Gem::Requirement
|
27
43
|
requirements:
|
28
44
|
- - "~>"
|
29
45
|
- !ruby/object:Gem::Version
|
30
|
-
version: '1.
|
46
|
+
version: '1.72'
|
47
|
+
- - ">="
|
48
|
+
- !ruby/object:Gem::Version
|
49
|
+
version: 1.72.1
|
31
50
|
description: |
|
32
51
|
Code style checking for factory_bot files.
|
33
52
|
A plugin for the RuboCop code style enforcing & linting tool.
|
34
|
-
email:
|
35
53
|
executables: []
|
36
54
|
extensions: []
|
37
55
|
extra_rdoc_files:
|
@@ -62,6 +80,7 @@ files:
|
|
62
80
|
- lib/rubocop/factory_bot/description_extractor.rb
|
63
81
|
- lib/rubocop/factory_bot/factory_bot.rb
|
64
82
|
- lib/rubocop/factory_bot/language.rb
|
83
|
+
- lib/rubocop/factory_bot/plugin.rb
|
65
84
|
- lib/rubocop/factory_bot/version.rb
|
66
85
|
homepage: https://github.com/rubocop/rubocop-factory_bot
|
67
86
|
licenses:
|
@@ -70,7 +89,7 @@ metadata:
|
|
70
89
|
changelog_uri: https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md
|
71
90
|
documentation_uri: https://docs.rubocop.org/rubocop-factory_bot/
|
72
91
|
rubygems_mfa_required: 'true'
|
73
|
-
|
92
|
+
default_lint_roller_plugin: RuboCop::FactoryBot::Plugin
|
74
93
|
rdoc_options: []
|
75
94
|
require_paths:
|
76
95
|
- lib
|
@@ -85,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
85
104
|
- !ruby/object:Gem::Version
|
86
105
|
version: '0'
|
87
106
|
requirements: []
|
88
|
-
rubygems_version: 3.
|
89
|
-
signing_key:
|
107
|
+
rubygems_version: 3.6.2
|
90
108
|
specification_version: 4
|
91
109
|
summary: Code style checking for factory_bot files
|
92
110
|
test_files: []
|