Skip to content

Commit

Permalink
Address ruff PTH118: part3
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii committed Jun 16, 2024
1 parent 54bebf6 commit 011617a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 7 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,6 @@ ignore = [
'PT019', # Fixture `_mocked_func` without value is injected as parameter, use `@pytest.mark.usefixtures` instead
'PT022', # [*] No teardown in fixture `cmd_in_tty`, use `return` instead of `yield`
'PTH109', # `os.getcwd()` should be replaced by `Path.cwd()`
'PTH118', # `os.path.join()` should be replaced by `Path` with `/` operator
'PTH120', # `os.path.dirname()` should be replaced by `Path.parent`
'RET505', # Unnecessary `else` after `return` statement
'RUF005', # [*] Consider `[self._name, *shlex.split(self._interaction.action.match.groupdict()["params"] or "")]` instead of concatenation
Expand Down
7 changes: 3 additions & 4 deletions src/ansible_navigator/actions/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ def _run_runner(self) -> None:

kwargs["host_cwd"] = playbook_dir

self._adjacent_collection_dir = os.path.join(playbook_dir, "collections")
self._adjacent_collection_dir = f"{Path(playbook_dir) / 'collections'}"
cache_path = self._args.internals.cache_path

pass_through_arg = [
Expand Down Expand Up @@ -618,11 +618,10 @@ def _get_collection_plugins_details(

plugin = loaded.get("plugin")
plugin_docs = {}
plugin_path = os.path.join(
selected_collection.get("path", ""),
plugin_path = Path(selected_collection.get("path", "")) / Path(
plugin_info.get("path", ""),
)
plugin_docs["path"] = plugin_path
plugin_docs["path"] = str(plugin_path)
if plugin and plugin["doc"] is not None:
try:
if "name" in plugin["doc"]:
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/runner/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ def __init__(

if self._host_cwd:
# ensure the CWD ends with a trailing slash
host_cwd = os.path.join(self._host_cwd, "")
host_cwd = f"{Path(self._host_cwd) / ''}"
self._runner_args["host_cwd"] = host_cwd

if self._navigator_mode == "stdout":
Expand Down
1 change: 0 additions & 1 deletion tests/integration/actions/lint/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
from collections.abc import Generator


# LINT_FIXTURES = f"{FIXTURES_DIR / 'integration' / 'actions' / 'lint'}"
LINT_FIXTURES = FIXTURES_DIR / "integration" / "actions" / "lint"


Expand Down

0 comments on commit 011617a

Please sign in to comment.