Skip to content

Commit a04ba4f

Browse files
committed
Ruff
1 parent 2ede4c9 commit a04ba4f

File tree

8 files changed

+24
-10
lines changed

8 files changed

+24
-10
lines changed

plain-dev/plain/dev/cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from .db import cli as db_cli
1414
from .pid import Pid
1515
from .services import Services
16-
from .utils import plainpackage_installed, has_pyproject_toml
16+
from .utils import has_pyproject_toml, plainpackage_installed
1717

1818
try:
1919
import tomllib

plain-dev/plain/dev/config.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ class Config(PackageConfig):
1010

1111
def ready(self):
1212
# Symlink the plain package into .plain so we can look at it easily
13-
plain_path = Path(importlib.util.find_spec("plain.runtime").origin).parent.parent
13+
plain_path = Path(
14+
importlib.util.find_spec("plain.runtime").origin
15+
).parent.parent
1416
if not settings.BOLT_TEMP_PATH.exists():
1517
settings.BOLT_TEMP_PATH.mkdir()
1618
src_path = settings.BOLT_TEMP_PATH / "src"

plain-dev/plain/dev/services.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ def get_services(root):
2828
pyproject = tomllib.load(f)
2929

3030
return (
31-
pyproject.get("tool", {}).get("plain", {}).get("dev", {}).get("services", {})
31+
pyproject.get("tool", {})
32+
.get("plain", {})
33+
.get("dev", {})
34+
.get("services", {})
3235
)
3336

3437
def __init__(self):

plain-tailwind/plain/tailwind/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,9 +106,9 @@ def set_version_in_config(self, version):
106106
with open(pyproject_path) as f:
107107
config = tomlkit.load(f)
108108

109-
config.setdefault("tool", {}).setdefault("plain", {}).setdefault("tailwind", {})[
110-
"version"
111-
] = version
109+
config.setdefault("tool", {}).setdefault("plain", {}).setdefault(
110+
"tailwind", {}
111+
)["version"] = version
112112

113113
with open(pyproject_path, "w") as f:
114114
tomlkit.dump(config, f)

plain/plain/internal/files/uploadhandler.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44
import os
55
from io import BytesIO
66

7-
from plain.internal.files.uploadedfile import InMemoryUploadedFile, TemporaryUploadedFile
7+
from plain.internal.files.uploadedfile import (
8+
InMemoryUploadedFile,
9+
TemporaryUploadedFile,
10+
)
811
from plain.runtime import settings
912
from plain.utils.module_loading import import_string
1013

plain/plain/internal/handlers/exception.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,9 @@ def response_for_exception(request, exc):
8585

8686
# The request logger receives events for any problematic request
8787
# The security logger receives events for all SuspiciousOperations
88-
security_logger = logging.getLogger("plain.security.%s" % exc.__class__.__name__)
88+
security_logger = logging.getLogger(
89+
"plain.security.%s" % exc.__class__.__name__
90+
)
8991
security_logger.error(
9092
str(exc),
9193
exc_info=exc,

plain/plain/preflight/security/base.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,9 @@ def _security_middleware():
138138

139139

140140
def _xframe_middleware():
141-
return "plain.middleware.clickjacking.XFrameOptionsMiddleware" in settings.MIDDLEWARE
141+
return (
142+
"plain.middleware.clickjacking.XFrameOptionsMiddleware" in settings.MIDDLEWARE
143+
)
142144

143145

144146
@register(deploy=True)

plain/tests/test_runtime.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from plain.runtime import settings
2-
from plain.runtime import setup as plain_setup # Rename so pytest doesn't call setup()...
2+
from plain.runtime import (
3+
setup as plain_setup, # Rename so pytest doesn't call setup()...
4+
)
35

46

57
def test_setup():

0 commit comments

Comments
 (0)