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:20 +02:00
parent a47f2a5d08
commit e8d0ff32e9
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 41 additions and 7 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: 7c5cd68d3f014d309deceecd9742e6a352259715e753d4325486e01919bf7a8e
hmac: f5e8b7070646e50bebbd57d451e03f1f5486dc14ab079e77105987d68523d399
...

View File

@ -2,13 +2,9 @@ import os
import testinfra.utils.ansible_runner
import warnings
warnings.filterwarnings("ignore", category=DeprecationWarning)
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
os.environ["MOLECULE_INVENTORY_FILE"]
).get_hosts("all")
# TODO: add some tests if zigbee2mqtt can work with a