From 2d1aee85958c7a3ea7e322c06f882185e40aa1ac Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Thu, 10 Oct 2019 17:05:59 +0200 Subject: [PATCH] cmake scripts: minor cleanup not in is considered easier to read and thus recommended (flake8) and avoid one temporary name that is never used. Adjust flake8 to be compatible with black formatting. Change-Id: Ia049adb2344f11b53c78574972f6d9d670f4e66d Reviewed-by: Alexandru Croitor Reviewed-by: Qt CMake Build Bot --- util/cmake/Makefile | 2 +- util/cmake/condition_simplifier_cache.py | 2 +- util/cmake/pro2cmake.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/util/cmake/Makefile b/util/cmake/Makefile index 402e45b707..67affa0e95 100644 --- a/util/cmake/Makefile +++ b/util/cmake/Makefile @@ -5,7 +5,7 @@ coverage: pytest --cov . flake8: - flake8 *.py --ignore=E501,E266,W503 + flake8 *.py --ignore=E501,E266,E203,W503 pytest: pytest diff --git a/util/cmake/condition_simplifier_cache.py b/util/cmake/condition_simplifier_cache.py index 6303ff828e..4afd91597b 100644 --- a/util/cmake/condition_simplifier_cache.py +++ b/util/cmake/condition_simplifier_cache.py @@ -142,7 +142,7 @@ def simplify_condition_memoize(f: Callable[[str], str]): os.makedirs(os.path.dirname(cache_path), exist_ok=True) # Create the file if it doesn't exist, but don't override # it. - with open(cache_path, "a") as temp_file_handle: + with open(cache_path, "a"): pass updated_cache = cache_file_content diff --git a/util/cmake/pro2cmake.py b/util/cmake/pro2cmake.py index 0b814f432f..bcb145cb59 100755 --- a/util/cmake/pro2cmake.py +++ b/util/cmake/pro2cmake.py @@ -2979,7 +2979,7 @@ def handle_app_or_lib( elif is_plugin: assert not is_example target = write_plugin(cm_fh, scope, indent=indent) - elif is_lib and not "qt_module" in scope.get("_LOADED"): + elif is_lib and "qt_module" not in scope.get("_LOADED"): assert not is_example target = write_generic_library(cm_fh, scope, indent=indent) elif is_lib or "qt_module" in scope.get("_LOADED"):