man/90-rearrange-path: apply "ruff format" and "ruff check --fix"

This commit is contained in:
Yu Watanabe
2026-05-18 02:44:46 +09:00
parent 4fa9302fa4
commit 522fdd7d96
+5 -3
View File
@@ -17,6 +17,7 @@ interesting generators.
import os
import pathlib
def rearrange_bin_sbin(path):
"""Make sure any pair of …/bin, …/sbin directories is in this order
@@ -33,9 +34,10 @@ def rearrange_bin_sbin(path):
items[i], items[j] = items[j], items[i]
return ':'.join(p.as_posix() for p in items)
if __name__ == '__main__':
path = os.environ['PATH'] # This should be always set.
# If it is not, we will just crash, which is OK too.
# This should be always set. If it is not, we will just crash, which is OK too.
path = os.environ['PATH']
new = rearrange_bin_sbin(path)
if new != path:
print('PATH={}'.format(new))
print(f'PATH={new}')