Merge ~cjwatson/lazr.sshserver:pre-commit-update into lazr.sshserver:main

Proposed by Colin Watson
Status: Merged
Merged at revision: e2c58b84f100ac719c43daa65bb2a6e279ad02bb
Proposed branch: ~cjwatson/lazr.sshserver:pre-commit-update
Merge into: lazr.sshserver:main
Diff against target: 103 lines (+14/-11)
4 files modified
.pre-commit-config.yaml (+5/-5)
src/lazr/sshserver/auth.py (+4/-1)
src/lazr/sshserver/tests/test_accesslog.py (+1/-1)
src/lazr/sshserver/tests/test_auth.py (+4/-4)
Reviewer Review Type Date Requested Status
Guruprasad Approve
Review via email: mp+436532@code.launchpad.net

Commit message

Update pre-commit hooks

Description of the change

Includes fix for https://github.com/PyCQA/isort/issues/2077.

All code changes were automatic.

To post a comment you must log in.
Revision history for this message
Guruprasad (lgp171188) wrote :

LGTM 👍

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
2index b6827cc..0837591 100644
3--- a/.pre-commit-config.yaml
4+++ b/.pre-commit-config.yaml
5@@ -2,7 +2,7 @@
6 # See https://pre-commit.com/hooks.html for more hooks
7 repos:
8 - repo: https://github.com/pre-commit/pre-commit-hooks
9- rev: v4.0.1
10+ rev: v4.4.0
11 hooks:
12 - id: check-added-large-files
13 - id: check-ast
14@@ -15,18 +15,18 @@ repos:
15 - id: end-of-file-fixer
16 - id: trailing-whitespace
17 - repo: https://github.com/psf/black
18- rev: 21.10b0
19+ rev: 22.12.0
20 hooks:
21 - id: black
22 - repo: https://github.com/PyCQA/flake8
23- rev: 4.0.1
24+ rev: 6.0.0
25 hooks:
26 - id: flake8
27 - repo: https://github.com/PyCQA/isort
28- rev: 5.10.1
29+ rev: 5.12.0
30 hooks:
31 - id: isort
32 - repo: https://github.com/get-woke/woke
33- rev: v0.17.0
34+ rev: v0.19.0
35 hooks:
36 - id: woke-from-source
37diff --git a/src/lazr/sshserver/auth.py b/src/lazr/sshserver/auth.py
38index 561a4e5..8bfc634 100644
39--- a/src/lazr/sshserver/auth.py
40+++ b/src/lazr/sshserver/auth.py
41@@ -350,7 +350,10 @@ class PublicKeyFromLaunchpadChecker:
42 if credentials.algName == b"ssh-dss":
43 wantKeyType = "DSA"
44 elif credentials.algName in (
45- b"ssh-rsa", b"rsa-sha2-256", b"rsa-sha2-512"):
46+ b"ssh-rsa",
47+ b"rsa-sha2-256",
48+ b"rsa-sha2-512",
49+ ):
50 wantKeyType = "RSA"
51 elif credentials.algName.startswith(b"ecdsa-sha2-"):
52 wantKeyType = "ECDSA"
53diff --git a/src/lazr/sshserver/tests/test_accesslog.py b/src/lazr/sshserver/tests/test_accesslog.py
54index 9841af5..f855def 100644
55--- a/src/lazr/sshserver/tests/test_accesslog.py
56+++ b/src/lazr/sshserver/tests/test_accesslog.py
57@@ -14,10 +14,10 @@ import tempfile
58 from logging.handlers import WatchedFileHandler
59
60 import breezy
61-from breezy.tests import TestCase as BrzTestCase
62 import fixtures
63 import testtools
64 import zope.component.event
65+from breezy.tests import TestCase as BrzTestCase
66
67 from lazr.sshserver.accesslog import LoggingManager
68
69diff --git a/src/lazr/sshserver/tests/test_auth.py b/src/lazr/sshserver/tests/test_auth.py
70index 08c2b2e..adea2c4 100644
71--- a/src/lazr/sshserver/tests/test_auth.py
72+++ b/src/lazr/sshserver/tests/test_auth.py
73@@ -147,7 +147,7 @@ class TestUserAuthServer(UserAuthServerMixin, testtools.TestCase):
74 # and Twisted don't add one when displaying the banner.
75 #
76 # See RFC 4252, Section 5.4.
77- message = u"test message"
78+ message = "test message"
79 self.user_auth.sendBanner(message, language="en-US")
80 self.assertBannerSent(message + "\r\n", "en-US")
81 self.assertEqual(
82@@ -161,10 +161,10 @@ class TestUserAuthServer(UserAuthServerMixin, testtools.TestCase):
83 # sent as CR LF pairs.
84 #
85 # See RFC 4252, Section 5.4.
86- self.user_auth.sendBanner(u"test\nmessage")
87+ self.user_auth.sendBanner("test\nmessage")
88 [(messageType, payload)] = self.transport.packets
89 bytes, language, empty = getNS(payload, 2)
90- self.assertEqual(bytes.decode("UTF8"), u"test\r\nmessage\r\n")
91+ self.assertEqual(bytes.decode("UTF8"), "test\r\nmessage\r\n")
92
93 def test_requestRaisesConchError(self):
94 # ssh_USERAUTH_REQUEST should raise a ConchError if tryAuth returns
95@@ -305,7 +305,7 @@ class MockChecker:
96
97 credentialInterfaces = (ISSHPrivateKey,)
98
99- error_message = u"error message"
100+ error_message = "error message"
101
102 def requestAvatarId(self, credentials):
103 if credentials.username == b"success":

Subscribers

People subscribed via source and target branches