ci: add python file checks to ci
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
Robert Kaussow 2021-06-07 22:29:00 +02:00
parent 75f5c0cd73
commit b463141be2
Signed by: xoxys
GPG Key ID: 4E692A2EAECC03C0
3 changed files with 41 additions and 5 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: 7b026b5d16473180b04540933595f8c039f83a3e4e185ad9235df3bbd0c7274f
hmac: 96ac55954142ec076f21b329ef2c7b903f8393fc403efd4c79d1c43e88cf0914
...

View File

@ -3,13 +3,11 @@ import time
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")
def test_homeassistant_running(host):