Add an example plugin project to source tree

This commit is contained in:
Ian Cordasco 2016-10-25 18:21:50 -05:00
parent a9e15afbf5
commit 5f3577fca8
No known key found for this signature in database
GPG key ID: 656D3395E4A9791A
4 changed files with 73 additions and 0 deletions

View file

@ -0,0 +1,9 @@
"""Module for an example Flake8 plugin."""
from .on_by_default import ExampleOne
from .off_by_default import ExampleTwo
__all__ = (
'ExampleOne',
'ExampleTwo',
)

View file

@ -0,0 +1,17 @@
"""Our first example plugin."""
class ExampleTwo(object):
"""Second Example Plugin."""
name = 'off-by-default-example-plugin'
version = '1.0.0'
off_by_default = True
def __init__(self, tree):
self.tree = tree
def run(self):
"""Do nothing."""
yield (1, 0, 'X200 The off-by-default plugin was enabled',
'OffByDefaultPlugin')

View file

@ -0,0 +1,15 @@
"""Our first example plugin."""
class ExampleOne(object):
"""First Example Plugin."""
name = 'on-by-default-example-plugin'
version = '1.0.0'
def __init__(self, tree):
self.tree = tree
def run(self):
"""Do nothing."""
for message in []:
yield message