pylint: check for duplicate imports

I ran into one of these from LGTM, and it would be nice if pylint could
warn me as part of my local development process instead of waiting for
the CI to tell me.
pull/9167/head
Dylan Baker 3 years ago
parent 92b21a0045
commit 9795323b86
  1. 1
      .pylintrc
  2. 4
      mesonbuild/build.py
  3. 1
      mesonbuild/cmake/executor.py
  4. 2
      mesonbuild/compilers/cpp.py
  5. 3
      mesonbuild/compilers/d.py
  6. 1
      mesonbuild/environment.py
  7. 3
      mesonbuild/modules/qt.py

@ -22,6 +22,7 @@ enable=
mixed-indentation, mixed-indentation,
no-value-for-parameter, no-value-for-parameter,
redundant-keyword-arg, redundant-keyword-arg,
reimported,
singleton-comparison, singleton-comparison,
superfluous-parens, superfluous-parens,
too-many-function-args, too-many-function-args,

@ -33,7 +33,7 @@ from .mesonlib import (
extract_as_list, typeslistify, stringlistify, classify_unity_sources, extract_as_list, typeslistify, stringlistify, classify_unity_sources,
get_filenames_templates_dict, substitute_values, has_path_sep, get_filenames_templates_dict, substitute_values, has_path_sep,
OptionKey, PerMachineDefaultable, OptionKey, PerMachineDefaultable,
MesonBugException, FileOrString, MesonBugException,
) )
from .compilers import ( from .compilers import (
Compiler, is_object, clink_langs, sort_clink, lang_suffixes, Compiler, is_object, clink_langs, sort_clink, lang_suffixes,
@ -902,7 +902,7 @@ class BuildTarget(Target):
if t in self.kwargs: if t in self.kwargs:
self.kwargs[t] = listify(self.kwargs[t], flatten=True) self.kwargs[t] = listify(self.kwargs[t], flatten=True)
def extract_objects(self, srclist: T.List[FileOrString]) -> ExtractedObjects: def extract_objects(self, srclist: T.List['FileOrString']) -> ExtractedObjects:
obj_src: T.List['File'] = [] obj_src: T.List['File'] = []
sources_set = set(self.sources) sources_set = set(self.sources)
for src in srclist: for src in srclist:

@ -28,7 +28,6 @@ from ..mesonlib import PerMachine, Popen_safe, version_compare, MachineChoice, i
from ..programs import find_external_program, NonExistingExternalProgram from ..programs import find_external_program, NonExistingExternalProgram
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from ..environment import Environment
from ..programs import ExternalProgram from ..programs import ExternalProgram
TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]] TYPE_result = T.Tuple[int, T.Optional[str], T.Optional[str]]

@ -47,7 +47,7 @@ if T.TYPE_CHECKING:
from ..environment import Environment from ..environment import Environment
from ..linkers import DynamicLinker from ..linkers import DynamicLinker
from ..programs import ExternalProgram from ..programs import ExternalProgram
from .mixins.clike import CLikeCompiler as CompilerMixinBase CompilerMixinBase = CLikeCompiler
else: else:
CompilerMixinBase = object CompilerMixinBase = object

@ -33,11 +33,12 @@ from .compilers import (
from .mixins.gnu import GnuCompiler from .mixins.gnu import GnuCompiler
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from .compilers import Compiler as CompilerMixinBase
from ..programs import ExternalProgram from ..programs import ExternalProgram
from ..envconfig import MachineInfo from ..envconfig import MachineInfo
from ..environment import Environment from ..environment import Environment
from ..linkers import DynamicLinker from ..linkers import DynamicLinker
CompilerMixinBase = Compiler
else: else:
CompilerMixinBase = object CompilerMixinBase = object

@ -49,7 +49,6 @@ from mesonbuild import envconfig
if T.TYPE_CHECKING: if T.TYPE_CHECKING:
from configparser import ConfigParser from configparser import ConfigParser
from .dependencies import ExternalProgram
from .wrap.wrap import Resolver from .wrap.wrap import Resolver
build_filename = 'meson.build' build_filename = 'meson.build'

@ -13,7 +13,6 @@
# 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 mesonbuild import coredata
import os import os
import shutil import shutil
import typing as T import typing as T
@ -21,10 +20,10 @@ import xml.etree.ElementTree as ET
from . import ModuleReturnValue, ExtensionModule from . import ModuleReturnValue, ExtensionModule
from .. import build from .. import build
from .. import coredata
from .. import mlog from .. import mlog
from ..dependencies import find_external_dependency, Dependency, ExternalLibrary from ..dependencies import find_external_dependency, Dependency, ExternalLibrary
from ..mesonlib import MesonException, File, FileOrString, version_compare, Popen_safe from ..mesonlib import MesonException, File, FileOrString, version_compare, Popen_safe
from . import ModuleReturnValue, ExtensionModule
from ..interpreter import extract_required_kwarg from ..interpreter import extract_required_kwarg
from ..interpreter.type_checking import NoneType from ..interpreter.type_checking import NoneType
from ..interpreterbase import ContainerTypeInfo, FeatureDeprecated, KwargInfo, noPosargs, FeatureNew, typed_kwargs from ..interpreterbase import ContainerTypeInfo, FeatureDeprecated, KwargInfo, noPosargs, FeatureNew, typed_kwargs

Loading…
Cancel
Save