Class: Standard::Sorbet::Plugin
- Inherits:
-
LintRoller::Plugin
- Object
- LintRoller::Plugin
- Standard::Sorbet::Plugin
- Defined in:
- lib/standard/sorbet/plugin.rb
Instance Method Summary collapse
- #about ⇒ Object
-
#initialize(config) ⇒ Plugin
constructor
A new instance of Plugin.
- #rules(context) ⇒ Object
- #supported?(context) ⇒ Boolean
Constructor Details
#initialize(config) ⇒ Plugin
Returns a new instance of Plugin.
3 4 5 6 |
# File 'lib/standard/sorbet/plugin.rb', line 3 def initialize(config) @config = config @merges_upstream_metadata = LintRoller::Support::MergesUpstreamMetadata.new end |
Instance Method Details
#about ⇒ Object
8 9 10 11 12 13 14 15 |
# File 'lib/standard/sorbet/plugin.rb', line 8 def about LintRoller::About.new( name: "standard-sorbet", version: VERSION, homepage: "https://github.com/standardrb/standard-sorbet", description: "Configuration for rubocop-sorbet's rules" ) end |
#rules(context) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/standard/sorbet/plugin.rb', line 21 def rules(context) trick_rubocop_into_thinking_we_required_rubocop_sorbet! rules = @merges_upstream_metadata.merge( YAML.load_file(Pathname.new(__dir__).join("../../../config/base.yml")), YAML.load_file(Pathname.new(Gem.loaded_specs["rubocop-sorbet"].full_gem_path).join("config/default.yml")) ) LintRoller::Rules.new( type: :object, config_format: :rubocop, value: rules ) end |
#supported?(context) ⇒ Boolean
17 18 19 |
# File 'lib/standard/sorbet/plugin.rb', line 17 def supported?(context) true end |