Skip to content

Commit 0e852dd

Browse files
committed
Update pre-commit repositories and fix some new linting issues
1 parent e6affaf commit 0e852dd

File tree

4 files changed

+41
-41
lines changed

4 files changed

+41
-41
lines changed

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ repos:
44
hooks:
55
- id: seed-isort-config
66
- repo: https://github.com/timothycrosley/isort
7-
rev: 5.9.3
7+
rev: 5.10.1
88
hooks:
99
- id: isort
1010
- repo: https://github.com/ambv/black
11-
rev: 21.9b0
11+
rev: 22.1.0
1212
hooks:
1313
- id: black
1414
- repo: https://github.com/pre-commit/mirrors-prettier
15-
rev: v2.4.0
15+
rev: v2.6.0
1616
hooks:
1717
- id: prettier
1818
exclude: ^tests/|libmozdata/modules.json
@@ -26,7 +26,7 @@ repos:
2626
- "flake8-debugger==3.1.0"
2727
- "flake8-mypy==17.8.0"
2828
- repo: https://github.com/pre-commit/pre-commit-hooks
29-
rev: v4.0.1
29+
rev: v4.1.0
3030
hooks:
3131
- id: check-ast
3232
- id: check-docstring-first
@@ -52,11 +52,11 @@ repos:
5252
- id: codespell
5353
exclude: libmozdata/modules.json
5454
- repo: https://github.com/marco-c/taskcluster_yml_validator
55-
rev: v0.0.7
55+
rev: v0.0.9
5656
hooks:
5757
- id: taskcluster_yml
5858
- repo: https://github.com/asottile/yesqa
59-
rev: v1.2.3
59+
rev: v1.3.0
6060
hooks:
6161
- id: yesqa
6262
- repo: meta

libmozdata/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ def get_monday_sunday(date):
295295
def mean_stddev(x):
296296
N = len(x)
297297
m = sum(x) / N
298-
v = sum([xi ** 2 for xi in x]) / N - m ** 2
298+
v = sum([xi**2 for xi in x]) / N - m**2
299299
e = math.sqrt(v)
300300

301301
return m, e

tests/test_bugzilla.py

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ def bughandler(bug, data):
2525
bugzilla.Bugzilla(12345, bughandler=bughandler, bugdata=bug).get_data().wait()
2626

2727
self.assertEqual(bug["id"], 12345)
28-
self.assertEqual(bug["resolution"], u"FIXED")
29-
self.assertEqual(bug["assigned_to"], u"[email protected]")
28+
self.assertEqual(bug["resolution"], "FIXED")
29+
self.assertEqual(bug["assigned_to"], "[email protected]")
3030
self.assertEqual(
3131
bug["summary"],
32-
u"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
32+
"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
3333
)
3434

3535
@responses.activate
@@ -43,18 +43,18 @@ def bughandler(bug, data):
4343
).get_data().wait()
4444

4545
self.assertEqual(bugs[12345]["id"], 12345)
46-
self.assertEqual(bugs[12345]["resolution"], u"FIXED")
47-
self.assertEqual(bugs[12345]["assigned_to"], u"[email protected]")
46+
self.assertEqual(bugs[12345]["resolution"], "FIXED")
47+
self.assertEqual(bugs[12345]["assigned_to"], "[email protected]")
4848
self.assertEqual(
4949
bugs[12345]["summary"],
50-
u"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
50+
"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
5151
)
5252

5353
self.assertEqual(bugs[12346]["id"], 12346)
54-
self.assertEqual(bugs[12346]["resolution"], u"FIXED")
55-
self.assertEqual(bugs[12346]["assigned_to"], u"[email protected]")
54+
self.assertEqual(bugs[12346]["resolution"], "FIXED")
55+
self.assertEqual(bugs[12346]["assigned_to"], "[email protected]")
5656
self.assertEqual(
57-
bugs[12346]["summary"], u"nsOutputFileStream should buffer the output"
57+
bugs[12346]["summary"], "nsOutputFileStream should buffer the output"
5858
)
5959

6060
@responses.activate
@@ -75,20 +75,20 @@ def bughandler2(bug, data):
7575

7676
for bugs in [bugs1, bugs2]:
7777
self.assertEqual(bugs[12345]["id"], 12345)
78-
self.assertEqual(bugs[12345]["resolution"], u"FIXED")
78+
self.assertEqual(bugs[12345]["resolution"], "FIXED")
7979
self.assertEqual(
80-
bugs[12345]["assigned_to"], u"[email protected]"
80+
bugs[12345]["assigned_to"], "[email protected]"
8181
)
8282
self.assertEqual(
8383
bugs[12345]["summary"],
84-
u"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
84+
"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
8585
)
8686

8787
self.assertEqual(bugs[12346]["id"], 12346)
88-
self.assertEqual(bugs[12346]["resolution"], u"FIXED")
89-
self.assertEqual(bugs[12346]["assigned_to"], u"[email protected]")
88+
self.assertEqual(bugs[12346]["resolution"], "FIXED")
89+
self.assertEqual(bugs[12346]["assigned_to"], "[email protected]")
9090
self.assertEqual(
91-
bugs[12346]["summary"], u"nsOutputFileStream should buffer the output"
91+
bugs[12346]["summary"], "nsOutputFileStream should buffer the output"
9292
)
9393

9494
@responses.activate
@@ -112,20 +112,20 @@ def bughandler3(bug, data):
112112

113113
for bugs in [bugs1, bugs2, bugs3]:
114114
self.assertEqual(bugs[12345]["id"], 12345)
115-
self.assertEqual(bugs[12345]["resolution"], u"FIXED")
115+
self.assertEqual(bugs[12345]["resolution"], "FIXED")
116116
self.assertEqual(
117-
bugs[12345]["assigned_to"], u"[email protected]"
117+
bugs[12345]["assigned_to"], "[email protected]"
118118
)
119119
self.assertEqual(
120120
bugs[12345]["summary"],
121-
u"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
121+
"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
122122
)
123123

124124
self.assertEqual(bugs[12346]["id"], 12346)
125-
self.assertEqual(bugs[12346]["resolution"], u"FIXED")
126-
self.assertEqual(bugs[12346]["assigned_to"], u"[email protected]")
125+
self.assertEqual(bugs[12346]["resolution"], "FIXED")
126+
self.assertEqual(bugs[12346]["assigned_to"], "[email protected]")
127127
self.assertEqual(
128-
bugs[12346]["summary"], u"nsOutputFileStream should buffer the output"
128+
bugs[12346]["summary"], "nsOutputFileStream should buffer the output"
129129
)
130130

131131
@responses.activate
@@ -153,9 +153,9 @@ def bughandler2(bug, data):
153153
self.assertEqual(bugs1[12345]["id"], 12345)
154154
self.assertEqual(bugs1[12346]["id"], 12346)
155155
self.assertEqual(bugs2[12345]["id"], 12345)
156-
self.assertEqual(bugs2[12345]["resolution"], u"FIXED")
156+
self.assertEqual(bugs2[12345]["resolution"], "FIXED")
157157
self.assertEqual(bugs2[12346]["id"], 12346)
158-
self.assertEqual(bugs2[12346]["resolution"], u"FIXED")
158+
self.assertEqual(bugs2[12346]["resolution"], "FIXED")
159159

160160
@responses.activate
161161
def test_queries(self):
@@ -173,18 +173,18 @@ def bughandler(data):
173173
bugzilla.Bugzilla(queries=queries, bughandler=bughandler).wait()
174174

175175
self.assertEqual(bugs[12345]["id"], 12345)
176-
self.assertEqual(bugs[12345]["resolution"], u"FIXED")
177-
self.assertEqual(bugs[12345]["assigned_to"], u"[email protected]")
176+
self.assertEqual(bugs[12345]["resolution"], "FIXED")
177+
self.assertEqual(bugs[12345]["assigned_to"], "[email protected]")
178178
self.assertEqual(
179179
bugs[12345]["summary"],
180-
u"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
180+
"[DOGFOOD] Unable to Forward a message received as an Inline page or an attachment",
181181
)
182182

183183
self.assertEqual(bugs[12346]["id"], 12346)
184-
self.assertEqual(bugs[12346]["resolution"], u"FIXED")
185-
self.assertEqual(bugs[12346]["assigned_to"], u"[email protected]")
184+
self.assertEqual(bugs[12346]["resolution"], "FIXED")
185+
self.assertEqual(bugs[12346]["assigned_to"], "[email protected]")
186186
self.assertEqual(
187-
bugs[12346]["summary"], u"nsOutputFileStream should buffer the output"
187+
bugs[12346]["summary"], "nsOutputFileStream should buffer the output"
188188
)
189189

190190
@responses.activate
@@ -309,7 +309,7 @@ def historyhandler(bug, data):
309309

310310
self.assertEqual(data["bug"]["id"], 12345)
311311
self.assertEqual(len(data["comment"]), 19)
312-
self.assertTrue(data["comment"][0]["text"].startswith(u"Steps to reproduce"))
312+
self.assertTrue(data["comment"][0]["text"].startswith("Steps to reproduce"))
313313
self.assertEqual(len(data["history"]["history"]), 24)
314314

315315
@responses.activate
@@ -336,7 +336,7 @@ def historyhandler(bug, data):
336336

337337
self.assertEqual(data["bug"]["id"], 12345)
338338
self.assertEqual(len(data["comment"]), 19)
339-
self.assertTrue(data["comment"][0]["text"].startswith(u"Steps to reproduce"))
339+
self.assertTrue(data["comment"][0]["text"].startswith("Steps to reproduce"))
340340
self.assertEqual(len(data["history"]["history"]), 24)
341341

342342
@responses.activate
@@ -609,7 +609,7 @@ def attachmenthandler(bug, bugid, data):
609609

610610
self.assertEqual(data["bug"]["id"], 12345)
611611
self.assertEqual(len(data["comment"]), 19)
612-
self.assertTrue(data["comment"][0]["text"].startswith(u"Steps to reproduce"))
612+
self.assertTrue(data["comment"][0]["text"].startswith("Steps to reproduce"))
613613
self.assertEqual(len(data["history"]["history"]), 24)
614614
self.assertEqual(len(data["attachment"]), 1)
615615
self.assertEqual(data["attachment"][0]["description"], "Some patch.")
@@ -645,7 +645,7 @@ def attachmenthandler(bug, bugid, data):
645645

646646
self.assertEqual(data["bug"]["id"], 12345)
647647
self.assertEqual(len(data["comment"]), 19)
648-
self.assertTrue(data["comment"][0]["text"].startswith(u"Steps to reproduce"))
648+
self.assertTrue(data["comment"][0]["text"].startswith("Steps to reproduce"))
649649
self.assertEqual(len(data["history"]["history"]), 24)
650650
self.assertEqual(len(data["attachment"]), 1)
651651
self.assertEqual(data["attachment"][0]["description"], "Some patch.")

tests/test_bzinfo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def test_bzinfo(self):
1414
self.assertIn("12345", info)
1515
info = info["12345"]
1616
self.assertTrue(info["authorized"])
17-
self.assertEqual(info["owner"], u"[email protected]")
17+
self.assertEqual(info["owner"], "[email protected]")
1818
# self.assertIn(u'[email protected]', info['commenters'])
1919
self.assertEqual(info["component"], "Backend")
2020
self.assertEqual(info["product"], "MailNews Core")

0 commit comments

Comments
 (0)