Skip to content

Commit 94f4710

Browse files
committed
refactor: VALID_WORKSPACE_DIR_FILE_EXTENSIONS
1 parent 43afa61 commit 94f4710

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/tmuxp/cli/constants.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
VALID_CONFIG_DIR_FILE_EXTENSIONS = [".yaml", ".yml", ".json"]
1+
VALID_WORKSPACE_DIR_FILE_EXTENSIONS = [".yaml", ".yml", ".json"]

src/tmuxp/cli/ls.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import os
33
import typing as t
44

5-
from .constants import VALID_CONFIG_DIR_FILE_EXTENSIONS
5+
from .constants import VALID_WORKSPACE_DIR_FILE_EXTENSIONS
66
from .utils import get_config_dir
77

88

@@ -19,6 +19,6 @@ def command_ls(
1919
if os.path.exists(tmuxp_dir) and os.path.isdir(tmuxp_dir):
2020
for f in sorted(os.listdir(tmuxp_dir)):
2121
stem, ext = os.path.splitext(f)
22-
if os.path.isdir(f) or ext not in VALID_CONFIG_DIR_FILE_EXTENSIONS:
22+
if os.path.isdir(f) or ext not in VALID_WORKSPACE_DIR_FILE_EXTENSIONS:
2323
continue
2424
print(stem)

src/tmuxp/cli/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from tmuxp.types import StrPath
99

1010
from .. import log
11-
from .constants import VALID_CONFIG_DIR_FILE_EXTENSIONS
11+
from .constants import VALID_WORKSPACE_DIR_FILE_EXTENSIONS
1212

1313
logger = logging.getLogger(__name__)
1414

@@ -121,7 +121,7 @@ def scan_config(
121121
x
122122
for x in [
123123
f"{join(workspace_dir, workspace_file)}{ext}"
124-
for ext in VALID_CONFIG_DIR_FILE_EXTENSIONS
124+
for ext in VALID_WORKSPACE_DIR_FILE_EXTENSIONS
125125
]
126126
if exists(x)
127127
]

tests/test_cli.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1362,7 +1362,7 @@ def test_ls_cli(
13621362

13631363
# should ignore:
13641364
# - directories should be ignored
1365-
# - extensions not covered in VALID_CONFIG_DIR_FILE_EXTENSIONS
1365+
# - extensions not covered in VALID_WORKSPACE_DIR_FILE_EXTENSIONS
13661366
ignored_filenames = [".git/", ".gitignore/", "session_4.txt"]
13671367
stems = [os.path.splitext(f)[0] for f in filenames if f not in ignored_filenames]
13681368

0 commit comments

Comments
 (0)