mirror of
https://github.com/SELinuxProject/setools
synced 2025-01-30 03:32:42 +00:00
Remove pylint unsubscriptable-object exemptions.
Several class annotations were subscripted but pylint had a bug that did not handle this. This is now fixed in pylint 2.8+. Signed-off-by: Chris PeBenito <pebenito@ieee.org>
This commit is contained in:
parent
52efadf5d1
commit
36a4d851fa
@ -99,8 +99,7 @@ class BoundsDifference(Difference):
|
||||
self._right_typebounds = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class BoundsWrapper(Wrapper[Bounds]): # pylint: disable=unsubscriptable-object
|
||||
class BoundsWrapper(Wrapper[Bounds]):
|
||||
|
||||
"""Wrap *bounds for diff purposes."""
|
||||
|
||||
|
@ -43,8 +43,7 @@ def conditional_wrapper_factory(cond: Conditional) -> "ConditionalWrapper":
|
||||
return a
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class ConditionalWrapper(Wrapper[Conditional]): # pylint: disable=unsubscriptable-object
|
||||
class ConditionalWrapper(Wrapper[Conditional]):
|
||||
|
||||
"""Wrap conditional policy expressions to allow comparisons by truth table."""
|
||||
|
||||
|
@ -174,8 +174,7 @@ class ConstraintsDifference(Difference):
|
||||
self._right_constraints = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class ConstraintWrapper(Wrapper[AnyConstraint]): # pylint: disable=unsubscriptable-object
|
||||
class ConstraintWrapper(Wrapper[AnyConstraint]):
|
||||
|
||||
"""Wrap constraints for diff purposes."""
|
||||
|
||||
|
@ -30,8 +30,7 @@ from .types import type_wrapper_factory
|
||||
from .users import user_wrapper_factory
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class ContextWrapper(Wrapper[Context]): # pylint: disable=unsubscriptable-object
|
||||
class ContextWrapper(Wrapper[Context]):
|
||||
|
||||
"""Wrap contexts to allow comparisons."""
|
||||
|
||||
|
@ -98,8 +98,7 @@ class DefaultsDifference(Difference):
|
||||
self.modified_defaults = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class DefaultWrapper(Wrapper[Default]): # pylint: disable=unsubscriptable-object
|
||||
class DefaultWrapper(Wrapper[Default]):
|
||||
|
||||
"""Wrap default_* to allow comparisons."""
|
||||
|
||||
|
@ -169,8 +169,7 @@ class Wrapper(ABC, Generic[T]):
|
||||
S = TypeVar("S", bound=PolicySymbol)
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class SymbolWrapper(Wrapper[S]): # pylint: disable=unsubscriptable-object
|
||||
class SymbolWrapper(Wrapper[S]):
|
||||
|
||||
"""
|
||||
General wrapper for policy symbols, e.g. types, roles
|
||||
|
@ -74,8 +74,7 @@ class FSUsesDifference(Difference):
|
||||
self.modified_fs_uses = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class FSUseWrapper(Wrapper[FSUse]): # pylint: disable=unsubscriptable-object
|
||||
class FSUseWrapper(Wrapper[FSUse]):
|
||||
|
||||
"""Wrap fs_use_* rules to allow set operations."""
|
||||
|
||||
|
@ -74,8 +74,7 @@ class GenfsconsDifference(Difference):
|
||||
self.modified_genfscons = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class GenfsconWrapper(Wrapper[Genfscon]): # pylint: disable=unsubscriptable-object
|
||||
class GenfsconWrapper(Wrapper[Genfscon]):
|
||||
|
||||
"""Wrap genfscon rules to allow set operations."""
|
||||
|
||||
|
@ -73,8 +73,7 @@ class IbendportconsDifference(Difference):
|
||||
self.modified_ibendportcons = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class IbendportconWrapper(Wrapper[Ibendportcon]): # pylint: disable=unsubscriptable-object
|
||||
class IbendportconWrapper(Wrapper[Ibendportcon]):
|
||||
|
||||
"""Wrap ibendportcon statements for diff purposes."""
|
||||
|
||||
|
@ -74,8 +74,7 @@ class IbpkeyconsDifference(Difference):
|
||||
self.modified_ibpkeycons = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class IbpkeyconWrapper(Wrapper[Ibpkeycon]): # pylint: disable=unsubscriptable-object
|
||||
class IbpkeyconWrapper(Wrapper[Ibpkeycon]):
|
||||
|
||||
"""Wrap ibpkeycon statements for diff purposes."""
|
||||
|
||||
|
@ -218,8 +218,7 @@ class LevelDeclsDifference(Difference):
|
||||
self.modified_levels = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class LevelDeclWrapper(Wrapper[LevelDecl]): # pylint: disable=unsubscriptable-object
|
||||
class LevelDeclWrapper(Wrapper[LevelDecl]):
|
||||
|
||||
"""Wrap level declarations to allow comparisons."""
|
||||
|
||||
@ -242,8 +241,7 @@ class LevelDeclWrapper(Wrapper[LevelDecl]): # pylint: disable=unsubscriptable-o
|
||||
return self.sensitivity < other.sensitivity
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class LevelWrapper(Wrapper[Level]): # pylint: disable=unsubscriptable-object
|
||||
class LevelWrapper(Wrapper[Level]):
|
||||
|
||||
"""Wrap levels to allow comparisons."""
|
||||
|
||||
@ -276,8 +274,7 @@ class LevelWrapper(Wrapper[Level]): # pylint: disable=unsubscriptable-object
|
||||
return False
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class RangeWrapper(Wrapper[Range]): # pylint: disable=unsubscriptable-object
|
||||
class RangeWrapper(Wrapper[Range]):
|
||||
|
||||
"""
|
||||
Wrap ranges to allow comparisons.
|
||||
|
@ -115,8 +115,7 @@ class MLSRulesDifference(Difference):
|
||||
self._right_mls_rules = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class MLSRuleWrapper(Wrapper[MLSRule]): # pylint: disable=unsubscriptable-object
|
||||
class MLSRuleWrapper(Wrapper[MLSRule]):
|
||||
|
||||
"""Wrap MLS rules to allow set operations."""
|
||||
|
||||
|
@ -89,8 +89,7 @@ class NetifconsDifference(Difference):
|
||||
self.modified_netifcons = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class NetifconWrapper(Wrapper[Netifcon]): # pylint: disable=unsubscriptable-object
|
||||
class NetifconWrapper(Wrapper[Netifcon]):
|
||||
|
||||
"""Wrap netifcon statements for diff purposes."""
|
||||
|
||||
|
@ -74,8 +74,7 @@ class NodeconsDifference(Difference):
|
||||
self.modified_nodecons = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class NodeconWrapper(Wrapper[Nodecon]): # pylint: disable=unsubscriptable-object
|
||||
class NodeconWrapper(Wrapper[Nodecon]):
|
||||
|
||||
"""Wrap nodecon statements for diff purposes."""
|
||||
|
||||
|
@ -73,8 +73,7 @@ class PortconsDifference(Difference):
|
||||
self.modified_portcons = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class PortconWrapper(Wrapper[Portcon]): # pylint: disable=unsubscriptable-object
|
||||
class PortconWrapper(Wrapper[Portcon]):
|
||||
|
||||
"""Wrap portcon statements for diff purposes."""
|
||||
|
||||
|
@ -137,8 +137,7 @@ class RBACRulesDifference(Difference):
|
||||
self._right_rbac_rules = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class RoleAllowWrapper(Wrapper[RoleAllow]): # pylint: disable=unsubscriptable-object
|
||||
class RoleAllowWrapper(Wrapper[RoleAllow]):
|
||||
|
||||
"""Wrap role allow rules to allow set operations."""
|
||||
|
||||
@ -162,8 +161,7 @@ class RoleAllowWrapper(Wrapper[RoleAllow]): # pylint: disable=unsubscriptable-o
|
||||
return self.source == other.source and self.target == other.target
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class RoleTransitionWrapper(Wrapper[RoleTransition]): # pylint: disable=unsubscriptable-object
|
||||
class RoleTransitionWrapper(Wrapper[RoleTransition]):
|
||||
|
||||
"""Wrap role_transition rules to allow set operations."""
|
||||
|
||||
|
@ -550,8 +550,7 @@ class TERulesDifference(Difference):
|
||||
self._right_te_rules = None
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class AVRuleXpermWrapper(Wrapper[AVRuleXperm]): # pylint: disable=unsubscriptable-object
|
||||
class AVRuleXpermWrapper(Wrapper[AVRuleXperm]):
|
||||
|
||||
"""Wrap extended permission access vector rules to allow set operations."""
|
||||
|
||||
@ -581,8 +580,7 @@ class AVRuleXpermWrapper(Wrapper[AVRuleXperm]): # pylint: disable=unsubscriptab
|
||||
self.xperm_type == other.xperm_type
|
||||
|
||||
|
||||
# Pylint bug: https://github.com/PyCQA/pylint/issues/2822
|
||||
class TERuleWrapper(Wrapper): # pylint: disable=unsubscriptable-object
|
||||
class TERuleWrapper(Wrapper):
|
||||
|
||||
"""Wrap type_* rules to allow set operations."""
|
||||
|
||||
|
2
tox.ini
2
tox.ini
@ -23,7 +23,7 @@ commands = coverage run setup.py test -q
|
||||
|
||||
[testenv:lint]
|
||||
deps = {[testenv]deps}
|
||||
pylint
|
||||
pylint>=2.8.0
|
||||
commands_pre = pylint --version
|
||||
{envpython} setup.py build_ext -i
|
||||
commands = pylint -E --rcfile .pylintrc setools tests seinfo seinfoflow sedta sesearch sediff sechecker
|
||||
|
Loading…
Reference in New Issue
Block a user