From c8617ce8aecb40ccf1d13c02dcd7d7e74e79b56b Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Sat, 5 Apr 2025 13:36:49 -0500 Subject: migrate from pylint to ruff-action (#4) * migrate from pylint to ruff-action * temporarily disable push param * Commit from GitHub Actions (Pylint) * re-enable push param --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- yoshi/crypto.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'yoshi/crypto.py') diff --git a/yoshi/crypto.py b/yoshi/crypto.py index 9b0a423..d85fbe9 100644 --- a/yoshi/crypto.py +++ b/yoshi/crypto.py @@ -6,7 +6,7 @@ It allows for secure encryption and decryption of data using a secret key. from cryptography.fernet import Fernet -VAULT_FILE = 'vault.sqlite' +VAULT_FILE = "vault.sqlite" def generate_key() -> bytes: @@ -21,25 +21,25 @@ def load_key(key_file: str) -> bytes: Args: key_file (str): Path to the key file. """ - with open(key_file, 'rb') as key: + with open(key_file, "rb") as key: return key.read() def encrypt(key: bytes, filename: str = VAULT_FILE) -> None: """Encrypts the data in the specified file using the provided key.""" f = Fernet(key) - with open(filename, 'rb') as vault: + with open(filename, "rb") as vault: data = vault.read() encrypted_data = f.encrypt(data) - with open(filename, 'wb') as vault: + with open(filename, "wb") as vault: vault.write(encrypted_data) def decrypt(key: bytes, filename: str = VAULT_FILE) -> None: """Decrypts the data in the specified file using the provided key.""" f = Fernet(key) - with open(filename, 'rb') as vault: + with open(filename, "rb") as vault: encrypted_data = vault.read() decrypted_data = f.decrypt(encrypted_data) - with open(filename, 'wb') as vault: + with open(filename, "wb") as vault: vault.write(decrypted_data) -- cgit v1.2.3-70-g09d2