rubocop-faker 1.2.0 → 1.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rubocop.yml +2 -2
- data/CHANGELOG.md +7 -0
- data/Gemfile +2 -2
- data/README.md +6 -3
- data/lib/rubocop/cop/faker/deprecated_arguments.rb +1 -0
- data/lib/rubocop/faker/plugin.rb +31 -0
- data/lib/rubocop/faker/version.rb +1 -1
- data/lib/rubocop/faker.rb +1 -6
- data/lib/rubocop-faker.rb +1 -4
- data/rubocop-faker.gemspec +4 -2
- metadata +20 -5
- data/lib/rubocop/faker/inject.rb +0 -18
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9411434bc51ae4bd5aeb3ec021d79472ac55c39d8fd96785d46094ada5380049
|
4
|
+
data.tar.gz: a53752635232f959e334ed106edbb0c4b7dcb3f76cc0958c39b2380971fb9388
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7c01bad74e1fb97f64e254d39858289ec5ba710460662d6e06e7e5baac4ff569c9a382ee24c426031489b3a291267c5b7229165f3483c342da274aacf282d02
|
7
|
+
data.tar.gz: 55ab7dad2875123dcdd9d5cd7b6257fc69b3ac11d1739ca91453ec53f7693d66a9a404d896394f15fb308f7c20f91241205e1025c883563a2dff8a61bf2dfa83
|
data/.rubocop.yml
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile
CHANGED
@@ -8,8 +8,8 @@ gemspec
|
|
8
8
|
|
9
9
|
gem 'rake'
|
10
10
|
gem 'rspec'
|
11
|
-
gem 'rubocop', github: 'rubocop
|
12
|
-
gem 'rubocop-performance', '~> 1.
|
11
|
+
gem 'rubocop', github: 'rubocop/rubocop'
|
12
|
+
gem 'rubocop-performance', '~> 1.24.0'
|
13
13
|
# Workaround for YARD 0.9.20 or lower.
|
14
14
|
# It specifies `github` until the release that includes the following changes:
|
15
15
|
# https://github.com/lsegal/yard/pull/1290
|
data/README.md
CHANGED
@@ -48,13 +48,13 @@ This gem offers the only `Faker/DeprecatedArguments` cop. It is intended to conv
|
|
48
48
|
Check positional argument style before Faker 2.
|
49
49
|
|
50
50
|
```console
|
51
|
-
% rubocop --
|
51
|
+
% rubocop --plugin rubocop-faker --only Faker/DeprecatedArguments
|
52
52
|
```
|
53
53
|
|
54
54
|
Auto-correction to keyword argument style on Faker 2.
|
55
55
|
|
56
56
|
```console
|
57
|
-
% rubocop --
|
57
|
+
% rubocop --plugin rubocop-faker --only Faker/DeprecatedArguments --autocorrect
|
58
58
|
```
|
59
59
|
|
60
60
|
### RuboCop configuration file
|
@@ -63,10 +63,13 @@ Add `rubocop-faker` to required extension.
|
|
63
63
|
|
64
64
|
```yaml
|
65
65
|
# .rubocop.yml
|
66
|
-
|
66
|
+
plugins:
|
67
67
|
- rubocop-faker
|
68
68
|
```
|
69
69
|
|
70
|
+
> [!NOTE]
|
71
|
+
> The plugin system is supported in RuboCop 1.72+. In earlier versions, use `require` instead of `plugins`.
|
72
|
+
|
70
73
|
## Contributing
|
71
74
|
|
72
75
|
Bug reports and pull requests are welcome on GitHub at https://github.com/koic/rubocop-faker.
|
@@ -0,0 +1,31 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'lint_roller'
|
4
|
+
|
5
|
+
module RuboCop
|
6
|
+
module Faker
|
7
|
+
# A plugin that integrates RuboCop Faker with RuboCop's plugin system.
|
8
|
+
class Plugin < LintRoller::Plugin
|
9
|
+
def about
|
10
|
+
LintRoller::About.new(
|
11
|
+
name: 'rubocop-faker',
|
12
|
+
version: VERSION,
|
13
|
+
homepage: 'https://github.com/koic/rubocop-faker',
|
14
|
+
description: 'A RuboCop extension for Faker.'
|
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: Pathname.new(__dir__).join('../../../config/default.yml')
|
27
|
+
)
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
data/lib/rubocop/faker.rb
CHANGED
@@ -1,12 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module RuboCop
|
4
|
-
# RuboCop Faker project namespace
|
4
|
+
# RuboCop Faker project namespace.
|
5
5
|
module Faker
|
6
|
-
PROJECT_ROOT = Pathname.new(__dir__).parent.parent.expand_path.freeze
|
7
|
-
CONFIG_DEFAULT = PROJECT_ROOT.join('config', 'default.yml').freeze
|
8
|
-
CONFIG = YAML.safe_load(CONFIG_DEFAULT.read).freeze
|
9
|
-
|
10
|
-
private_constant(:CONFIG_DEFAULT, :PROJECT_ROOT)
|
11
6
|
end
|
12
7
|
end
|
data/lib/rubocop-faker.rb
CHANGED
@@ -4,8 +4,5 @@ require 'rubocop'
|
|
4
4
|
|
5
5
|
require_relative 'rubocop/faker'
|
6
6
|
require_relative 'rubocop/faker/version'
|
7
|
-
require_relative 'rubocop/faker/
|
8
|
-
|
9
|
-
RuboCop::Faker::Inject.defaults!
|
10
|
-
|
7
|
+
require_relative 'rubocop/faker/plugin'
|
11
8
|
require_relative 'rubocop/cop/faker_cops'
|
data/rubocop-faker.gemspec
CHANGED
@@ -16,7 +16,8 @@ Gem::Specification.new do |spec|
|
|
16
16
|
|
17
17
|
spec.metadata = {
|
18
18
|
'homepage_uri' => spec.homepage,
|
19
|
-
'rubygems_mfa_required' => 'true'
|
19
|
+
'rubygems_mfa_required' => 'true',
|
20
|
+
'default_lint_roller_plugin' => 'RuboCop::Faker::Plugin'
|
20
21
|
}
|
21
22
|
|
22
23
|
# Specify which files should be added to the gem when it is released.
|
@@ -29,5 +30,6 @@ Gem::Specification.new do |spec|
|
|
29
30
|
spec.require_paths = ['lib']
|
30
31
|
|
31
32
|
spec.add_dependency 'faker', '>= 2.12.0'
|
32
|
-
spec.add_dependency '
|
33
|
+
spec.add_dependency 'lint_roller', '~> 1.1'
|
34
|
+
spec.add_dependency 'rubocop', '>= 1.72.1'
|
33
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubocop-faker
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Koichi ITO
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faker
|
@@ -24,20 +24,34 @@ dependencies:
|
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: 2.12.0
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: lint_roller
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.1'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.1'
|
27
41
|
- !ruby/object:Gem::Dependency
|
28
42
|
name: rubocop
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
30
44
|
requirements:
|
31
45
|
- - ">="
|
32
46
|
- !ruby/object:Gem::Version
|
33
|
-
version: 1.
|
47
|
+
version: 1.72.1
|
34
48
|
type: :runtime
|
35
49
|
prerelease: false
|
36
50
|
version_requirements: !ruby/object:Gem::Requirement
|
37
51
|
requirements:
|
38
52
|
- - ">="
|
39
53
|
- !ruby/object:Gem::Version
|
40
|
-
version: 1.
|
54
|
+
version: 1.72.1
|
41
55
|
description: A RuboCop extension for Faker.
|
42
56
|
email:
|
43
57
|
- koic.ito@gmail.com
|
@@ -63,7 +77,7 @@ files:
|
|
63
77
|
- lib/rubocop/cop/faker/deprecated_arguments.rb
|
64
78
|
- lib/rubocop/cop/faker_cops.rb
|
65
79
|
- lib/rubocop/faker.rb
|
66
|
-
- lib/rubocop/faker/
|
80
|
+
- lib/rubocop/faker/plugin.rb
|
67
81
|
- lib/rubocop/faker/version.rb
|
68
82
|
- manual/cops.md
|
69
83
|
- manual/cops_faker.md
|
@@ -75,6 +89,7 @@ licenses:
|
|
75
89
|
metadata:
|
76
90
|
homepage_uri: https://github.com/koic/rubocop-faker
|
77
91
|
rubygems_mfa_required: 'true'
|
92
|
+
default_lint_roller_plugin: RuboCop::Faker::Plugin
|
78
93
|
post_install_message:
|
79
94
|
rdoc_options: []
|
80
95
|
require_paths:
|
data/lib/rubocop/faker/inject.rb
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
module RuboCop
|
4
|
-
module Faker
|
5
|
-
# Because RuboCop doesn't yet support plugins, we have to monkey patch in a
|
6
|
-
# bit of our configuration.
|
7
|
-
module Inject
|
8
|
-
def self.defaults!
|
9
|
-
path = CONFIG_DEFAULT.to_s
|
10
|
-
hash = ConfigLoader.send(:load_yaml_configuration, path)
|
11
|
-
config = Config.new(hash, path)
|
12
|
-
puts "configuration from #{path}" if ConfigLoader.debug?
|
13
|
-
config = ConfigLoader.merge_with_default(config, path)
|
14
|
-
ConfigLoader.instance_variable_set(:@default_configuration, config)
|
15
|
-
end
|
16
|
-
end
|
17
|
-
end
|
18
|
-
end
|