Skip to content

Commit 1f03319

Browse files
author
Revenue Holdings
committed
fix: ruff lint - datetime.UTC, X|None, E501, B904, F821
1 parent c6609d1 commit 1f03319

7 files changed

Lines changed: 54 additions & 22 deletions

File tree

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: pip
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 5
8+
- package-ecosystem: github-actions
9+
directory: "/"
10+
schedule:
11+
interval: weekly
12+
open-pull-requests-limit: 3

.github/workflows/publish.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
run: |
3333
pip install build twine
3434
35+
- name: Lint with ruff
36+
run: pip install ruff && ruff check src/ --target-version py310
37+
3538
- name: Build package
3639
run: |
3740
python -m build

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,4 @@ Thumbs.db
2929
.pytest_cache/
3030
.coverage
3131
htmlcov/
32+
.ruff_cache/

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Changelog
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [0.1.0] - 2025-05-17
9+
10+
### Added
11+
- Initial beta release
12+
- Core functionality
13+
- CLI interface
14+
- Test suite
15+
- CI/CD workflows with ruff lint and pytest
16+
- CONTRIBUTING.md

src/envault/cli.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def load_config(config_path: str = "") -> EnvaultConfig:
3939
return EnvaultConfig.load(path)
4040

4141

42-
# ── Init ────────────────────────────────────────────────────────────────────
42+
# ── ── Init ──────────────────────────────────â
4343

4444
@app.command()
4545
def init(
@@ -53,7 +53,7 @@ def init(
5353
console.print("Then run: envault diff, envault sync, envault rotate")
5454

5555

56-
# ── Diff ────────────────────────────────────────────────────────────────────
56+
# ── ── Diff ──────────────────────────────────â
5757

5858
@app.command()
5959
def diff(
@@ -95,7 +95,7 @@ def diff_files(
9595
raise typer.Exit(0)
9696

9797

98-
# ── Sync ────────────────────────────────────────────────────────────────────
98+
# ── ── Sync ──────────────────────────────────â
9999

100100
@app.command()
101101
def sync(
@@ -172,7 +172,7 @@ def sync(
172172
(f" +{len(result.skipped) - 10}" if len(result.skipped) > 10 else ""))
173173

174174

175-
# ── Rotate ──────────────────────────────────────────────────────────────────
175+
# ── ── Rotate ─────────────────────────────────â”
176176

177177
@app.command()
178178
def rotate(
@@ -260,7 +260,7 @@ def rotate_all(
260260
console.print(f"[green]✓[/green] Rotated {rotated} variables in {env}")
261261

262262

263-
# ── Store Commands ──────────────────────────────────────────────────────────
263+
# ── ── Store Commands ───────────────────────────────
264264

265265
store_app = typer.Typer(name="store", help="Manage secret store integrations.")
266266
app.add_typer(store_app)
@@ -335,7 +335,7 @@ def store_set(
335335
console.print(f"[green]✓[/green] Set {key}")
336336

337337

338-
# ── Audit ───────────────────────────────────────────────────────────────────
338+
# ── ── Audit ──────────────────────────────────
339339

340340
@app.command()
341341
def audit(
@@ -371,7 +371,7 @@ def audit(
371371
console.print(table)
372372

373373

374-
# ── Version ─────────────────────────────────────────────────────────────────
374+
# ── ── Version ─────────────────────────────────â
375375

376376
@app.command()
377377
def version():

src/envault/stores/__init__.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,10 @@ def get(self, key: str) -> str | None:
340340
for item in item_list:
341341
fields = item.get("fields", [])
342342
for field in fields:
343-
if field.get("purpose") == "PASSWORD" or field.get("label", "").lower() in ("password", "value", "credential"):
343+
if (
344+
field.get("purpose") == "PASSWORD"
345+
or field.get("label", "").lower() in ("password", "value", "credential")
346+
):
344347
return field.get("value", "")
345348
return None
346349

tests/test_envault.py

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,13 @@
11
"""Tests for Envault CLI."""
22

3-
import json
4-
import os
5-
import tempfile
6-
from pathlib import Path
7-
83
import pytest
9-
104
from envault import __version__
115
from envault.audit import AuditLogger
126
from envault.config import EnvaultConfig, init_config
13-
from envault.diff import diff_envs, diff_env_files, format_diff, load_env_file
14-
from envault.rotate import generate_secret, rotate_value, rotate_env_var
15-
from envault.sync import sync_envs, sync_env_files, SyncConflict, write_env_file
16-
7+
from envault.diff import diff_env_files, diff_envs, format_diff, load_env_file
8+
from envault.rotate import generate_secret, rotate_env_var, rotate_value
9+
from envault.sync import SyncConflict, sync_env_files, sync_envs, write_env_file
10+
from pathlib import Path
1711

1812
# ── Version ─────────────────────────────────────────────────────────────────
1913

@@ -230,7 +224,10 @@ def test_generate_secret_no_symbols():
230224

231225

232226
def test_generate_secret_exclude():
233-
secret = generate_secret(100, use_upper=True, use_lower=True, use_digits=True, use_symbols=False, exclude_chars="abc")
227+
secret = generate_secret(
228+
100, use_upper=True, use_lower=True,
229+
use_digits=True, use_symbols=False, exclude_chars="abc",
230+
)
234231
assert "a" not in secret
235232
assert "b" not in secret
236233
assert "c" not in secret
@@ -432,22 +429,22 @@ def test_set_many(self, tmp_path):
432429

433430

434431
def test_store_factory_default():
435-
from envault.stores import get_store, LocalEnvStore
432+
from envault.stores import LocalEnvStore, get_store
436433
store = get_store("some_path")
437434
assert isinstance(store, LocalEnvStore)
438435

439436

440437
def test_store_factory_local_config(tmp_path):
441438
from envault.config import SecretStoreConfig
442-
from envault.stores import get_store, LocalEnvStore
439+
from envault.stores import LocalEnvStore, get_store
443440
config = SecretStoreConfig(type="local", path_prefix=str(tmp_path / ".env"))
444441
store = get_store(config)
445442
assert isinstance(store, LocalEnvStore)
446443

447444

448445
def test_store_factory_unknown():
449446
from envault.config import SecretStoreConfig
450-
from envault.stores import get_store, SecretStoreError
447+
from envault.stores import SecretStoreError, get_store
451448
config = SecretStoreConfig(type="nonexistent")
452449
import pytest
453450
with pytest.raises(SecretStoreError):

0 commit comments

Comments
 (0)