Skip to content

Commit adf06f1

Browse files
committed
🎨 format
1 parent 2a21470 commit adf06f1

File tree

11 files changed

+846
-448
lines changed

11 files changed

+846
-448
lines changed

pdm.lock

Lines changed: 127 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
[tool.pdm]
2-
31
[project]
42
name = "arclet-cithun"
53
version = "0.1.0"
@@ -17,3 +15,30 @@ license = {text = "MIT"}
1715
[build-system]
1816
requires = ["pdm-backend"]
1917
build-backend = "pdm.backend"
18+
19+
[tool.pdm]
20+
21+
[tool.pdm.dev-dependencies]
22+
dev = [
23+
"isort>=5.13.2",
24+
"black>=24.2.0",
25+
]
26+
27+
[tool.black]
28+
line-length = 120
29+
target-version = ["py39", "py310", "py311"]
30+
include = '\.pyi?$'
31+
extend-exclude = '''
32+
'''
33+
34+
[tool.isort]
35+
profile = "black"
36+
line_length = 120
37+
skip_gitignore = true
38+
extra_standard_library = ["typing_extensions"]
39+
40+
[tool.pyright]
41+
pythonVersion = "3.9"
42+
pythonPlatform = "All"
43+
typeCheckingMode = "basic"
44+
disableBytesTypePromotions = true

src/arclet/cithun/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1+
from . import monitor as monitor
12
from .ctx import Context as Context
23
from .ctx import context as context
34
from .node import ROOT as ROOT
45
from .node import Node as Node
56
from .node import NodeState as NodeState
6-
from .owner import User as User
77
from .owner import Group as Group
8-
from . import monitor as monitor
8+
from .owner import User as User

src/arclet/cithun/ctx.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
from collections import UserDict
2-
from typing import Literal
3-
from contextvars import ContextVar
42
from contextlib import contextmanager
3+
from contextvars import ContextVar
4+
from typing import Literal
55

66

77
class Context(UserDict):
@@ -18,11 +18,7 @@ def __hash__(self):
1818
return hash(tuple(_res) + (_size,))
1919

2020
def __repr__(self):
21-
return (
22-
f"[{'|'.join(f'{k}={v}' for k, v in self.data.items())}]"
23-
if self.data
24-
else "[none]"
25-
)
21+
return f"[{'|'.join(f'{k}={v}' for k, v in self.data.items())}]" if self.data else "[none]"
2622

2723
@classmethod
2824
def from_string(cls, data: str):
@@ -33,9 +29,7 @@ def from_string(cls, data: str):
3329
_data[segs[0]] = segs[1]
3430
return cls(**_data)
3531

36-
def satisfied(
37-
self, other: "Context", mode: Literal["least_one", "all"] = "least_one"
38-
) -> bool:
32+
def satisfied(self, other: "Context", mode: Literal["least_one", "all"] = "least_one") -> bool:
3933
if not self.data:
4034
return True
4135
if not other.data:

0 commit comments

Comments
 (0)