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:29 +02:00
parent 0e7f00de75
commit a740ccec1c
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: b90472d1b824f04c176b46218d5d4274697eec11d8262223eb0d156e9ae73abc
hmac: 773afb4c5c687880a6d2a5df0c84cb1166e26e5af3a301b00e4dfc7d00994a19
...

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")