Skip to content

Commit

Permalink
Fix linting with the new rules
Browse files Browse the repository at this point in the history
  • Loading branch information
javierdelapuente committed Mar 5, 2024
1 parent df58dff commit 5eb2bef
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
"""

import logging
import typing

import ops
from ops import pebble

# Log messages can be retrieved using juju debug-log
logger = logging.getLogger(__name__)
Expand All @@ -26,7 +28,7 @@
class IsCharmsTemplateCharm(ops.CharmBase):
"""Charm the service."""

def __init__(self, *args):
def __init__(self, *args: typing.Any):
"""Construct.
Args:
Expand All @@ -36,7 +38,7 @@ def __init__(self, *args):
self.framework.observe(self.on.httpbin_pebble_ready, self._on_httpbin_pebble_ready)
self.framework.observe(self.on.config_changed, self._on_config_changed)

def _on_httpbin_pebble_ready(self, event: ops.PebbleReadyEvent):
def _on_httpbin_pebble_ready(self, event: ops.PebbleReadyEvent) -> None:
"""Define and start a workload using the Pebble API.
Change this example to suit your needs. You'll need to specify the right entrypoint and
Expand All @@ -57,7 +59,7 @@ def _on_httpbin_pebble_ready(self, event: ops.PebbleReadyEvent):
# https://juju.is/docs/sdk/constructs#heading--statuses
self.unit.status = ops.ActiveStatus()

def _on_config_changed(self, event: ops.ConfigChangedEvent):
def _on_config_changed(self, event: ops.ConfigChangedEvent) -> None:
"""Handle changed configuration.
Change this example to suit your needs. If you don't need to handle config, you can remove
Expand Down Expand Up @@ -92,7 +94,7 @@ def _on_config_changed(self, event: ops.ConfigChangedEvent):
self.unit.status = ops.BlockedStatus("invalid log level: '{log_level}'")

@property
def _pebble_layer(self):
def _pebble_layer(self) -> typing.Union[pebble.LayerDict]:
"""Return a dictionary representing a Pebble layer."""
return {
"summary": "httpbin layer",
Expand Down

0 comments on commit 5eb2bef

Please sign in to comment.