rubocop-factory_bot 2.22.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/CHANGELOG.md +69 -0
- data/CODE_OF_CONDUCT.md +17 -0
- data/MIT-LICENSE.md +21 -0
- data/README.md +88 -0
- data/config/default.yml +75 -0
- data/lib/rubocop/cop/factory_bot/attribute_defined_statically.rb +126 -0
- data/lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb +115 -0
- data/lib/rubocop/cop/factory_bot/create_list.rb +258 -0
- data/lib/rubocop/cop/factory_bot/factory_class_name.rb +54 -0
- data/lib/rubocop/cop/factory_bot/factory_name_style.rb +72 -0
- data/lib/rubocop/cop/factory_bot/syntax_methods.rb +119 -0
- data/lib/rubocop/cop/factory_bot_cops.rb +8 -0
- data/lib/rubocop/factory_bot/config_formatter.rb +55 -0
- data/lib/rubocop/factory_bot/description_extractor.rb +70 -0
- data/lib/rubocop/factory_bot/factory_bot.rb +62 -0
- data/lib/rubocop/factory_bot/language.rb +35 -0
- data/lib/rubocop/factory_bot/version.rb +10 -0
- data/lib/rubocop-factory_bot.rb +16 -0
- metadata +85 -0
@@ -0,0 +1,35 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module RuboCop
|
4
|
+
module FactoryBot
|
5
|
+
# Contains node matchers for common FactoryBot DSL.
|
6
|
+
module Language
|
7
|
+
extend RuboCop::NodePattern::Macros
|
8
|
+
|
9
|
+
METHODS = %i[
|
10
|
+
attributes_for
|
11
|
+
attributes_for_list
|
12
|
+
attributes_for_pair
|
13
|
+
build
|
14
|
+
build_list
|
15
|
+
build_pair
|
16
|
+
build_stubbed
|
17
|
+
build_stubbed_list
|
18
|
+
build_stubbed_pair
|
19
|
+
create
|
20
|
+
create_list
|
21
|
+
create_pair
|
22
|
+
generate
|
23
|
+
generate_list
|
24
|
+
null
|
25
|
+
null_list
|
26
|
+
null_pair
|
27
|
+
].to_set.freeze
|
28
|
+
|
29
|
+
# @!method factory_bot?(node)
|
30
|
+
def_node_matcher :factory_bot?, <<~PATTERN
|
31
|
+
(const {nil? cbase} {:FactoryGirl :FactoryBot})
|
32
|
+
PATTERN
|
33
|
+
end
|
34
|
+
end
|
35
|
+
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'pathname'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
require 'rubocop'
|
7
|
+
|
8
|
+
require_relative 'rubocop/factory_bot/factory_bot'
|
9
|
+
require_relative 'rubocop/factory_bot/language'
|
10
|
+
|
11
|
+
require_relative 'rubocop/cop/factory_bot_cops'
|
12
|
+
|
13
|
+
project_root = File.join(__dir__, '..')
|
14
|
+
RuboCop::ConfigLoader.inject_defaults!(project_root)
|
15
|
+
obsoletion = File.join(project_root, 'config', 'obsoletion.yml')
|
16
|
+
RuboCop::ConfigObsoletion.files << obsoletion if File.exist?(obsoletion)
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: rubocop-factory_bot
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 2.22.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- John Backus
|
8
|
+
- Ian MacLeod
|
9
|
+
- Phil Pirozhkov
|
10
|
+
- Maxim Krizhanovsky
|
11
|
+
- Andrew Bromwich
|
12
|
+
autorequire:
|
13
|
+
bindir: bin
|
14
|
+
cert_chain: []
|
15
|
+
date: 2023-05-05 00:00:00.000000000 Z
|
16
|
+
dependencies:
|
17
|
+
- !ruby/object:Gem::Dependency
|
18
|
+
name: rubocop
|
19
|
+
requirement: !ruby/object:Gem::Requirement
|
20
|
+
requirements:
|
21
|
+
- - "~>"
|
22
|
+
- !ruby/object:Gem::Version
|
23
|
+
version: '1.33'
|
24
|
+
type: :runtime
|
25
|
+
prerelease: false
|
26
|
+
version_requirements: !ruby/object:Gem::Requirement
|
27
|
+
requirements:
|
28
|
+
- - "~>"
|
29
|
+
- !ruby/object:Gem::Version
|
30
|
+
version: '1.33'
|
31
|
+
description: |2
|
32
|
+
Code style checking for FactoryBot files.
|
33
|
+
A plugin for the RuboCop code style enforcing & linting tool.
|
34
|
+
email:
|
35
|
+
executables: []
|
36
|
+
extensions: []
|
37
|
+
extra_rdoc_files:
|
38
|
+
- MIT-LICENSE.md
|
39
|
+
- README.md
|
40
|
+
files:
|
41
|
+
- CHANGELOG.md
|
42
|
+
- CODE_OF_CONDUCT.md
|
43
|
+
- MIT-LICENSE.md
|
44
|
+
- README.md
|
45
|
+
- config/default.yml
|
46
|
+
- lib/rubocop-factory_bot.rb
|
47
|
+
- lib/rubocop/cop/factory_bot/attribute_defined_statically.rb
|
48
|
+
- lib/rubocop/cop/factory_bot/consistent_parentheses_style.rb
|
49
|
+
- lib/rubocop/cop/factory_bot/create_list.rb
|
50
|
+
- lib/rubocop/cop/factory_bot/factory_class_name.rb
|
51
|
+
- lib/rubocop/cop/factory_bot/factory_name_style.rb
|
52
|
+
- lib/rubocop/cop/factory_bot/syntax_methods.rb
|
53
|
+
- lib/rubocop/cop/factory_bot_cops.rb
|
54
|
+
- lib/rubocop/factory_bot/config_formatter.rb
|
55
|
+
- lib/rubocop/factory_bot/description_extractor.rb
|
56
|
+
- lib/rubocop/factory_bot/factory_bot.rb
|
57
|
+
- lib/rubocop/factory_bot/language.rb
|
58
|
+
- lib/rubocop/factory_bot/version.rb
|
59
|
+
homepage: https://github.com/rubocop/rubocop-factory_bot
|
60
|
+
licenses:
|
61
|
+
- MIT
|
62
|
+
metadata:
|
63
|
+
changelog_uri: https://github.com/rubocop/rubocop-factory_bot/blob/master/CHANGELOG.md
|
64
|
+
documentation_uri: https://docs.rubocop.org/rubocop-factory_bot/
|
65
|
+
rubygems_mfa_required: 'true'
|
66
|
+
post_install_message:
|
67
|
+
rdoc_options: []
|
68
|
+
require_paths:
|
69
|
+
- lib
|
70
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
71
|
+
requirements:
|
72
|
+
- - ">="
|
73
|
+
- !ruby/object:Gem::Version
|
74
|
+
version: 2.7.0
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
requirements:
|
77
|
+
- - ">="
|
78
|
+
- !ruby/object:Gem::Version
|
79
|
+
version: '0'
|
80
|
+
requirements: []
|
81
|
+
rubygems_version: 3.3.3
|
82
|
+
signing_key:
|
83
|
+
specification_version: 4
|
84
|
+
summary: Code style checking for FactoryBot files
|
85
|
+
test_files: []
|