Skip to content

Commit 0d6d802

Browse files
committed
Fix formatting
1 parent 113d487 commit 0d6d802

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

pre_commit/languages/docker.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,16 @@ def _is_in_docker() -> bool:
3030
def _get_container_id() -> str:
3131
# It's assumed that we already check /proc/1/mountinfo in _is_in_docker.
3232
with open('/proc/1/mountinfo', 'rb') as f:
33-
hostname_mount = re.compile(r'/containers(/overlay-containers)?/([a-z0-9]{64})(/userdata)?/hostname')
33+
hostname_mount = re.compile(
34+
r"""
35+
/containers
36+
(/overlay-containers)?
37+
/([a-z0-9]{64})
38+
(/userdata)?
39+
/hostname
40+
""",
41+
re.VERBOSE,
42+
)
3443
for line in f.readlines():
3544
m = hostname_mount.search(line.decode())
3645
if m:

tests/languages/docker_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@
180180
28 21 0:6 / /sys/kernel/security rw,nosuid,nodev,noexec,relatime shared:8 - securityfs securityfs rw
181181
29 23 0:24 / /dev/shm rw,nosuid,nodev shared:4 - tmpfs tmpfs rw,inode64
182182
30 25 0:25 / /run/lock rw,nosuid,nodev,noexec,relatime shared:6 - tmpfs tmpfs rw,size=5120k,inode64
183-
'''
183+
''' # noqa: E501
184184

185185

186186
def test_docker_fallback_user():

0 commit comments

Comments
 (0)