Skip to content

Commit

Permalink
refactor: use ruff formatter (#1224)
Browse files Browse the repository at this point in the history
Use ruff formatter in tox, and format the code base.
  • Loading branch information
IronCore864 authored May 24, 2024
1 parent 3c8c211 commit d8148ab
Show file tree
Hide file tree
Showing 33 changed files with 6,906 additions and 5,334 deletions.
4 changes: 0 additions & 4 deletions ops/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@
'__version__',
'main',
'pebble',

# From charm.py
'ActionEvent',
'ActionMeta',
Expand Down Expand Up @@ -95,7 +94,6 @@
'UpdateStatusEvent',
'UpgradeCharmEvent',
'WorkloadEvent',

# From framework.py
'BoundEvent',
'BoundStoredState',
Expand All @@ -118,10 +116,8 @@
'StoredSet',
'StoredState',
'StoredStateData',

# From jujuversion.py
'JujuVersion',

# From model.py
'ActiveStatus',
'Application',
Expand Down
8 changes: 4 additions & 4 deletions ops/_private/timeconv.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@
from typing import Union

# Matches yyyy-mm-ddTHH:MM:SS(.sss)ZZZ
_TIMESTAMP_RE = re.compile(
r'(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?(.*)')
_TIMESTAMP_RE = re.compile(r'(\d{4})-(\d{2})-(\d{2})[Tt](\d{2}):(\d{2}):(\d{2})(\.\d+)?(.*)')

# Matches [-+]HH:MM
_TIMEOFFSET_RE = re.compile(r'([-+])(\d{2}):(\d{2})')
Expand Down Expand Up @@ -59,8 +58,9 @@ def parse_rfc3339(s: str) -> datetime.datetime:
# standard library behaviour.
microsecond = min(microsecond, 999999)

return datetime.datetime(int(y), int(m), int(d), int(hh), int(mm), int(ss),
microsecond=microsecond, tzinfo=tz)
return datetime.datetime(
int(y), int(m), int(d), int(hh), int(mm), int(ss), microsecond=microsecond, tzinfo=tz
)


def parse_duration(s: str) -> datetime.timedelta:
Expand Down
Loading

0 comments on commit d8148ab

Please sign in to comment.