From ad6d30b7c0ed26df1160deb53092b913ae690651 Mon Sep 17 00:00:00 2001 From: Tony Narlock Date: Sat, 6 Aug 2022 09:34:15 -0500 Subject: [PATCH] chore(syntax): Run through pyupgrade / autoflake pip install pyupgrade autoflake; \ pyupgrade --py37 tests/**/*.py docs/**/*.py tmuxp/**/*.py; \ poetry run autoflake tests/**/*.py docs/**/*.py tmuxp/**/*.py -i --ignore-init-module-imports; \ make black isort --- docs/conf.py | 1 - tmuxp/cli/freeze.py | 2 +- tmuxp/cli/load.py | 12 +++++------- 3 files changed, 6 insertions(+), 9 deletions(-) diff --git a/docs/conf.py b/docs/conf.py index 7be0d094a8..53d19ed625 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,5 @@ # flake8: NOQA E5 import inspect -import os import sys from os.path import dirname, relpath from pathlib import Path diff --git a/tmuxp/cli/freeze.py b/tmuxp/cli/freeze.py index 54afda8786..2b05fc6f57 100644 --- a/tmuxp/cli/freeze.py +++ b/tmuxp/cli/freeze.py @@ -15,7 +15,7 @@ def session_completion(ctx, params, incomplete): t = Server() choices = [session.name for session in t.list_sessions()] - return sorted([str(c) for c in choices if str(c).startswith(incomplete)]) + return sorted(str(c) for c in choices if str(c).startswith(incomplete)) @click.command(name="freeze") diff --git a/tmuxp/cli/load.py b/tmuxp/cli/load.py index 1e8149edb7..0c68f61f78 100644 --- a/tmuxp/cli/load.py +++ b/tmuxp/cli/load.py @@ -446,11 +446,9 @@ def config_file_completion(ctx, params, incomplete): # CWD Paths choices += sorted( - [ - pathlib.Path(os.path.relpath(p, pathlib.Path.cwd())) - for p in [pathlib.Path.cwd(), *pathlib.Path.cwd().parents] - if config.in_dir(str(p)) or len(list(p.glob(".tmuxp.*"))) - ] + pathlib.Path(os.path.relpath(p, pathlib.Path.cwd())) + for p in [pathlib.Path.cwd(), *pathlib.Path.cwd().parents] + if config.in_dir(str(p)) or len(list(p.glob(".tmuxp.*"))) ) # CWD look one directory up choices += [ @@ -459,9 +457,9 @@ def config_file_completion(ctx, params, incomplete): ] # Project configs - choices += sorted([(config_dir / c).stem for c in config.in_dir(str(config_dir))]) + choices += sorted((config_dir / c).stem for c in config.in_dir(str(config_dir))) - return sorted([str(c) for c in choices if str(c).startswith(incomplete)]) + return sorted(str(c) for c in choices if str(c).startswith(incomplete)) @click.command(name="load", short_help="Load tmuxp workspaces.")