diff options
author | Eli Schwartz <eschwartz@archlinux.org> | 2021-10-21 19:05:27 -0400 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2021-10-27 09:51:52 -0400 |
commit | 894735288920816b9ad668ca27ce2e013a3f2640 (patch) | |
tree | 62d4d41bd5adf436507968447480c08120a14a6e /mesonbuild/compilers | |
parent | 81a2c1b36d91702d82234136ed1868c7118af322 (diff) | |
download | meson-894735288920816b9ad668ca27ce2e013a3f2640.zip meson-894735288920816b9ad668ca27ce2e013a3f2640.tar.gz meson-894735288920816b9ad668ca27ce2e013a3f2640.tar.bz2 |
fix various flake8 whitespace errors
Diffstat (limited to 'mesonbuild/compilers')
-rw-r--r-- | mesonbuild/compilers/c.py | 6 | ||||
-rw-r--r-- | mesonbuild/compilers/cpp.py | 4 | ||||
-rw-r--r-- | mesonbuild/compilers/cuda.py | 14 | ||||
-rw-r--r-- | mesonbuild/compilers/detect.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/c2000.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/clang.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/clike.py | 8 | ||||
-rw-r--r-- | mesonbuild/compilers/mixins/visualstudio.py | 2 | ||||
-rw-r--r-- | mesonbuild/compilers/objcpp.py | 4 |
9 files changed, 22 insertions, 22 deletions
diff --git a/mesonbuild/compilers/c.py b/mesonbuild/compilers/c.py index 0a8f814..a01938c 100644 --- a/mesonbuild/compilers/c.py +++ b/mesonbuild/compilers/c.py @@ -434,9 +434,9 @@ class VisualStudioCCompiler(MSVCCompiler, VisualStudioLikeCCompilerMixin, CCompi def get_options(self) -> 'KeyedOptionDictType': opts = super().get_options() c_stds = ['c89', 'c99'] - # Need to have these to be compatible with projects - # that set c_std to e.g. gnu99. - # https://github.com/mesonbuild/meson/issues/7611 + # Need to have these to be compatible with projects + # that set c_std to e.g. gnu99. + # https://github.com/mesonbuild/meson/issues/7611 g_stds = ['gnu89', 'gnu90', 'gnu9x', 'gnu99'] if version_compare(self.version, self._C11_VERSION): c_stds += ['c11'] diff --git a/mesonbuild/compilers/cpp.py b/mesonbuild/compilers/cpp.py index 3eb9b90..e575b82 100644 --- a/mesonbuild/compilers/cpp.py +++ b/mesonbuild/compilers/cpp.py @@ -76,8 +76,8 @@ class CPPCompiler(CLikeCompiler, Compiler): full_version: T.Optional[str] = None): # If a child ObjCPP class has already set it, don't set it ourselves Compiler.__init__(self, exelist, version, for_machine, info, - is_cross=is_cross, linker=linker, - full_version=full_version) + is_cross=is_cross, linker=linker, + full_version=full_version) CLikeCompiler.__init__(self, exe_wrapper) @staticmethod diff --git a/mesonbuild/compilers/cuda.py b/mesonbuild/compilers/cuda.py index 5a7df73..1f396e4 100644 --- a/mesonbuild/compilers/cuda.py +++ b/mesonbuild/compilers/cuda.py @@ -171,7 +171,7 @@ class CudaCompiler(Compiler): '--qpp-config': '-qpp-config', # 4.2.8.19 } # Reverse map -short to --long options. - _FLAG_SHORT2LONG_WITHARGS = {v:k for k,v in _FLAG_LONG2SHORT_WITHARGS.items()} + _FLAG_SHORT2LONG_WITHARGS = {v: k for k, v in _FLAG_LONG2SHORT_WITHARGS.items()} def __init__(self, exelist: T.List[str], version: str, for_machine: MachineChoice, is_cross: bool, exe_wrapper: T.Optional['ExternalProgram'], @@ -186,7 +186,7 @@ class CudaCompiler(Compiler): self.warn_args = {level: self._to_host_flags(flags) for level, flags in host_compiler.warn_args.items()} @classmethod - def _shield_nvcc_list_arg(cls, arg: str, listmode: bool=True) -> str: + def _shield_nvcc_list_arg(cls, arg: str, listmode: bool = True) -> str: r""" Shield an argument against both splitting by NVCC's list-argument parse logic, and interpretation by any shell. @@ -390,11 +390,11 @@ class CudaCompiler(Compiler): val = next(flagit) # -o something except StopIteration: pass - elif flag.split('=',1)[0] in self._FLAG_LONG2SHORT_WITHARGS or \ - flag.split('=',1)[0] in self._FLAG_SHORT2LONG_WITHARGS: + elif flag.split('=', 1)[0] in self._FLAG_LONG2SHORT_WITHARGS or \ + flag.split('=', 1)[0] in self._FLAG_SHORT2LONG_WITHARGS: # This is either -o or a multi-letter flag, and it is receiving its # value after an = sign. - flag, val = flag.split('=',1) # -o=something + flag, val = flag.split('=', 1) # -o=something # Some dependencies (e.g., BoostDependency) add unspaced "-isystem/usr/include" arguments elif flag.startswith('-isystem'): val = flag[8:].strip() @@ -427,9 +427,9 @@ class CudaCompiler(Compiler): assert val is not None # Should only trip if there is a missing argument. # Take care of the various NVCC-supported flags that need special handling. - flag = self._FLAG_LONG2SHORT_WITHARGS.get(flag,flag) + flag = self._FLAG_LONG2SHORT_WITHARGS.get(flag, flag) - if flag in {'-include','-isystem','-I','-L','-l'}: + if flag in {'-include', '-isystem', '-I', '-L', '-l'}: # These flags are known to GCC, but list-valued in NVCC. They potentially # require double-quoting to prevent NVCC interpreting the flags as lists # when GCC would not have done so. diff --git a/mesonbuild/compilers/detect.py b/mesonbuild/compilers/detect.py index 272f5e4..4df167b 100644 --- a/mesonbuild/compilers/detect.py +++ b/mesonbuild/compilers/detect.py @@ -211,7 +211,7 @@ def compiler_from_language(env: 'Environment', lang: str, for_machine: MachineCh } return lang_map[lang](env, for_machine) if lang in lang_map else None -def detect_compiler_for(env: 'Environment', lang: str, for_machine: MachineChoice)-> T.Optional[Compiler]: +def detect_compiler_for(env: 'Environment', lang: str, for_machine: MachineChoice) -> T.Optional[Compiler]: comp = compiler_from_language(env, lang, for_machine) if comp is not None: assert comp.for_machine == for_machine diff --git a/mesonbuild/compilers/mixins/c2000.py b/mesonbuild/compilers/mixins/c2000.py index 172d3d1..65261c6 100644 --- a/mesonbuild/compilers/mixins/c2000.py +++ b/mesonbuild/compilers/mixins/c2000.py @@ -124,6 +124,6 @@ class C2000Compiler(Compiler): parameter_list[idx] = i[:9] + os.path.normpath(os.path.join(build_dir, i[9:])) return parameter_list - + def get_dependency_gen_args(self, outtarget: str, outfile: str) -> T.List[str]: return ['--preproc_with_compile', f'--preproc_dependency={outfile}'] diff --git a/mesonbuild/compilers/mixins/clang.py b/mesonbuild/compilers/mixins/clang.py index b3ce7f1..94aa9a2 100644 --- a/mesonbuild/compilers/mixins/clang.py +++ b/mesonbuild/compilers/mixins/clang.py @@ -125,7 +125,7 @@ class ClangCompiler(GnuLikeCompiler): # qcld: Qualcomm Snapdragon linker, based on LLVM if linker == 'qcld': - return ['-fuse-ld=qcld'] + return ['-fuse-ld=qcld'] if shutil.which(linker): if not shutil.which(linker): diff --git a/mesonbuild/compilers/mixins/clike.py b/mesonbuild/compilers/mixins/clike.py index 2242ca1..3d2df9b 100644 --- a/mesonbuild/compilers/mixins/clike.py +++ b/mesonbuild/compilers/mixins/clike.py @@ -283,7 +283,7 @@ class CLikeCompiler(Compiler): return self.linker.import_library_args(implibname) def _sanity_check_impl(self, work_dir: str, environment: 'Environment', - sname: str, code: str) -> None: + sname: str, code: str) -> None: mlog.debug('Sanity testing ' + self.get_display_language() + ' compiler:', ' '.join(self.exelist)) mlog.debug(f'Is cross compiler: {self.is_cross!s}.') @@ -672,7 +672,7 @@ class CLikeCompiler(Compiler): #endif {delim}\n{dname}''' args = self.build_wrapper_args(env, extra_args, dependencies, - mode=CompileCheckMode.PREPROCESS).to_native() + mode=CompileCheckMode.PREPROCESS).to_native() func = functools.partial(self.cached_compile, code, env.coredata, extra_args=args, mode='preprocess') if disable_cache: func = functools.partial(self.compile, code, extra_args=args, mode='preprocess', temp_dir=env.scratch_dir) @@ -1096,7 +1096,7 @@ class CLikeCompiler(Compiler): return None def _find_library_impl(self, libname: str, env: 'Environment', extra_dirs: T.List[str], - code: str, libtype: LibType) -> T.Optional[T.List[str]]: + code: str, libtype: LibType) -> T.Optional[T.List[str]]: # These libraries are either built-in or invalid if libname in self.ignore_libs: return [] @@ -1158,7 +1158,7 @@ class CLikeCompiler(Compiler): return None def _find_framework_impl(self, name: str, env: 'Environment', extra_dirs: T.List[str], - allow_system: bool) -> T.Optional[T.List[str]]: + allow_system: bool) -> T.Optional[T.List[str]]: if isinstance(extra_dirs, str): extra_dirs = [extra_dirs] key = (tuple(self.exelist), name, tuple(extra_dirs), allow_system) diff --git a/mesonbuild/compilers/mixins/visualstudio.py b/mesonbuild/compilers/mixins/visualstudio.py index 2e46e9d..4bc721f 100644 --- a/mesonbuild/compilers/mixins/visualstudio.py +++ b/mesonbuild/compilers/mixins/visualstudio.py @@ -161,7 +161,7 @@ class VisualStudioLikeCompiler(Compiler, metaclass=abc.ABCMeta): return ['/c'] def get_no_optimization_args(self) -> T.List[str]: - return ['/Od','/Oi-'] + return ['/Od', '/Oi-'] def sanitizer_compile_args(self, value: str) -> T.List[str]: if value == 'none': diff --git a/mesonbuild/compilers/objcpp.py b/mesonbuild/compilers/objcpp.py index e52068d..7ee2077 100644 --- a/mesonbuild/compilers/objcpp.py +++ b/mesonbuild/compilers/objcpp.py @@ -59,7 +59,7 @@ class GnuObjCPPCompiler(GnuCompiler, ObjCPPCompiler): linker: T.Optional['DynamicLinker'] = None, full_version: T.Optional[str] = None): ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, linker=linker, full_version=full_version) + info, exe_wrapper, linker=linker, full_version=full_version) GnuCompiler.__init__(self, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], @@ -77,7 +77,7 @@ class ClangObjCPPCompiler(ClangCompiler, ObjCPPCompiler): linker: T.Optional['DynamicLinker'] = None, full_version: T.Optional[str] = None): ObjCPPCompiler.__init__(self, exelist, version, for_machine, is_cross, - info, exe_wrapper, linker=linker, full_version=full_version) + info, exe_wrapper, linker=linker, full_version=full_version) ClangCompiler.__init__(self, defines) default_warn_args = ['-Wall', '-Winvalid-pch', '-Wnon-virtual-dtor'] self.warn_args = {'0': [], |