Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #503

Merged
merged 2 commits into from
Apr 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.15.2
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 23.12.1
rev: 24.3.0
hooks:
- id: black
language_version: python3
Expand All @@ -14,7 +14,7 @@ repos:
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.0.0
hooks:
- id: flake8
additional_dependencies:
Expand Down
12 changes: 6 additions & 6 deletions daphne/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,16 +270,16 @@ def run(self, args):
websocket_connect_timeout=args.websocket_connect_timeout,
websocket_handshake_timeout=args.websocket_connect_timeout,
application_close_timeout=args.application_close_timeout,
action_logger=AccessLogGenerator(access_log_stream)
if access_log_stream
else None,
action_logger=(
AccessLogGenerator(access_log_stream) if access_log_stream else None
),
root_path=args.root_path,
verbosity=args.verbosity,
proxy_forwarded_address_header=self._get_forwarded_host(args=args),
proxy_forwarded_port_header=self._get_forwarded_port(args=args),
proxy_forwarded_proto_header="X-Forwarded-Proto"
if args.proxy_headers
else None,
proxy_forwarded_proto_header=(
"X-Forwarded-Proto" if args.proxy_headers else None
),
server_name=args.server_name,
)
self.server.run()
8 changes: 5 additions & 3 deletions daphne/http_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,11 @@ def handle_reply(self, message):
"path": uri,
"status": self.code,
"method": self.method.decode("ascii", "replace"),
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr)
if self.client_addr
else None
),
"time_taken": self.duration(),
"size": self.sentLength,
},
Expand Down
24 changes: 12 additions & 12 deletions daphne/ws_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,9 +115,9 @@ def applicationCreateWorked(self, application_queue):
"connecting",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

Expand All @@ -138,9 +138,9 @@ def onOpen(self):
"connected",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

Expand Down Expand Up @@ -175,9 +175,9 @@ def onClose(self, wasClean, code, reason):
"disconnected",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

Expand Down Expand Up @@ -242,9 +242,9 @@ def serverReject(self):
"rejected",
{
"path": self.request.path,
"client": "%s:%s" % tuple(self.client_addr)
if self.client_addr
else None,
"client": (
"%s:%s" % tuple(self.client_addr) if self.client_addr else None
),
},
)

Expand Down