diff options
author | OpenShift Bot <eparis+openshiftbot@redhat.com> | 2017-04-05 02:10:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-05 02:10:47 -0500 |
commit | 073464be7879d985ff85c14532e483197964174f (patch) | |
tree | a490d13dc528565cbef2db59683aa699049feabf /roles/lib_openshift/src | |
parent | 35bd18e59440bb5cdda7649642178bdc981635a5 (diff) | |
parent | 3e61acff1ba4bf7032ea23c8da4f626cbad9150e (diff) | |
download | openshift-073464be7879d985ff85c14532e483197964174f.tar.gz openshift-073464be7879d985ff85c14532e483197964174f.tar.bz2 openshift-073464be7879d985ff85c14532e483197964174f.tar.xz openshift-073464be7879d985ff85c14532e483197964174f.zip |
Merge pull request #3850 from kwoodson/skip_generated_tc
Merged by openshift-bot
Diffstat (limited to 'roles/lib_openshift/src')
-rwxr-xr-x | roles/lib_openshift/src/generate.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/roles/lib_openshift/src/generate.py b/roles/lib_openshift/src/generate.py index 3f23455b5..2570f51dd 100755 --- a/roles/lib_openshift/src/generate.py +++ b/roles/lib_openshift/src/generate.py @@ -5,12 +5,16 @@ import argparse import os +import re import yaml import six OPENSHIFT_ANSIBLE_PATH = os.path.dirname(os.path.realpath(__file__)) OPENSHIFT_ANSIBLE_SOURCES_PATH = os.path.join(OPENSHIFT_ANSIBLE_PATH, 'sources.yml') # noqa: E501 LIBRARY = os.path.join(OPENSHIFT_ANSIBLE_PATH, '..', 'library/') +SKIP_COVERAGE_PATTERN = [re.compile('class Yedit.*$'), + re.compile('class Utils.*$')] +PRAGMA_STRING = ' # pragma: no cover' class GenerateAnsibleException(Exception): @@ -72,6 +76,11 @@ def generate(parts): if idx in [0, 1] and 'flake8: noqa' in line or 'pylint: skip-file' in line: # noqa: E501 continue + for skip in SKIP_COVERAGE_PATTERN: + if re.match(skip, line): + line = line.strip() + line += PRAGMA_STRING + os.linesep + data.write(line) fragment_banner(fpart, "footer", data) |