standard-rspec 0.2.2 → 0.3.1
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/config/base.yml +411 -153
- data/lib/standard/rspec/plugin.rb +4 -36
- data/lib/standard/rspec/version.rb +1 -1
- data/standard-rspec.gemspec +5 -3
- metadata +39 -12
- data/lib/standard/rspec/load_rubocop_rspec_without_the_monkey_patch.rb +0 -77
@@ -1,4 +1,8 @@
|
|
1
1
|
require "yaml"
|
2
|
+
require "rubocop-rspec"
|
3
|
+
require "rubocop-rspec_rails"
|
4
|
+
require "rubocop-capybara"
|
5
|
+
require "rubocop-factory_bot"
|
2
6
|
|
3
7
|
module Standard
|
4
8
|
module Rspec
|
@@ -17,8 +21,6 @@ module Standard
|
|
17
21
|
end
|
18
22
|
|
19
23
|
def rules(context)
|
20
|
-
trick_rubocop_into_thinking_we_required_rubocop_rspec!
|
21
|
-
|
22
24
|
rules_value = begin
|
23
25
|
YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"), aliases: true)
|
24
26
|
rescue ArgumentError
|
@@ -31,40 +33,6 @@ module Standard
|
|
31
33
|
value: rules_value
|
32
34
|
)
|
33
35
|
end
|
34
|
-
|
35
|
-
private
|
36
|
-
|
37
|
-
# This is not fantastic.
|
38
|
-
#
|
39
|
-
# When you `require "rubocop-rspec"`, it will not only load the cops,
|
40
|
-
# but it will also monkey-patch RuboCop's default_configuration, which is
|
41
|
-
# something that can't be undone for the lifetime of the process.
|
42
|
-
#
|
43
|
-
# See: https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop-rspec.rb#L41
|
44
|
-
#
|
45
|
-
# As an alternative, standard-rspec loads the cops directly, and then
|
46
|
-
# simply tells the RuboCop config loader that it's been loaded. This is
|
47
|
-
# taking advantage of a private API of an `attr_reader` that probably wasn't
|
48
|
-
# meant to be mutated externally, but it's better than the `Inject` monkey
|
49
|
-
# patching that rubocop-rspec does (and many other RuboCop plugins do)
|
50
|
-
def trick_rubocop_into_thinking_we_required_rubocop_rspec!
|
51
|
-
without_warnings do
|
52
|
-
require_relative "load_rubocop_rspec_without_the_monkey_patch"
|
53
|
-
end
|
54
|
-
RuboCop::ConfigLoader.default_configuration.loaded_features.add("rubocop-rspec")
|
55
|
-
end
|
56
|
-
|
57
|
-
# This is also not fantastic, but because loading RuboCop before loading
|
58
|
-
# ActiveSupport will result in RuboCop redefining a number of ActiveSupport
|
59
|
-
# methods like String#blank?, we need to suppress the warnings that are
|
60
|
-
# emitted when we load the cops.
|
61
|
-
def without_warnings(&blk)
|
62
|
-
original_verbose = $VERBOSE
|
63
|
-
$VERBOSE = nil
|
64
|
-
yield
|
65
|
-
ensure
|
66
|
-
$VERBOSE = original_verbose
|
67
|
-
end
|
68
36
|
end
|
69
37
|
end
|
70
38
|
end
|
data/standard-rspec.gemspec
CHANGED
@@ -31,7 +31,9 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
|
32
32
|
spec.require_paths = ["lib"]
|
33
33
|
|
34
|
-
spec.add_dependency "lint_roller", "
|
35
|
-
spec.add_dependency "rubocop-rspec", "~>
|
36
|
-
spec.add_dependency "rubocop-factory_bot", "~> 2.
|
34
|
+
spec.add_dependency "lint_roller", ">= 1.0"
|
35
|
+
spec.add_dependency "rubocop-rspec", "~> 3.5"
|
36
|
+
spec.add_dependency "rubocop-factory_bot", "~> 2.27"
|
37
|
+
spec.add_dependency "rubocop-rspec_rails", "~> 2.31"
|
38
|
+
spec.add_dependency "rubocop-capybara", "~> 2.22"
|
37
39
|
end
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: standard-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- shilin-anton
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-04-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lint_roller
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -30,16 +30,44 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: '3.5'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: '3.5'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rubocop-factory_bot
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '2.27'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '2.27'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rubocop-rspec_rails
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.31'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.31'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rubocop-capybara
|
43
71
|
requirement: !ruby/object:Gem::Requirement
|
44
72
|
requirements:
|
45
73
|
- - "~>"
|
@@ -52,7 +80,7 @@ dependencies:
|
|
52
80
|
- - "~>"
|
53
81
|
- !ruby/object:Gem::Version
|
54
82
|
version: '2.22'
|
55
|
-
description:
|
83
|
+
description:
|
56
84
|
email:
|
57
85
|
- anton.d.shilin@gmail.com
|
58
86
|
executables: []
|
@@ -67,7 +95,6 @@ files:
|
|
67
95
|
- config/base.yml
|
68
96
|
- lib/standard-rspec.rb
|
69
97
|
- lib/standard/rspec.rb
|
70
|
-
- lib/standard/rspec/load_rubocop_rspec_without_the_monkey_patch.rb
|
71
98
|
- lib/standard/rspec/plugin.rb
|
72
99
|
- lib/standard/rspec/version.rb
|
73
100
|
- standard-rspec.gemspec
|
@@ -79,7 +106,7 @@ metadata:
|
|
79
106
|
source_code_uri: https://github.com/shilin-anton/standard-rspec
|
80
107
|
changelog_uri: https://github.com/shilin-anton/standard-rspec/blob/main/CHANGELOG.md
|
81
108
|
default_lint_roller_plugin: Standard::Rspec::Plugin
|
82
|
-
post_install_message:
|
109
|
+
post_install_message:
|
83
110
|
rdoc_options: []
|
84
111
|
require_paths:
|
85
112
|
- lib
|
@@ -94,8 +121,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
121
|
- !ruby/object:Gem::Version
|
95
122
|
version: '0'
|
96
123
|
requirements: []
|
97
|
-
rubygems_version: 3.
|
98
|
-
signing_key:
|
124
|
+
rubygems_version: 3.3.7
|
125
|
+
signing_key:
|
99
126
|
specification_version: 4
|
100
127
|
summary: A Standard plugin that adds rubocop-rspec specific rules to Standard.
|
101
128
|
test_files: []
|
@@ -1,77 +0,0 @@
|
|
1
|
-
# GENERATED FILE - DO NOT EDIT
|
2
|
-
#
|
3
|
-
# This file should look just like: https://github.com/rubocop/rubocop-rspec/blob/master/lib/rubocop-rspec.rb
|
4
|
-
# Except without the `Inject.defaults!` monkey patching.
|
5
|
-
#
|
6
|
-
# Because there are both necessary require statements and additional patching
|
7
|
-
# of RuboCop built-in cops in this file, we need to monitor it for changes
|
8
|
-
# in rubocop-rspec and keep it up to date.
|
9
|
-
#
|
10
|
-
# Last updated from rubocop-rspec v2.22.0
|
11
|
-
|
12
|
-
# frozen_string_literal: true
|
13
|
-
|
14
|
-
require "pathname"
|
15
|
-
require "yaml"
|
16
|
-
|
17
|
-
require "rubocop"
|
18
|
-
require "rubocop-capybara"
|
19
|
-
require "rubocop-factory_bot"
|
20
|
-
|
21
|
-
require_path = Pathname.new(Gem.loaded_specs["rubocop-rspec"].full_require_paths.first)
|
22
|
-
require require_path.join("rubocop/rspec")
|
23
|
-
# require_relative 'rubocop/rspec/inject'
|
24
|
-
require require_path.join("rubocop/rspec/language/node_pattern")
|
25
|
-
require require_path.join("rubocop/rspec/node")
|
26
|
-
require require_path.join("rubocop/rspec/version")
|
27
|
-
require require_path.join("rubocop/rspec/wording")
|
28
|
-
|
29
|
-
# Dependent on `RuboCop::RSpec::Language::NodePattern`.
|
30
|
-
require require_path.join("rubocop/rspec/language")
|
31
|
-
|
32
|
-
require require_path.join("rubocop/cop/rspec/mixin/final_end_location")
|
33
|
-
require require_path.join("rubocop/cop/rspec/mixin/inside_example_group")
|
34
|
-
require require_path.join("rubocop/cop/rspec/mixin/location_help")
|
35
|
-
require require_path.join("rubocop/cop/rspec/mixin/metadata")
|
36
|
-
require require_path.join("rubocop/cop/rspec/mixin/namespace")
|
37
|
-
require require_path.join("rubocop/cop/rspec/mixin/skip_or_pending")
|
38
|
-
require require_path.join("rubocop/cop/rspec/mixin/top_level_group")
|
39
|
-
require require_path.join("rubocop/cop/rspec/mixin/variable")
|
40
|
-
|
41
|
-
# Dependent on `RuboCop::Cop::RSpec::FinalEndLocation`.
|
42
|
-
require require_path.join("rubocop/cop/rspec/mixin/comments_help")
|
43
|
-
require require_path.join("rubocop/cop/rspec/mixin/empty_line_separation")
|
44
|
-
|
45
|
-
require require_path.join("rubocop/cop/rspec/base")
|
46
|
-
require require_path.join("rubocop/rspec/align_let_brace")
|
47
|
-
require require_path.join("rubocop/rspec/concept")
|
48
|
-
require require_path.join("rubocop/rspec/corrector/move_node")
|
49
|
-
require require_path.join("rubocop/rspec/example")
|
50
|
-
require require_path.join("rubocop/rspec/example_group")
|
51
|
-
require require_path.join("rubocop/rspec/hook")
|
52
|
-
|
53
|
-
# RuboCop::RSpec::Inject.defaults!
|
54
|
-
|
55
|
-
require require_path.join("rubocop/cop/rspec_cops")
|
56
|
-
|
57
|
-
# We have to register our autocorrect incompatibilities in RuboCop's cops
|
58
|
-
# as well so we do not hit infinite loops
|
59
|
-
|
60
|
-
RuboCop::Cop::Layout::ExtraSpacing.singleton_class.prepend(
|
61
|
-
Module.new do
|
62
|
-
def autocorrect_incompatible_with
|
63
|
-
super.push(RuboCop::Cop::RSpec::AlignLeftLetBrace)
|
64
|
-
.push(RuboCop::Cop::RSpec::AlignRightLetBrace)
|
65
|
-
end
|
66
|
-
end
|
67
|
-
)
|
68
|
-
|
69
|
-
RuboCop::Cop::Style::TrailingCommaInArguments.singleton_class.prepend(
|
70
|
-
Module.new do
|
71
|
-
def autocorrect_incompatible_with
|
72
|
-
super.push(RuboCop::Cop::RSpec::Capybara::CurrentPathExpectation)
|
73
|
-
end
|
74
|
-
end
|
75
|
-
)
|
76
|
-
|
77
|
-
RuboCop::AST::Node.include(RuboCop::RSpec::Node)
|