summaryrefslogtreecommitdiff
path: root/buildscripts/idl
diff options
context:
space:
mode:
authorDavid Bradford <david.bradford@mongodb.com>2021-03-01 12:35:13 -0500
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-03-01 23:46:55 +0000
commita22cbaba0634e6d20244b75c94e8e693e961399d (patch)
tree37cbc45eae4d174299f33515ea97214789b9cb75 /buildscripts/idl
parentfae0542f9ff0be300a5a6d1eb901b15f5a0953dd (diff)
downloadmongo-a22cbaba0634e6d20244b75c94e8e693e961399d.tar.gz
SERVER-54861: Update pylint to 2.7.2
Diffstat (limited to 'buildscripts/idl')
-rw-r--r--buildscripts/idl/check_versioned_api_commands_have_idl_definitions.py2
-rw-r--r--buildscripts/idl/idl/binder.py2
-rw-r--r--buildscripts/idl/idl/errors.py4
-rw-r--r--buildscripts/idl/idl/generator.py2
-rw-r--r--buildscripts/idl/tests/test_parser.py6
-rw-r--r--buildscripts/idl/tests/testcase.py1
6 files changed, 9 insertions, 8 deletions
diff --git a/buildscripts/idl/check_versioned_api_commands_have_idl_definitions.py b/buildscripts/idl/check_versioned_api_commands_have_idl_definitions.py
index 1ed5ba9694c..97f9f9a721d 100644
--- a/buildscripts/idl/check_versioned_api_commands_have_idl_definitions.py
+++ b/buildscripts/idl/check_versioned_api_commands_have_idl_definitions.py
@@ -42,7 +42,7 @@ from pymongo import MongoClient
# Permit imports from "buildscripts".
sys.path.append(os.path.normpath(os.path.join(os.path.abspath(__file__), '../../..')))
-# pylint: disable=wrong-import-position
+# pylint: disable=wrong-import-position,wrong-import-order
from buildscripts.resmokelib import configure_resmoke
from buildscripts.resmokelib.logging import loggers
from buildscripts.resmokelib.testing.fixtures import interface
diff --git a/buildscripts/idl/idl/binder.py b/buildscripts/idl/idl/binder.py
index 3a6ea97531c..582c63128cb 100644
--- a/buildscripts/idl/idl/binder.py
+++ b/buildscripts/idl/idl/binder.py
@@ -1055,7 +1055,7 @@ def _validate_enum_int(ctxt, idl_enum):
min_value = min(int_values_set)
max_value = max(int_values_set)
- valid_int = {x for x in range(min_value, max_value + 1)}
+ valid_int = set(range(min_value, max_value + 1))
if valid_int != int_values_set:
ctxt.add_enum_non_continuous_range_error(idl_enum, idl_enum.name)
diff --git a/buildscripts/idl/idl/errors.py b/buildscripts/idl/idl/errors.py
index 890025789c6..3e0e6a2fbbc 100644
--- a/buildscripts/idl/idl/errors.py
+++ b/buildscripts/idl/idl/errors.py
@@ -682,13 +682,13 @@ class ParserContext(object):
" struct '%s' is marked as immutable.") % (field_name, struct_name, struct_name))
def add_useless_variant_error(self, location):
- # type: (common.SourceLocation,) -> None
+ # type: (common.SourceLocation) -> None
"""Add an error about a variant with 0 or 1 variant types."""
self._add_error(location, ERROR_ID_USELESS_VARIANT,
("Cannot declare a variant with only 0 or 1 variant types"))
def add_variant_comparison_error(self, location):
- # type: (common.SourceLocation,) -> None
+ # type: (common.SourceLocation) -> None
"""Add an error about a struct with generate_comparison_operators and a variant field."""
self._add_error(location, ERROR_ID_VARIANT_COMPARISON,
("generate_comparison_operators is not supported with variant types"))
diff --git a/buildscripts/idl/idl/generator.py b/buildscripts/idl/idl/generator.py
index 9d8a7c6de05..b3b2d08fdf0 100644
--- a/buildscripts/idl/idl/generator.py
+++ b/buildscripts/idl/idl/generator.py
@@ -1745,7 +1745,7 @@ class _CppSourceFileWriter(_CppFileWriterBase):
self._writer.write_line(
'%s object(localNS);' % (common.title_case(struct.cpp_name)))
else:
- assert "Missing case"
+ assert False, "Missing case"
else:
self._writer.write_line('%s object;' % common.title_case(struct.cpp_name))
diff --git a/buildscripts/idl/tests/test_parser.py b/buildscripts/idl/tests/test_parser.py
index 1866216d508..794b79342cf 100644
--- a/buildscripts/idl/tests/test_parser.py
+++ b/buildscripts/idl/tests/test_parser.py
@@ -1446,7 +1446,7 @@ class TestParser(testcase.IDLTestcase):
# type: () -> None
"""Negative unstable-field test cases."""
self.assert_parse_fail(
- textwrap.dedent(f"""
+ textwrap.dedent("""
commands:
foo:
description: foo
@@ -1464,7 +1464,7 @@ class TestParser(testcase.IDLTestcase):
# type: () -> None
"""Positive same command_name with different api_version test cases."""
self.assert_parse(
- textwrap.dedent(f"""
+ textwrap.dedent("""
commands:
foo:
description: foo
@@ -1692,7 +1692,7 @@ class TestParser(testcase.IDLTestcase):
# The 'command_name' and 'command_alias' fields cannot have same value.
self.assert_parse_fail(
- textwrap.dedent(f"""
+ textwrap.dedent("""
commands:
foo:
description: foo
diff --git a/buildscripts/idl/tests/testcase.py b/buildscripts/idl/tests/testcase.py
index 0a4cf59e050..f1ad1153a77 100644
--- a/buildscripts/idl/tests/testcase.py
+++ b/buildscripts/idl/tests/testcase.py
@@ -64,6 +64,7 @@ class NothingImportResolver(idl.parser.ImportResolverBase):
class IDLTestcase(unittest.TestCase):
"""IDL Test case base class."""
+ # pylint: disable=inconsistent-return-statements
def _parse(self, doc_str, resolver):
# type: (str, idl.parser.ImportResolverBase) -> idl.syntax.IDLParsedSpec
"""Parse a document and throw a unittest failure if it fails to parse as a valid YAML document."""