Skip to content

Commit

Permalink
pyupgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
nim65s committed Mar 3, 2022
1 parent c4e0bb7 commit b66b971
Show file tree
Hide file tree
Showing 5 changed files with 38 additions and 3 deletions.
6 changes: 6 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,9 @@ repos:
rev: 4.0.1
hooks:
- id: flake8
- repo: https://github.com/asottile/pyupgrade
rev: v2.31.0
hooks:
- id: pyupgrade
args:
- --py38-plus
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- add pyupgrade
- add gitlab formatter for google chat & microsoft teams
in [#21](https://github.com/nim65s/matrix-webhook/pull/21)
by [@GhislainC](https://github.com/GhislainC)
Expand Down
4 changes: 2 additions & 2 deletions matrix_webhook/formatters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@ def github(data, headers):
"""Pretty-print a github notification."""
# TODO: Write nice useful formatters. This is only an example.
if headers["X-GitHub-Event"] == "push":
pusher, ref, a, b, c = [
pusher, ref, a, b, c = (
data[k] for k in ["pusher", "ref", "after", "before", "compare"]
]
)
pusher = f"[@{pusher['name']}](https://github.com/{pusher['name']})"
data["body"] = f"{pusher} pushed on {ref}: [{b}{a}]({c}):\n\n"
for commit in data["commits"]:
Expand Down
29 changes: 28 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ coverage = "^5.5"
black = "^21.6b0"
pydocstyle = "^6.1.1"
flake8 = "^3.9.2"
pyupgrade = "^2.31.0"

[tool.pydocstyle]
ignore = ["D200", "D203", "D204", "D212"]
Expand Down

0 comments on commit b66b971

Please sign in to comment.