Open
Description
I try to write a wrapper to call the pycodestyle with the rule in the wrapper file.
My rule/wrapper looks like.
import pycodestyle
def _main(**kwargs)
@pycodestyle.register_check
def image_lines(logical_line):
r"""Find the line starting from the
- FROM
- image:
directives.
I801: def a():\n pass\na()
I802: def b():\n pass\na()
""" #noqa
if logical_line.startswith('FROM'):
yield 0, "I801 found the FROM directive"
elif logical_line.startswith('image:'):
yield 0, "I802 found the image directive"
style = pycodestyle.StyleGuide(filename=['Dockerfile', 'docker-compose.yml'], select=['I801', 'I802'])
if __name__ == '__main__':
_main()
Can you help me? Thank you.
Metadata
Metadata
Assignees
Labels
No labels