From 3e0d5bf2bcd403d991fd149ab77ef1e6189bcfa4 Mon Sep 17 00:00:00 2001 From: Marc Beninca Date: Fri, 13 Sep 2024 17:07:27 +0200 Subject: [PATCH] lint/fs --- rwx/fs/__init__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/rwx/fs/__init__.py b/rwx/fs/__init__.py index c91e0b8..9189778 100644 --- a/rwx/fs/__init__.py +++ b/rwx/fs/__init__.py @@ -23,7 +23,7 @@ def empty_file(path: str) -> None: def get_mount_uuid(path: str) -> str: - """Return the UUID of provided mountpoint path.""" + """Return the filesystem UUID of a mountpoint path.""" return ps.run_line( ("findmnt",), ("--noheadings",), @@ -32,7 +32,8 @@ def get_mount_uuid(path: str) -> str: ) -def get_path_mount(path: str): +def get_path_mount(path: str) -> str: + """Return the mountpoint path of an arbitrary path.""" return ps.run_line( ("stat",), ("--format", "%m"), @@ -40,11 +41,13 @@ def get_path_mount(path: str): ) -def get_path_uuid(path: str): +def get_path_uuid(path: str) -> str: + """Return the filesystem UUID of an arbitrary path.""" return get_mount_uuid(get_path_mount(path)) -def make_directory(path: str): +def make_directory(path: str) -> None: + """Make a directory (and its parents) from a path.""" os.makedirs(path, exist_ok=True)