From 779ef6b0a9c864c2b1154a4a3159e775d3361d41 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 18 Apr 2022 10:20:26 -0700 Subject: [PATCH 1/2] fixing enum checker --- scripts/pylint_custom_plugin/pylint_guidelines_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylint_custom_plugin/pylint_guidelines_checker.py b/scripts/pylint_custom_plugin/pylint_guidelines_checker.py index f44725df8411..44c529bc14ca 100644 --- a/scripts/pylint_custom_plugin/pylint_guidelines_checker.py +++ b/scripts/pylint_custom_plugin/pylint_guidelines_checker.py @@ -1763,7 +1763,7 @@ def visit_classdef(self, node): self._enum_uppercase(node) # Else if it does not have a metaclass, but it is an enum class # Check both capitalization and throw pylint error for metaclass - elif node.bases[1].name == "Enum": + elif node.bases[0].name == "str" and node.bases[1].name == "Enum": self.add_message( "enum-must-inherit-case-insensitive-enum-meta", node=node, confidence=None ) From 1d26c33cd57a7dda1d3660a930688fc10241ec83 Mon Sep 17 00:00:00 2001 From: l0lawrence Date: Mon, 18 Apr 2022 10:33:04 -0700 Subject: [PATCH 2/2] extra space fix :( --- scripts/pylint_custom_plugin/pylint_guidelines_checker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/pylint_custom_plugin/pylint_guidelines_checker.py b/scripts/pylint_custom_plugin/pylint_guidelines_checker.py index 44c529bc14ca..3ee93d8c3e92 100644 --- a/scripts/pylint_custom_plugin/pylint_guidelines_checker.py +++ b/scripts/pylint_custom_plugin/pylint_guidelines_checker.py @@ -1763,7 +1763,7 @@ def visit_classdef(self, node): self._enum_uppercase(node) # Else if it does not have a metaclass, but it is an enum class # Check both capitalization and throw pylint error for metaclass - elif node.bases[0].name == "str" and node.bases[1].name == "Enum": + elif node.bases[0].name == "str" and node.bases[1].name == "Enum": self.add_message( "enum-must-inherit-case-insensitive-enum-meta", node=node, confidence=None )