Skip to content

Commit

Permalink
chore: update deps, lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GabDug committed Jan 17, 2024
1 parent daf1d10 commit 218f4e0
Show file tree
Hide file tree
Showing 7 changed files with 151 additions and 144 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
- id: fix-byte-order-marker
# Versions must be kept in sync with lockfile
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.1.11'
rev: 'v0.1.13'
hooks:
- id: ruff
args: [--fix, --exit-non-zero-on-fix]
Expand Down
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
python 3.11.6
direnv 2.32.1
node lts-hydrogen
pdm 2.10.4
pdm 2.12.1
6 changes: 4 additions & 2 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,10 @@ markdown_extensions:
plugins:
- autorefs
- include-markdown
- git-revision-date
- git-authors
- git-revision-date-localized:
enabled: !ENV [CI, false]
- git-authors:
enabled: !ENV [CI, false]
- markdown-exec
- search
- section-index
Expand Down
277 changes: 142 additions & 135 deletions pdm.lock

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ docs = [
"mike>=2.0.0",
"markdown-exec>=1.7",
"mkdocs-git-authors-plugin>=0.7.2",
"mkdocs-git-revision-date-localized-plugin>=1.2.2",
]
types = [
"django-stubs>=4.2.6",
Expand Down
5 changes: 1 addition & 4 deletions src/firefighter/firefighter/filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,15 @@ def get_item(dictionary: dict[str, Any], key: Any) -> Any:
Returns:
Any: The value of the key in the dictionary or object.
"""
# pylint: disable=unnecessary-dunder-call
if hasattr(dictionary, key):
return getattr(dictionary, key)
if hasattr(dictionary, "__getitem__"):
try:
return dictionary.__getitem__(key)
return dictionary[key]
except KeyError:
pass
if hasattr(dictionary, "get"):
return dictionary.get(key)
if hasattr(dictionary, "__contains__"):
return key in dictionary
if not isinstance(dictionary, dict):
dictionary = dictionary.__dict__ # type: ignore

Expand Down
2 changes: 1 addition & 1 deletion src/firefighter/slack/models/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Meta(TypedModelMeta):
]

def __str__(self) -> str:
return f"{self.ts}@{self.conversation.name}: {self.text} {self.__repr__()}"
return f"{self.ts}@{self.conversation.name}: {self.text} {self!r}"

def get_absolute_url(self) -> str:
return self.get_permalink
Expand Down

0 comments on commit 218f4e0

Please sign in to comment.