Skip to content

Commit 40d65e7

Browse files
committed
Format files with black to pass make lint
1 parent dfc541c commit 40d65e7

File tree

8 files changed

+21
-69
lines changed

8 files changed

+21
-69
lines changed

mozilla_schema_generator/common_ping.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,7 @@ def get_schema(self):
4141
def _update_env(self, schema):
4242
integer = {"type": "integer"}
4343
string = {"type": "string"}
44-
string_map = {
45-
"type": "object",
46-
"additionalProperties": string,
47-
}
44+
string_map = {"type": "object", "additionalProperties": string}
4845

4946
def with_description(dtype: dict, comment: str) -> dict:
5047
"""Add a description to the types defined above."""

mozilla_schema_generator/probes.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,11 @@ class MainProbe(Probe):
6868

6969
first_added_key = "first_added"
7070

71-
histogram_schema = {
72-
"type": "string",
73-
}
71+
histogram_schema = {"type": "string"}
7472

7573
parent_processes = {"main"}
7674

77-
child_processes = {
78-
"content",
79-
"gpu",
80-
"extension",
81-
"dynamic",
82-
"socket",
83-
}
75+
child_processes = {"content", "gpu", "extension", "dynamic", "socket"}
8476

8577
processes_map = {
8678
"all_childs": child_processes,

setup.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,16 +33,10 @@
3333
"console_scripts": [
3434
"mozilla-schema-generator=mozilla_schema_generator.__main__:main",
3535
"validate-bigquery=mozilla_schema_generator.validate_bigquery:validate",
36-
],
36+
]
3737
},
3838
include_package_data=True,
39-
install_requires=[
40-
"click",
41-
"jsonschema",
42-
"pyyaml",
43-
"requests",
44-
"gitpython",
45-
],
39+
install_requires=["click", "jsonschema", "pyyaml", "requests", "gitpython"],
4640
license="MIT",
4741
zip_safe=False,
4842
keywords="mozilla-schema-generator",

tests/test_integration.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ def test_split_representation(self, schema, env, probes): # noqa F811
102102
"properties": {"test_probe": MainProbe.histogram_schema},
103103
},
104104
},
105-
},
105+
}
106106
],
107107
"nested": [
108108
{
@@ -231,10 +231,7 @@ def test_max_size(self, schema, env, probes): # noqa F811
231231
{
232232
"second_level": False,
233233
"details": {"keyed": False},
234-
"versions": {
235-
"first": "50",
236-
"last": "60",
237-
},
234+
"versions": {"first": "50", "last": "60"},
238235
}
239236
]
240237
},

tests/test_matcher.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,7 @@
1111
class TestMatcher(object):
1212
def test_matches(self):
1313
match_obj = {
14-
"details": {
15-
"record_in_processes": {"contains": "main"},
16-
"keyed": True,
17-
},
14+
"details": {"record_in_processes": {"contains": "main"}, "keyed": True},
1815
"table_group": "keyed_scalars",
1916
"type": "scalar",
2017
}

tests/test_probes.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,15 @@ def glean_probe_defn():
1919
"first": "2019-04-12 13:44:13",
2020
"last": "2019-08-08 15:34:03",
2121
},
22-
"send_in_pings": [
23-
"metrics",
24-
],
22+
"send_in_pings": ["metrics"],
2523
},
2624
{
2725
"description": "Glean test description",
2826
"dates": {
2927
"first": "2019-08-08 15:34:14",
3028
"last": "2019-08-08 15:45:14",
3129
},
32-
"send_in_pings": [
33-
"all-pings",
34-
],
30+
"send_in_pings": ["all-pings"],
3531
},
3632
],
3733
"name": "glean.error.invalid_value",
@@ -48,18 +44,14 @@ def glean_probe_defn_subset_pings():
4844
"first": "2019-04-12 13:44:13",
4945
"last": "2019-08-08 15:34:03",
5046
},
51-
"send_in_pings": [
52-
"metrics",
53-
],
47+
"send_in_pings": ["metrics"],
5448
},
5549
{
5650
"dates": {
5751
"first": "2019-08-08 15:34:14",
5852
"last": "2019-08-08 15:45:14",
5953
},
60-
"send_in_pings": [
61-
"baseline",
62-
],
54+
"send_in_pings": ["baseline"],
6355
},
6456
],
6557
"name": "glean.error.invalid_value",
@@ -138,17 +130,11 @@ def main_probe_defn():
138130
"versions": {"first": "65", "last": "68"},
139131
},
140132
{
141-
"details": {
142-
"keyed": False,
143-
"kind": "string",
144-
},
133+
"details": {"keyed": False, "kind": "string"},
145134
"versions": {"first": "61", "last": "64"},
146135
},
147136
{
148-
"details": {
149-
"keyed": False,
150-
"kind": "string",
151-
},
137+
"details": {"keyed": False, "kind": "string"},
152138
"versions": {"first": "55", "last": "60"},
153139
},
154140
],
@@ -172,7 +158,7 @@ def main_probe_all_childs_defn():
172158
},
173159
"versions": {"first": "67", "last": "70"},
174160
}
175-
],
161+
]
176162
},
177163
"name": "a11y.instantiators",
178164
"type": "scalar",
@@ -201,7 +187,7 @@ def main_probe_all_childs_and_main_defn():
201187
},
202188
"versions": {"first": "62", "last": "66"},
203189
},
204-
],
190+
]
205191
},
206192
"name": "a11y.instantiators",
207193
"type": "scalar",
@@ -223,7 +209,7 @@ def main_probe_all_defn():
223209
},
224210
"versions": {"first": "67", "last": "70"},
225211
}
226-
],
212+
]
227213
},
228214
"name": "a11y.instantiators",
229215
"type": "scalar",
@@ -245,7 +231,7 @@ def main_probe_max_description_length():
245231
},
246232
"versions": {"first": "67", "last": "70"},
247233
}
248-
],
234+
]
249235
},
250236
"name": "a11y.instantiators",
251237
"type": "scalar",

tests/test_schema.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,7 @@ def test_set_elem_propagate(self):
6868
expected = {
6969
"properties": {
7070
"a": {"type": "int"},
71-
"b": {
72-
"properties": {
73-
"hello": {"type": "string"},
74-
},
75-
"type": "object",
76-
},
71+
"b": {"properties": {"hello": {"type": "string"}}, "type": "object"},
7772
},
7873
"type": "object",
7974
}

tests/test_utils.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,7 @@ def probes():
5757
"description": "Remember the Canterbury",
5858
"second_level": True,
5959
"details": {"keyed": False},
60-
"versions": {
61-
"first": "50",
62-
"last": "60",
63-
},
60+
"versions": {"first": "50", "last": "60"},
6461
}
6562
]
6663
},
@@ -75,10 +72,7 @@ def probes():
7572
"description": "Remember the Canterbury",
7673
"second_level": False,
7774
"details": {"keyed": False},
78-
"versions": {
79-
"first": "50",
80-
"last": "60",
81-
},
75+
"versions": {"first": "50", "last": "60"},
8276
}
8377
]
8478
},

0 commit comments

Comments
 (0)