Skip to content

Commit

Permalink
ruff: fix FBT003
Browse files Browse the repository at this point in the history
  • Loading branch information
patrit committed Nov 5, 2023
1 parent b974b99 commit 42c6ec0
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gitopscli/git_api/git_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def __get_repo(self) -> Repo:

def __create_credentials_file(self, username: str, password: str) -> str:
file_path = f"{self.__tmp_dir}/credentials.sh"
with open(file_path, "w", encoding=locale.getpreferredencoding(False)) as text_file:
with open(file_path, "w", encoding=locale.getpreferredencoding(do_setlocale=False)) as text_file:
text_file.write("#!/bin/sh\n")
text_file.write(f"echo username='{username}'\n")
text_file.write(f"echo password='{password}'\n")
Expand Down
4 changes: 2 additions & 2 deletions gitopscli/io_api/yaml_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@ class YAMLException(Exception): # noqa: N818


def yaml_file_load(file_path: str) -> Any:
with open(file_path, encoding=locale.getpreferredencoding(False)) as stream:
with open(file_path, encoding=locale.getpreferredencoding(do_setlocale=False)) as stream:
try:
return YAML_INSTANCE.load(stream)
except YAMLError as ex:
raise YAMLException(f"Error parsing YAML file: {file_path}") from ex


def yaml_file_dump(yaml: Any, file_path: str) -> None:
with open(file_path, "w+", encoding=locale.getpreferredencoding(False)) as stream:
with open(file_path, "w+", encoding=locale.getpreferredencoding(do_setlocale=False)) as stream:
YAML_INSTANCE.dump(yaml, stream)


Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@ ignore = ["ANN101", "ANN401",
"gitopscli/commands/command_factory.py" = ["PYI016"]
"gitopscli/commands/create_preview.py" = ["PTH112"]
"gitopscli/commands/delete_preview.py" = ["PTH110"]
"gitopscli/git_api/git_repo.py" = ["FBT003", "PTH101", "PTH118", "PTH123"]
"gitopscli/git_api/git_repo.py" = ["PTH101", "PTH118", "PTH123"]
"gitopscli/io_api/tmp_dir.py" = ["PTH103"]
"gitopscli/io_api/yaml_util.py" = ["FBT003", "PTH123"]
"gitopscli/io_api/yaml_util.py" = ["PTH123"]
"tests/git_api/test_git_repo.py" = ["PT018", "PTH101", "PTH103", "PTH110", "PTH123"]
"tests/io_api/test_tmp_dir.py" = ["PTH103", "PTH112"]
"tests/io_api/test_yaml_util.py" = ["PTH103", "PTH123"]

0 comments on commit 42c6ec0

Please sign in to comment.