From 928ea3b7540feeebdcb9a4ff559e83b7fb17f9fa Mon Sep 17 00:00:00 2001 From: Robert Kaussow Date: Tue, 8 Jun 2021 00:14:04 +0200 Subject: [PATCH] fix ci yapf command if no python files found --- .drone.jsonnet | 2 +- .drone.yml | 4 ++-- molecule/centos7/tests/test_default.py | 1 + 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.drone.jsonnet b/.drone.jsonnet index ecf6cd6..4b304ac 100644 --- a/.drone.jsonnet +++ b/.drone.jsonnet @@ -21,7 +21,7 @@ local PipelineLinting = { }, commands: [ 'pip install -qq yapf', - 'yapf -dr ./', + '[ ! -z "$(find . -type f -name *.py)" ] && yapf -rd ./', ], }, { diff --git a/.drone.yml b/.drone.yml index cd080fb..327ac6b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,7 +16,7 @@ steps: image: python:3.9 commands: - pip install -qq yapf - - yapf -dr ./ + - "[ ! -z \"$(find . -type f -name *.py)\" ] && yapf -rd ./" environment: PY_COLORS: 1 @@ -147,6 +147,6 @@ depends_on: --- kind: signature -hmac: a57deec8454606c10d1bf88110fe3a7096afa4294d741e34fb8fbe15df5578c6 +hmac: b65a40c16f04371f45ae0b7294ec1199d82a9d1d5a0ba0fe5a7b2e6246041e77 ... diff --git a/molecule/centos7/tests/test_default.py b/molecule/centos7/tests/test_default.py index 6ffabc9..566d7ed 100644 --- a/molecule/centos7/tests/test_default.py +++ b/molecule/centos7/tests/test_default.py @@ -2,6 +2,7 @@ import os import testinfra.utils.ansible_runner + testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner( os.environ["MOLECULE_INVENTORY_FILE"] ).get_hosts("all")