chore: linter

This commit is contained in:
Ruidy 2021-08-04 11:25:52 +02:00
parent 6332b9e233
commit a4e3b02673
3 changed files with 9 additions and 7 deletions

View file

@ -40,7 +40,7 @@ def save(
random: bool = True, random: bool = True,
) -> None: ) -> None:
sqlite_repo = sqlite.get_instance() sqlite_repo = sqlite.get_instance()
seed = r.randint(0, 100) if random else 0 seed = r.randint(0, 100) if random else 0 # nosec
options = pass_gen.PassGenOptions( options = pass_gen.PassGenOptions(
service=service, service=service,
seed=seed, seed=seed,

View file

@ -1,13 +1,15 @@
from __future__ import annotations from __future__ import annotations
from pydantic import SecretStr
from app.models.password import Password from app.models.password import Password
class FakeRepository: class FakeRepository:
_values = {} _values: dict[str, SecretStr] = {}
def save(self, service: str, password: str) -> None: def save(self, service: str, password: str) -> None:
self._values[service] = password self._values[service] = SecretStr(password)
def list_all(self) -> list[Password]: def list_all(self) -> list[Password]:
return [ return [
@ -17,6 +19,6 @@ class FakeRepository:
def exists(self, service: str) -> bool: def exists(self, service: str) -> bool:
return service in self._values.keys() return service in self._values.keys()
@classmethod @staticmethod
def get_instance(cls) -> FakeRepository: def get_instance() -> FakeRepository:
return FakeRepository() return FakeRepository()

View file

@ -1,8 +1,8 @@
import subprocess import subprocess # nosec
def copy_to_clipboard(password: str) -> None: def copy_to_clipboard(password: str) -> None:
subprocess.run("pbcopy", universal_newlines=True, input=password) subprocess.run("pbcopy", universal_newlines=True, input=password) # nosec
def save_to_file(file: str, password: str) -> None: def save_to_file(file: str, password: str) -> None: