Skip to content

Commit d5509d6

Browse files
committed
Enable Ruff lint
1 parent 04f9288 commit d5509d6

File tree

4 files changed

+7
-5
lines changed

4 files changed

+7
-5
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ select = [
1616
# eradicate commented code
1717
"ERA",
1818
# ruff lint
19-
# "RUF",
19+
"RUF",
2020
]
2121
ignore = [
2222
# `format` will wrap lines.

src/dockerflow/django/middleware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import logging
22
import re
33
import time
4+
import typing
45
import uuid
56

67
from django.utils.deprecation import MiddlewareMixin
@@ -14,7 +15,7 @@ class DockerflowMiddleware(MiddlewareMixin):
1415
https://github.com/mozilla-services/Dockerflow/blob/main/docs/mozlog.md
1516
"""
1617

17-
viewpatterns = [
18+
viewpatterns: typing.ClassVar = [
1819
(re.compile(r"/__version__/?$"), views.version),
1920
(re.compile(r"/__heartbeat__/?$"), views.heartbeat),
2021
(re.compile(r"/__lbheartbeat__/?$"), views.lbheartbeat),

src/dockerflow/logging.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import socket
99
import sys
1010
import traceback
11+
import typing
1112

1213

1314
class SafeJSONEncoder(json.JSONEncoder):
@@ -32,7 +33,7 @@ class JsonLogFormatter(logging.Formatter):
3233
LOGGING_FORMAT_VERSION = "2.0"
3334

3435
# Map from Python logging to Syslog severity levels
35-
SYSLOG_LEVEL_MAP = {
36+
SYSLOG_LEVEL_MAP: typing.ClassVar = {
3637
50: 2, # CRITICAL
3738
40: 3, # ERROR
3839
30: 4, # WARNING
@@ -43,7 +44,7 @@ class JsonLogFormatter(logging.Formatter):
4344
# Syslog level to use when/if python level isn't found in map
4445
DEFAULT_SYSLOG_LEVEL = 7
4546

46-
EXCLUDED_LOGRECORD_ATTRS = set(
47+
EXCLUDED_LOGRECORD_ATTRS: typing.ClassVar = set(
4748
(
4849
"args",
4950
"asctime",

tests/flask/migrations/env.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from logging.config import fileConfig
55

66
from alembic import context # no:qa
7-
from flask import current_app # noqa
7+
from flask import current_app
88
from sqlalchemy import engine_from_config, pool
99

1010
# this is the Alembic Config object, which provides

0 commit comments

Comments
 (0)