Skip to content

Commit

Permalink
Remove unnecessary pass statement (FIX: PIE790) (#929)
Browse files Browse the repository at this point in the history
  • Loading branch information
ogenstad authored Jun 24, 2024
1 parent 67448b2 commit e50db1b
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 14 deletions.
10 changes: 0 additions & 10 deletions nornir/core/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,24 @@ class ConnectionAlreadyOpen(ConnectionException):
Raised when opening an already opened connection
"""

pass


class ConnectionNotOpen(ConnectionException):
"""
Raised when trying to close a connection that isn't open
"""

pass


class PluginAlreadyRegistered(Exception):
"""
Raised when trying to register an already registered plugin
"""

pass


class PluginNotRegistered(Exception):
"""
Raised when trying to access a plugin that is not registered
"""

pass


class NornirExecutionError(Exception):
"""
Expand Down Expand Up @@ -96,8 +88,6 @@ class NornirNoValidInventoryError(Exception):
Raised by nornir when :meth:`nornir.plugins.inventory.parse` fails to load any valid inventory
"""

pass


class ConflictingConfigurationWarning(UserWarning):
pass
3 changes: 0 additions & 3 deletions nornir/core/plugins/connections.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,15 @@ def open(
Connect to the device and populate the attribute :attr:`connection` with
the underlying connection
"""
pass

def close(self) -> None:
"""Close the connection with the device"""
pass

@property
def connection(self) -> Any:
"""
Established connection
"""
pass


ConnectionPluginRegister: PluginRegister[Type[ConnectionPlugin]] = PluginRegister(
Expand Down
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,6 @@ ignore = [
"N804", # First argument of a class method should be named `cls`
"PERF203", # `try`-`except` within a loop incurs performance overhead
"PGH004", # Use specific rule codes when using `noqa`
"PIE790", # Unnecessary `pass` statement
"PIE800", # Unnecessary spread `**`
"PLC0205", # Class `__slots__` should be a non-string iterable
"PLC2801", # Unnecessary dunder call to `__getattribute__`. Access attribute directly or use getattr built-in function
Expand Down

0 comments on commit e50db1b

Please sign in to comment.