Skip to content

Commit 0c80c65

Browse files
committed
Tweak an example in the README
This PR tweaks an example in the README: - The `BananaRoller::Plugin` seems to inherit from `LintRoller::Plugin` - `context.engine == :rubocop` returns a boolean value, so the `if` expression is redundant
1 parent 5be5886 commit 0c80c65

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

README.md

+2-7
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ this example plugin for banana-related static analysis:
1919

2020
```ruby
2121
module BananaRoller
22-
class Plugin
22+
class Plugin < LintRoller::Plugin
2323
# `config' is a Hash of options passed to the plugin by the user
2424
def initialize(config = {})
2525
@alternative = config["alternative"] ||= "chocolate"
@@ -36,11 +36,7 @@ module BananaRoller
3636

3737
# `context' is an instance of LintRoller::Context provided by the runner
3838
def supported?(context)
39-
if context.engine == :rubocop
40-
true
41-
else
42-
false
43-
end
39+
context.engine == :rubocop
4440
end
4541

4642
# `context' is an instance of LintRoller::Context provided by the runner
@@ -175,4 +171,3 @@ including (but not limited to) one-on-one communications, public posts/comments,
175171
code reviews, pull requests, and GitHub issues. If violations occur, Test Double
176172
will take any action they deem appropriate for the infraction, up to and
177173
including blocking a user from the organization's repositories.
178-

0 commit comments

Comments
 (0)