ci: add python file checks to ci
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Robert Kaussow 2021-06-07 22:28:45 +02:00
parent a941eb39ff
commit 62d47e5c36
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 39 additions and 4 deletions

View File

@ -13,6 +13,28 @@ local PipelineLinting = {
'ansible-later',
],
},
{
name: 'python-format',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -qq yapf',
'yapf -dr ./',
],
},
{
name: 'python-flake8',
image: 'python:3.9',
environment: {
PY_COLORS: 1,
},
commands: [
'pip install -qq flake8',
'flake8',
],
},
],
trigger: {
ref: ['refs/heads/master', 'refs/tags/**', 'refs/pull/**'],

View File

@ -12,6 +12,22 @@ steps:
commands:
- ansible-later
- name: python-format
image: python:3.9
commands:
- pip install -qq yapf
- yapf -dr ./
environment:
PY_COLORS: 1
- name: python-flake8
image: python:3.9
commands:
- pip install -qq flake8
- flake8
environment:
PY_COLORS: 1
trigger:
ref:
- refs/heads/master
@ -131,6 +147,6 @@ depends_on:
---
kind: signature
hmac: 2948da51a4a4705ab74686093a43587cd74985bca106f892e4f7049a258cdc0d
hmac: 503968a2c0113f7872840a47c8db01c28ab1f52eb3318203814111bdf4d55f03
...

View File

@ -1,10 +1,7 @@
import os
import warnings
import testinfra.utils.ansible_runner
warnings.filterwarnings("ignore", category=DeprecationWarning)
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")