コード例 #1
0
ファイル: test_lintipy.py プロジェクト: vvalorous/lintipy
 def handler(self):
     notice = sns()
     hnd = CheckRun('zen of python', 'this', '1', '2', '3')
     subject, message = check_run_event()
     notice['Records'][0]['Sns']['Subject'] = subject
     notice['Records'][0]['Sns']['Message'] = message
     hnd.event = notice
     hnd.hook = json.loads(message)
     hnd._session = requests.Session()
     return hnd
コード例 #2
0
ファイル: test_lintipy.py プロジェクト: FussyFox/lintipy
    def test_as_handler(self, handler):
        hdl = CheckRun.as_handler('zen of python', 'this', '1', '2', '3')
        assert callable(hdl)
        assert hdl.__name__ == 'CheckRun'

        with pytest.raises(ValueError):
            hdl(handler.event, {})
コード例 #3
0
ファイル: test_main.py プロジェクト: FussyFox/black
 def handler(self):
     return CheckRun("black", "black", "--check", "--diff", "tests")
コード例 #4
0
"""Lambda function that executes pyflakes, a static file linter."""
from lintipy import CheckRun


handle = CheckRun.as_handler('pyflakes', 'pyflakes', '.')
コード例 #5
0
ファイル: test_lintipy.py プロジェクト: vvalorous/lintipy
 def test_init(self):
     hnd = CheckRun('zen of python', 'this', '1', '2', '3')
     assert hnd.label == 'zen of python'
     assert hnd.cmd == 'this'
     assert hnd.cmd_args == ('1', '2', '3')
コード例 #6
0
def handle(*args, **kwargs):
    """Handle that is invoked by AWS lambda."""
    CheckRun(
        '{{cookiecutter.linter}}',
        '{{cookiecutter.command}}', '{{cookiecutter.directory}}'
    )(*args, **kwargs)
コード例 #7
0
"""Lambda function that executes isort, a static file linter."""
from lintipy import CheckRun

handle = CheckRun.as_handler('isort', 'isort', '--check-only', '--diff', '.')
コード例 #8
0
ファイル: main.py プロジェクト: jackton1/bandit
"""Lambda function that executes bandit, a static file linter."""
from lintipy import CheckRun


handle = CheckRun.as_handler(
    'bandit',
    'bandit.cli.main', '-r', '.'
)
コード例 #9
0
ファイル: main.py プロジェクト: FussyFox/pydocstyle
"""Lambda function that executes pydocstyle, a static file linter."""

from lintipy import CheckRun

handle = CheckRun.as_handler('pydocstyle', 'pydocstyle', '.')
コード例 #10
0
"""Lambda function that executes flake8, a static file linter."""
from lintipy import CheckRun

handle = CheckRun.as_handler('flake8', 'flake8', '--jobs', '1', '.')
コード例 #11
0
"""Lambda function that executes pycodestyle, a static file linter."""
from lintipy import CheckRun


handle = CheckRun.as_handler('pycodestyle', 'pycodestyle', '.', )