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
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml
index b6827cc..0837591 100644
--- a/.pre-commit-config.yaml
+++ b/.pre-commit-config.yaml
@@ -2,7 +2,7 @@
2# See https://pre-commit.com/hooks.html for more hooks2# See https://pre-commit.com/hooks.html for more hooks
3repos:3repos:
4- repo: https://github.com/pre-commit/pre-commit-hooks4- repo: https://github.com/pre-commit/pre-commit-hooks
5 rev: v4.0.15 rev: v4.4.0
6 hooks:6 hooks:
7 - id: check-added-large-files7 - id: check-added-large-files
8 - id: check-ast8 - id: check-ast
@@ -15,18 +15,18 @@ repos:
15 - id: end-of-file-fixer15 - id: end-of-file-fixer
16 - id: trailing-whitespace16 - id: trailing-whitespace
17- repo: https://github.com/psf/black17- repo: https://github.com/psf/black
18 rev: 21.10b018 rev: 22.12.0
19 hooks:19 hooks:
20 - id: black20 - id: black
21- repo: https://github.com/PyCQA/flake821- repo: https://github.com/PyCQA/flake8
22 rev: 4.0.122 rev: 6.0.0
23 hooks:23 hooks:
24 - id: flake824 - id: flake8
25- repo: https://github.com/PyCQA/isort25- repo: https://github.com/PyCQA/isort
26 rev: 5.10.126 rev: 5.12.0
27 hooks:27 hooks:
28 - id: isort28 - id: isort
29- repo: https://github.com/get-woke/woke29- repo: https://github.com/get-woke/woke
30 rev: v0.17.030 rev: v0.19.0
31 hooks:31 hooks:
32 - id: woke-from-source32 - id: woke-from-source
diff --git a/src/lazr/sshserver/auth.py b/src/lazr/sshserver/auth.py
index 561a4e5..8bfc634 100644
--- a/src/lazr/sshserver/auth.py
+++ b/src/lazr/sshserver/auth.py
@@ -350,7 +350,10 @@ class PublicKeyFromLaunchpadChecker:
350 if credentials.algName == b"ssh-dss":350 if credentials.algName == b"ssh-dss":
351 wantKeyType = "DSA"351 wantKeyType = "DSA"
352 elif credentials.algName in (352 elif credentials.algName in (
353 b"ssh-rsa", b"rsa-sha2-256", b"rsa-sha2-512"):353 b"ssh-rsa",
354 b"rsa-sha2-256",
355 b"rsa-sha2-512",
356 ):
354 wantKeyType = "RSA"357 wantKeyType = "RSA"
355 elif credentials.algName.startswith(b"ecdsa-sha2-"):358 elif credentials.algName.startswith(b"ecdsa-sha2-"):
356 wantKeyType = "ECDSA"359 wantKeyType = "ECDSA"
diff --git a/src/lazr/sshserver/tests/test_accesslog.py b/src/lazr/sshserver/tests/test_accesslog.py
index 9841af5..f855def 100644
--- a/src/lazr/sshserver/tests/test_accesslog.py
+++ b/src/lazr/sshserver/tests/test_accesslog.py
@@ -14,10 +14,10 @@ import tempfile
14from logging.handlers import WatchedFileHandler14from logging.handlers import WatchedFileHandler
1515
16import breezy16import breezy
17from breezy.tests import TestCase as BrzTestCase
18import fixtures17import fixtures
19import testtools18import testtools
20import zope.component.event19import zope.component.event
20from breezy.tests import TestCase as BrzTestCase
2121
22from lazr.sshserver.accesslog import LoggingManager22from lazr.sshserver.accesslog import LoggingManager
2323
diff --git a/src/lazr/sshserver/tests/test_auth.py b/src/lazr/sshserver/tests/test_auth.py
index 08c2b2e..adea2c4 100644
--- a/src/lazr/sshserver/tests/test_auth.py
+++ b/src/lazr/sshserver/tests/test_auth.py
@@ -147,7 +147,7 @@ class TestUserAuthServer(UserAuthServerMixin, testtools.TestCase):
147 # and Twisted don't add one when displaying the banner.147 # and Twisted don't add one when displaying the banner.
148 #148 #
149 # See RFC 4252, Section 5.4.149 # See RFC 4252, Section 5.4.
150 message = u"test message"150 message = "test message"
151 self.user_auth.sendBanner(message, language="en-US")151 self.user_auth.sendBanner(message, language="en-US")
152 self.assertBannerSent(message + "\r\n", "en-US")152 self.assertBannerSent(message + "\r\n", "en-US")
153 self.assertEqual(153 self.assertEqual(
@@ -161,10 +161,10 @@ class TestUserAuthServer(UserAuthServerMixin, testtools.TestCase):
161 # sent as CR LF pairs.161 # sent as CR LF pairs.
162 #162 #
163 # See RFC 4252, Section 5.4.163 # See RFC 4252, Section 5.4.
164 self.user_auth.sendBanner(u"test\nmessage")164 self.user_auth.sendBanner("test\nmessage")
165 [(messageType, payload)] = self.transport.packets165 [(messageType, payload)] = self.transport.packets
166 bytes, language, empty = getNS(payload, 2)166 bytes, language, empty = getNS(payload, 2)
167 self.assertEqual(bytes.decode("UTF8"), u"test\r\nmessage\r\n")167 self.assertEqual(bytes.decode("UTF8"), "test\r\nmessage\r\n")
168168
169 def test_requestRaisesConchError(self):169 def test_requestRaisesConchError(self):
170 # ssh_USERAUTH_REQUEST should raise a ConchError if tryAuth returns170 # ssh_USERAUTH_REQUEST should raise a ConchError if tryAuth returns
@@ -305,7 +305,7 @@ class MockChecker:
305305
306 credentialInterfaces = (ISSHPrivateKey,)306 credentialInterfaces = (ISSHPrivateKey,)
307307
308 error_message = u"error message"308 error_message = "error message"
309309
310 def requestAvatarId(self, credentials):310 def requestAvatarId(self, credentials):
311 if credentials.username == b"success":311 if credentials.username == b"success":

Subscribers

People subscribed via source and target branches