Skip to content

Commit

Permalink
Address ruff PTH122
Browse files Browse the repository at this point in the history
  • Loading branch information
shatakshiiii committed Jun 14, 2024
1 parent 9a2bdac commit 7ca7162
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ ignore = [
'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`
'PTH122', # `os.path.splitext()` should be replaced by `Path.suffix`
'RET505', # Unnecessary `else` after `return` statement
'RUF005', # [*] Consider `[self._name, *shlex.split(self._interaction.action.match.groupdict()["params"] or "")]` instead of concatenation
'RUF012', # Mutable class attributes should be annotated with `typing.ClassVar`
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/actions/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -887,7 +887,7 @@ def write_artifact(self, filename: str | None = None) -> None:
filename = filename or self._args.playbook_artifact_save_as
filename = filename.format(
playbook_dir=os.path.dirname(playbook),
playbook_name=os.path.splitext(Path(playbook).name)[0],
playbook_name=Path(playbook).stem,
playbook_status=status,
time_stamp=now_iso(self._args.time_zone),
)
Expand Down
2 changes: 1 addition & 1 deletion src/ansible_navigator/tm_tokenize/grammars.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def __init__(self, *directories: str) -> None:
:param directories: A tuple of strings, each a directory in which grammar files can be found
"""
self._scope_to_files = {
os.path.splitext(filename)[0]: os.path.join(directory, filename)
Path(filename).stem: os.path.join(directory, filename)
for directory in directories
if Path(directory).exists()
for filename in sorted(os.listdir(directory))
Expand Down

0 comments on commit 7ca7162

Please sign in to comment.