Skip to content

Commit

Permalink
chore(syntax): Run through pyupgrade / autoflake
Browse files Browse the repository at this point in the history
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
  • Loading branch information
tony committed Aug 6, 2022
1 parent 6ae580b commit ad6d30b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
1 change: 0 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# flake8: NOQA E5
import inspect
import os
import sys
from os.path import dirname, relpath
from pathlib import Path
Expand Down
2 changes: 1 addition & 1 deletion tmuxp/cli/freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
12 changes: 5 additions & 7 deletions tmuxp/cli/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 += [
Expand All @@ -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.")
Expand Down

0 comments on commit ad6d30b

Please sign in to comment.