Skip to content

Commit c4ae0e8

Browse files
🚨 Configure ruff, fix typo in readme.
1 parent 43dd1d1 commit c4ae0e8

4 files changed

Lines changed: 24 additions & 25 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,5 +26,5 @@ Request signatures should be verified using the raw body
2626

2727
1. Messages contain events related to a single event, which can be user action or one of the internal HubSpot mechanisms. They are typically related to a single object, but not always.
2828
2. Events in a message are not ordered. propertyChange enevts may appear before creation events.
29-
3. The model only workds with the new style [generic webhook subscriptions](https://developers.hubspot.com/docs/guides/apps/public-apps/create-generic-webhook-subscriptions).
29+
3. The model only works with the new style [generic webhook subscriptions](https://developers.hubspot.com/docs/guides/apps/public-apps/create-generic-webhook-subscriptions).
3030
4. Only a subset of objects is included. Feel free to create Pull Requests with additional models as needed.

pyproject.toml

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ readme = "README.md"
3535
requires-python = ">=3.9"
3636
version = "0.1.0"
3737

38+
[dependency-groups]
39+
dev = [
40+
"pytest>=8.3",
41+
]
3842

3943
[tool.mypy]
4044
python_version = "3.9"
@@ -44,8 +48,7 @@ ignore_missing_imports = true
4448

4549
[tool.ruff]
4650
target-version = "py39"
51+
line-length = 140
4752

48-
[dependency-groups]
49-
dev = [
50-
"pytest>=8.3",
51-
]
53+
[tool.ruff.format]
54+
quote-style = "single"

src/hubspot_webhook_model/__init__.py

Lines changed: 14 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ class Event(
88
msgspec.Struct,
99
frozen=True,
1010
forbid_unknown_fields=True,
11-
rename="camel",
12-
tag_field="subscriptionType",
11+
rename='camel',
12+
tag_field='subscriptionType',
1313
): # type: ignore[call-arg]
1414
app_id: int
1515
attempt_number: int
@@ -23,35 +23,31 @@ class Event(
2323
source_id: Optional[str] = None
2424

2525

26-
class CRUDEvent(
27-
Event, frozen=True, forbid_unknown_fields=True, rename="camel", kw_only=True
28-
): # type: ignore[call-arg]
26+
class CRUDEvent(Event, frozen=True, forbid_unknown_fields=True, rename='camel', kw_only=True): # type: ignore[call-arg]
2927
object_id: int
3028
object_type_id: str
3129

3230

33-
class Change(
34-
CRUDEvent, frozen=True, forbid_unknown_fields=True, rename="camel", kw_only=True
35-
): # type: ignore[call-arg]
31+
class Change(CRUDEvent, frozen=True, forbid_unknown_fields=True, rename='camel', kw_only=True): # type: ignore[call-arg]
3632
change_flag: str
3733

3834

3935
class Creation(
4036
Change,
4137
frozen=True,
4238
forbid_unknown_fields=True,
43-
rename="camel",
44-
tag="object.creation",
39+
rename='camel',
40+
tag='object.creation',
4541
): # type: ignore[call-arg]
4642
pass
4743

4844

4945
class AssociationChange(
5046
Event,
51-
tag="object.associationChange",
47+
tag='object.associationChange',
5248
frozen=True,
5349
forbid_unknown_fields=True,
54-
rename="camel",
50+
rename='camel',
5551
kw_only=True,
5652
): # type: ignore[call-arg]
5753
association_category: str
@@ -67,10 +63,10 @@ class AssociationChange(
6763

6864
class PropertyChange(
6965
CRUDEvent,
70-
tag="object.propertyChange",
66+
tag='object.propertyChange',
7167
frozen=True,
7268
forbid_unknown_fields=True,
73-
rename="camel",
69+
rename='camel',
7470
kw_only=True,
7571
): # type: ignore[call-arg]
7672
is_sensitive: bool
@@ -81,21 +77,21 @@ class PropertyChange(
8177

8278
class Deletion(
8379
Change,
84-
tag="object.deletion",
80+
tag='object.deletion',
8581
frozen=True,
8682
forbid_unknown_fields=True,
87-
rename="camel",
83+
rename='camel',
8884
kw_only=True,
8985
): # type: ignore[call-arg]
9086
pass
9187

9288

9389
class Merge(
9490
CRUDEvent,
95-
tag="object.merge",
91+
tag='object.merge',
9692
frozen=True,
9793
forbid_unknown_fields=True,
98-
rename="camel",
94+
rename='camel',
9995
kw_only=True,
10096
): # type: ignore[call-arg]
10197
new_object_id: int

tests/test_parse.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66

77

88
def test_parse():
9-
for p in Path("tests").glob("*.json"):
9+
for p in Path('tests').glob('*.json'):
1010
msgspec.json.decode(p.read_bytes(), type=Event_)
1111

1212

1313
def test_parse_all():
14-
data = "[" + ",".join(p.read_text() for p in Path("tests").glob("*.json")) + "]"
14+
data = '[' + ','.join(p.read_text() for p in Path('tests').glob('*.json')) + ']'
1515
model = msgspec.json.decode(data, type=Message)
1616
assert model

0 commit comments

Comments
 (0)