Skip to content

Commit a4b6c53

Browse files
committed
chore(ruff): ruff 0.5.3 fixes
Fixed 13 errors: - conftest.py: 5 × PT001 (pytest-fixture-incorrect-parentheses-style) - src/tmuxp/workspace/finders.py: 2 × PLR6201 (literal-membership) 2 × PLR1714 (repeated-equality-comparison) - tests/workspace/conftest.py: 1 × PT001 (pytest-fixture-incorrect-parentheses-style) - tests/workspace/test_finder.py: 3 × PT001 (pytest-fixture-incorrect-parentheses-style) ruff check --select ALL . --fix --unsafe-fixes --preview --show-fixes --ignore T201 --ignore F401 --ignore PT014 --ignore RUF100; ruff format .
1 parent e7f50ed commit a4b6c53

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

conftest.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def home_path_default(monkeypatch: pytest.MonkeyPatch, user_path: pathlib.Path)
4747
monkeypatch.setenv("HOME", str(user_path))
4848

4949

50-
@pytest.fixture()
50+
@pytest.fixture
5151
def tmuxp_configdir(user_path: pathlib.Path) -> pathlib.Path:
5252
"""Ensure and return tmuxp config directory."""
5353
xdg_config_dir = user_path / ".config"
@@ -58,7 +58,7 @@ def tmuxp_configdir(user_path: pathlib.Path) -> pathlib.Path:
5858
return tmuxp_configdir
5959

6060

61-
@pytest.fixture()
61+
@pytest.fixture
6262
def tmuxp_configdir_default(
6363
monkeypatch: pytest.MonkeyPatch,
6464
tmuxp_configdir: pathlib.Path,
@@ -68,7 +68,7 @@ def tmuxp_configdir_default(
6868
assert get_workspace_dir() == str(tmuxp_configdir)
6969

7070

71-
@pytest.fixture()
71+
@pytest.fixture
7272
def monkeypatch_plugin_test_packages(monkeypatch: pytest.MonkeyPatch) -> None:
7373
"""Monkeypatch tmuxp plugin fixtures to python path."""
7474
paths = [
@@ -83,14 +83,14 @@ def monkeypatch_plugin_test_packages(monkeypatch: pytest.MonkeyPatch) -> None:
8383
monkeypatch.syspath_prepend(str(pathlib.Path(path).resolve()))
8484

8585

86-
@pytest.fixture()
86+
@pytest.fixture
8787
def session_params(session_params: t.Dict[str, t.Any]) -> t.Dict[str, t.Any]:
8888
"""Terminal-friendly tmuxp session_params for dimensions."""
8989
session_params.update({"x": 800, "y": 600})
9090
return session_params
9191

9292

93-
@pytest.fixture()
93+
@pytest.fixture
9494
def socket_name(request: pytest.FixtureRequest) -> str:
9595
"""Random socket name for tmuxp."""
9696
return f"tmuxp_test{next(namer)}"

src/tmuxp/workspace/finders.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,9 +172,7 @@ def find_workspace_file(
172172
elif (
173173
not isabs(workspace_file)
174174
or len(dirname(workspace_file)) > 1
175-
or workspace_file == "."
176-
or workspace_file == ""
177-
or workspace_file == "./"
175+
or workspace_file in {".", "", "./"}
178176
): # if relative, fill in full path
179177
workspace_file = normpath(join(cwd, workspace_file))
180178

@@ -247,6 +245,5 @@ def is_pure_name(path: str) -> bool:
247245
not os.path.isabs(path)
248246
and len(os.path.dirname(path)) == 0
249247
and not os.path.splitext(path)[1]
250-
and path != "."
251-
and path != ""
248+
and path not in {".", ""}
252249
)

tests/workspace/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from tests.fixtures.structures import WorkspaceTestData
88

99

10-
@pytest.fixture()
10+
@pytest.fixture
1111
def config_fixture() -> WorkspaceTestData:
1212
"""Deferred import of tmuxp.tests.fixtures.*.
1313

tests/workspace/test_finder.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,23 +104,23 @@ def test_tmuxp_configdir_xdg_config_dir(
104104
assert get_workspace_dir() == str(tmux_dir)
105105

106106

107-
@pytest.fixture()
107+
@pytest.fixture
108108
def homedir(tmp_path: pathlib.Path) -> pathlib.Path:
109109
"""Fixture to ensure and return a home directory."""
110110
home = tmp_path / "home"
111111
home.mkdir()
112112
return home
113113

114114

115-
@pytest.fixture()
115+
@pytest.fixture
116116
def configdir(homedir: pathlib.Path) -> pathlib.Path:
117117
"""Fixture to ensure user directory for tmuxp and return it, via homedir fixture."""
118118
conf = homedir / ".tmuxp"
119119
conf.mkdir()
120120
return conf
121121

122122

123-
@pytest.fixture()
123+
@pytest.fixture
124124
def projectdir(homedir: pathlib.Path) -> pathlib.Path:
125125
"""Fixture to ensure and return an example project dir."""
126126
proj = homedir / "work" / "project"

0 commit comments

Comments
 (0)