fix LGTM warnings

pull/8080/head
Dylan Baker 4 years ago
parent e81acbd606
commit a539fda0cf
  1. 4
      mesonbuild/build.py
  2. 2
      mesonbuild/coredata.py
  3. 1
      mesonbuild/interpreter.py
  4. 8
      mesonbuild/mesonlib.py
  5. 2
      mesonbuild/mintro.py

@ -12,7 +12,7 @@
# See the License for the specific language governing permissions and # See the License for the specific language governing permissions and
# limitations under the License. # limitations under the License.
from collections import OrderedDict, defaultdict from collections import OrderedDict
from functools import lru_cache from functools import lru_cache
import copy import copy
import hashlib import hashlib
@ -32,7 +32,7 @@ from .mesonlib import (
OptionKey, OptionKey,
) )
from .compilers import ( from .compilers import (
Compiler, all_languages, is_object, clink_langs, sort_clink, lang_suffixes, Compiler, is_object, clink_langs, sort_clink, lang_suffixes,
is_known_suffix is_known_suffix
) )
from .linkers import StaticLinker from .linkers import StaticLinker

@ -17,7 +17,7 @@ import pickle, os, uuid
import sys import sys
from itertools import chain from itertools import chain
from pathlib import PurePath from pathlib import PurePath
from collections import OrderedDict, defaultdict from collections import OrderedDict
from .mesonlib import ( from .mesonlib import (
MesonException, EnvironmentException, MachineChoice, PerMachine, MesonException, EnvironmentException, MachineChoice, PerMachine,
default_libdir, default_libexecdir, default_prefix, split_args, default_libdir, default_libexecdir, default_prefix, split_args,

@ -1142,7 +1142,6 @@ class CompilerHolder(InterpreterObject):
i.held_object.get_curdir(), idir) i.held_object.get_curdir(), idir)
args += self.compiler.get_include_args(idir, False) args += self.compiler.get_include_args(idir, False)
if not nobuiltins: if not nobuiltins:
for_machine = Interpreter.machine_from_native_kwarg(kwargs)
opts = self.environment.coredata.options opts = self.environment.coredata.options
args += self.compiler.get_option_compile_args(opts) args += self.compiler.get_option_compile_args(opts)
if mode == 'link': if mode == 'link':

@ -20,8 +20,7 @@ import stat
import time import time
import platform, subprocess, operator, os, shlex, shutil, re import platform, subprocess, operator, os, shlex, shutil, re
import collections import collections
from enum import IntEnum from functools import lru_cache, wraps, total_ordering
from functools import lru_cache, wraps
from itertools import tee, filterfalse from itertools import tee, filterfalse
from tempfile import TemporaryDirectory from tempfile import TemporaryDirectory
import typing as T import typing as T
@ -348,7 +347,7 @@ def classify_unity_sources(compilers: T.Iterable['CompilerType'], sources: T.Ite
return compsrclist return compsrclist
class MachineChoice(IntEnum): class MachineChoice(enum.IntEnum):
"""Enum class representing one of the two abstract machine names used in """Enum class representing one of the two abstract machine names used in
most places: the build, and host, machines. most places: the build, and host, machines.
@ -1617,7 +1616,7 @@ def relative_to_if_possible(path: Path, root: Path, resolve: bool = False) -> Pa
except ValueError: except ValueError:
return path return path
class LibType(IntEnum): class LibType(enum.IntEnum):
"""Enumeration for library types.""" """Enumeration for library types."""
@ -1854,6 +1853,7 @@ def _classify_argument(key: 'OptionKey') -> OptionType:
return OptionType.PROJECT return OptionType.PROJECT
@total_ordering
class OptionKey: class OptionKey:
"""Represents an option key in the various option dictionaries. """Represents an option key in the various option dictionaries.

@ -34,7 +34,7 @@ import typing as T
import os import os
import argparse import argparse
from .mesonlib import MachineChoice, OptionKey from .mesonlib import OptionKey
def get_meson_info_file(info_dir: str) -> str: def get_meson_info_file(info_dir: str) -> str:
return os.path.join(info_dir, 'meson-info.json') return os.path.join(info_dir, 'meson-info.json')

Loading…
Cancel
Save