diff options
author | David Robillard <d@drobilla.net> | 2020-07-04 13:23:01 +0200 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-07-04 13:23:01 +0200 |
commit | a4176f50a1ebe3a2108eada412ed957717ff1eb3 (patch) | |
tree | 67d5520507034d697e6ba06cf2825d070db70ab8 | |
parent | f6fa1464f788179c97ad555352ca18d9df851994 (diff) | |
download | autowaf-a4176f50a1ebe3a2108eada412ed957717ff1eb3.tar.gz autowaf-a4176f50a1ebe3a2108eada412ed957717ff1eb3.tar.bz2 autowaf-a4176f50a1ebe3a2108eada412ed957717ff1eb3.zip |
Cleanup: Fix long lines
Fixes flake8 warning E501.
-rw-r--r-- | extras/autowaf.py | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/extras/autowaf.py b/extras/autowaf.py index 2b76474..9ef2227 100644 --- a/extras/autowaf.py +++ b/extras/autowaf.py @@ -87,8 +87,8 @@ def set_options(opt, debug_by_default=False): # Test options if hasattr(Context.g_module, 'test'): test_opts = opt.add_option_group('Test options', '') - opts.add_option('-T', '--test', action='store_true', dest='build_tests', - help='build unit tests') + opts.add_option('-T', '--test', action='store_true', + dest='build_tests', help='build unit tests') opts.add_option('--no-coverage', action='store_true', dest='no_coverage', help='do not instrument code for test coverage') @@ -194,8 +194,11 @@ def nameify(name): def check_pkg(conf, spec, **kwargs): "Check for a package iff it hasn't been checked for yet" - if (kwargs['uselib_store'].lower() in conf.env['AUTOWAF_LOCAL_LIBS'] or - kwargs['uselib_store'].lower() in conf.env['AUTOWAF_LOCAL_HEADERS']): + uselib_store = kwargs['uselib_store'] + is_local = (uselib_store.lower() in conf.env['AUTOWAF_LOCAL_LIBS'] or + uselib_store.lower() in conf.env['AUTOWAF_LOCAL_HEADERS']) + + if is_local: return import re @@ -230,7 +233,7 @@ def check_pkg(conf, spec, **kwargs): if not conf.env.MSVC_COMPILER and 'system' in kwargs and kwargs['system']: conf.system_include_paths.update( - conf.env['INCLUDES_' + nameify(kwargs['uselib_store'])]) + conf.env['INCLUDES_' + nameify(uselib_store)]) def normpath(path): @@ -1051,7 +1054,8 @@ class TestContext(Build.BuildContext): Logs.info("Waf: Entering directory `%s'", bld_dir) os.chdir(str(bld_dir)) - if not self.env.NO_COVERAGE and str(node.parent) == Context.top_dir: + parent_is_top = str(node.parent) == Context.top_dir + if not self.env.NO_COVERAGE and parent_is_top: self.clear_coverage() Logs.info('') @@ -1172,8 +1176,9 @@ class TestContext(Build.BuildContext): lines = re.search('lines\.*: (.*)%.*', summary).group(1) functions = re.search('functions\.*: (.*)%.*', summary).group(1) branches = re.search('branches\.*: (.*)%.*', summary).group(1) - self.log_good('COVERAGE', '%s%% lines, %s%% functions, %s%% branches', - lines, functions, branches) + self.log_good( + 'COVERAGE', '%s%% lines, %s%% functions, %s%% branches', + lines, functions, branches) except Exception: Logs.warn('Failed to run lcov to generate coverage report') |