aboutsummaryrefslogtreecommitdiffstats
path: root/checks.py
diff options
context:
space:
mode:
authorLovett, Trevor <trevor.lovett@att.com>2019-09-06 15:34:12 -0500
committerLovett, Trevor (tl2972) <tl2972@att.com>2019-09-06 15:42:13 -0500
commit1bc097aa957e560147b4d9af49d25e69a6692702 (patch)
treeebf426e45ecaa94ceaf378922731b243fd9ef1e6 /checks.py
parent39119b4e131155ae38f7b435fc9f3693ca924eed (diff)
Enforce black code format via pre-commit hook
Issue-ID: VVP-203 Change-Id: If0de5b4bc1be0c9514decea1f4ff6f5ec79dc41b Signed-off-by: Lovett, Trevor <trevor.lovett@att.com>
Diffstat (limited to 'checks.py')
-rw-r--r--checks.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/checks.py b/checks.py
index 4431d26..4e5fb13 100644
--- a/checks.py
+++ b/checks.py
@@ -40,7 +40,7 @@ import csv
import io
import json
import os
-import subprocess #nosec
+import subprocess # nosec
import sys
import pytest
@@ -156,13 +156,19 @@ def check_requirements_up_to_date():
def check_app_tests_pass():
- return run_pytest("tests", "--self-test",
- msg="app_tests failed. Run pytest app_tests and fix errors.")
+ return run_pytest(
+ "tests",
+ "--self-test",
+ msg="app_tests failed. Run pytest app_tests and fix errors.",
+ )
def check_self_test_pass():
- return run_pytest("tests", "--self-test",
- msg="self-test failed. Run pytest --self-test and fix errors.")
+ return run_pytest(
+ "tests",
+ "--self-test",
+ msg="self-test failed. Run pytest --self-test and fix errors.",
+ )
def check_testable_requirements_are_mapped():
@@ -186,12 +192,12 @@ def check_flake8_passes():
def check_bandit_passes():
- result = subprocess.run( #nosec
- ["bandit", "-c", "bandit.yaml", "-r", ".", "-x", "./.tox/**"], #nosec
- encoding="utf-8", #nosec
- stdout=subprocess.PIPE, #nosec
- stderr=subprocess.PIPE, #nosec
- ) #nosec
+ result = subprocess.run( # nosec
+ ["bandit", "-c", "bandit.yaml", "-r", ".", "-x", "./.tox/**"], # nosec
+ encoding="utf-8", # nosec
+ stdout=subprocess.PIPE, # nosec
+ stderr=subprocess.PIPE, # nosec
+ ) # nosec
msgs = result.stdout.split("\n") if result.returncode != 0 else []
return ["bandit errors detected:"] + [f" {e}" for e in msgs] if msgs else []