lib/standard/rspec/plugin.rb in standard-rspec-0.2.0 vs lib/standard/rspec/plugin.rb in standard-rspec-0.2.1
- old
+ new
@@ -1,14 +1,10 @@
require "yaml"
module Standard
module Rspec
class Plugin < LintRoller::Plugin
- def initialize(config)
- @config = config
- end
-
def about
LintRoller::About.new(
name: "standard-rspec",
version: VERSION,
homepage: "https://github.com/shilin-anton/standard-rspec",
@@ -24,22 +20,14 @@
trick_rubocop_into_thinking_we_required_rubocop_rspec!
LintRoller::Rules.new(
type: :object,
config_format: :rubocop,
- value: rules_with_config_applied
+ value: YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"), aliases: true)
)
end
private
-
- def rules_with_config_applied
- YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml"), aliases: true).tap do |rules|
- if @config["action_policy_enabled"]
- rules["inherit_gem"] = { "action_policy" => "config/rubocop-rspec.yml" }
- end
- end
- end
# This is not fantastic.
#
# When you `require "rubocop-rspec"`, it will not only load the cops,
# but it will also monkey-patch RuboCop's default_configuration, which is