Skip to content

Add typed environment variable utilities - #1

Open
DhyanMehta wants to merge 1 commit into
mainfrom
feature/typed-env-utils
Open

Add typed environment variable utilities#1
DhyanMehta wants to merge 1 commit into
mainfrom
feature/typed-env-utils

Conversation

@DhyanMehta

Copy link
Copy Markdown
Owner

Adds convenience functions for typed env var access with casting, a lightweight .env parser fallback, and an env snapshot helper.

Validation PR for CodeGuardian AI testing.

@DhyanMehta

Copy link
Copy Markdown
Owner Author

CodeGuardian Review — PR #1

Status: Completed (4/4 agents succeeded)
Commit: 220c2e0

Summary

  • 5 high-severity (2 quality, 3 test gap)
  • 6 medium-severity (5 quality, 1 test gap)
  • 3 low-severity (3 documentation)
  • Auto-fix available for 4 finding(s)

Findings

🔴 High

# Agent File Finding
1 Quality src/dotenv/typed_utils.py:44 Function Length and Complexity: The function 'load_env_file' has 23 lines of logic, exceeding the 40-line limit.
2 Quality src/dotenv/typed_utils.py:87 Function Length and Complexity: The function 'env_snapshot' has 5 lines of logic, exceeding the 40-line limit.
3 Test Gap src/dotenv/typed_utils.py:7 Untested: get_typed_env: Risk score: 39/10
4 Test Gap src/dotenv/typed_utils.py:36 Untested: require_env: Risk score: 9/10
5 Test Gap src/dotenv/typed_utils.py:44 Untested: load_env_file: Risk score: 73/10

🟡 Medium

# Agent File Finding
6 Quality src/dotenv/typed_utils.py:7 Type Annotations: The function 'get_typed_env' does not have complete type annotations.
7 Quality src/dotenv/typed_utils.py:36 Function and Method Names: The function name 'require_env' does not follow the snake_case convention.
8 Quality src/dotenv/typed_utils.py:36 Type Annotations: The function 'require_env' does not have complete type annotations.
9 Quality src/dotenv/typed_utils.py:44 Type Annotations: The function 'load_env_file' does not have complete type annotations.
10 Quality src/dotenv/typed_utils.py:87 Type Annotations: The function 'env_snapshot' does not have complete type annotations.
11 Test Gap src/dotenv/typed_utils.py:87 Untested: env_snapshot: Risk score: 7/10

⚪ Low

# Agent File Finding
12 Documentation src/dotenv/typed_utils.py:7 Docstring incomplete: get_typed_env: Function at src/dotenv/typed_utils.py:7
13 Documentation src/dotenv/typed_utils.py:36 Docstring incomplete: require_env: Function at src/dotenv/typed_utils.py:36
14 Documentation src/dotenv/typed_utils.py:44 Docstring incomplete: load_env_file: Function at src/dotenv/typed_utils.py:44

Agent Status

Agent Status Findings
Security ✅ (semgrep failed (ScannerOutputError), bandit failed (ScannerNotFoundError), gitleaks OK) 0
Quality 7
Test Gap 4
Documentation 3

Auto-Fix Available

4 finding(s) have auto-generated fixes (test drafts, docstrings). No code is pushed without your explicit approval.


Generated by CodeGuardian AI

@DhyanMehta

Copy link
Copy Markdown
Owner Author

CodeGuardian Review — PR #1

Status: Completed (3/4 agents succeeded, 1 could not run)
Commit: 220c2e0

Summary

  • 3 high-severity (3 test gap)
  • 1 medium-severity (1 test gap)
  • 3 low-severity (3 documentation)
  • Auto-fix available for 4 finding(s)

Incomplete review: Quality did not run, so this report does not cover that area. Counts above are a lower bound.


Findings

🔴 High

# Agent File Finding
1 Test Gap src/dotenv/typed_utils.py:7 Untested: get_typed_env: Risk score: 39/10
2 Test Gap src/dotenv/typed_utils.py:36 Untested: require_env: Risk score: 9/10
3 Test Gap src/dotenv/typed_utils.py:44 Untested: load_env_file: Risk score: 73/10

🟡 Medium

# Agent File Finding
4 Test Gap src/dotenv/typed_utils.py:87 Untested: env_snapshot: Risk score: 7/10

⚪ Low

# Agent File Finding
5 Documentation src/dotenv/typed_utils.py:7 Docstring incomplete: get_typed_env: Function at src/dotenv/typed_utils.py:7
6 Documentation src/dotenv/typed_utils.py:36 Docstring incomplete: require_env: Function at src/dotenv/typed_utils.py:36
7 Documentation src/dotenv/typed_utils.py:44 Docstring incomplete: load_env_file: Function at src/dotenv/typed_utils.py:44

Agent Status

Agent Status Findings
Security ✅ (semgrep OK, bandit OK, gitleaks OK) 0
Quality ⚠️ could not run (LLM review failed: LLMRateLimitError)
Test Gap 4
Documentation 3

Auto-Fix Available

4 finding(s) have auto-generated fixes (test drafts, docstrings). No code is pushed without your explicit approval.


Generated by CodeGuardian AI

@DhyanMehta

Copy link
Copy Markdown
Owner Author

CodeGuardian Review — PR #1

Status: Completed (3/4 agents succeeded, 1 could not run)
Commit: 220c2e0

Summary

  • 1 medium-severity (1 test gap)
  • 6 low-severity (3 documentation, 3 test gap)
  • Auto-fix available for 4 finding(s)

Incomplete review: Quality did not run, so this report does not cover that area. Counts above are a lower bound.


Findings

🟡 Medium

# Agent File Finding
1 Test Gap src/dotenv/typed_utils.py:44 Untested: load_env_file: Risk score: 7.3/10

⚪ Low

# Agent File Finding
2 Test Gap src/dotenv/typed_utils.py:7 Untested: get_typed_env: Risk score: 3.9/10
3 Test Gap src/dotenv/typed_utils.py:36 Untested: require_env: Risk score: 0.9/10
4 Test Gap src/dotenv/typed_utils.py:87 Untested: env_snapshot: Risk score: 0.7/10
5 Documentation src/dotenv/typed_utils.py:7 Docstring incomplete: get_typed_env: Function at src/dotenv/typed_utils.py:7
6 Documentation src/dotenv/typed_utils.py:36 Docstring incomplete: require_env: Function at src/dotenv/typed_utils.py:36
7 Documentation src/dotenv/typed_utils.py:44 Docstring incomplete: load_env_file: Function at src/dotenv/typed_utils.py:44

Agent Status

Agent Status Findings
Security ✅ (semgrep OK, bandit OK, gitleaks OK) 0
Quality ⚠️ could not run (No coding-standards context retrieved: Failed to connect to ChromaDB at ./chroma)
Test Gap 4
Documentation 3

Auto-Fix Available

4 finding(s) have auto-generated fixes (test drafts, docstrings). No code is pushed without your explicit approval.


Generated by CodeGuardian AI

@DhyanMehta

Copy link
Copy Markdown
Owner Author

CodeGuardian Review — PR #1

Status: Completed (4/4 agents succeeded)
Commit: 220c2e0

Summary

  • 2 high-severity (2 quality)
  • 5 medium-severity (4 quality, 1 test gap)
  • 6 low-severity (3 documentation, 3 test gap)
  • Auto-fix available for 4 finding(s)

Findings

🔴 High

# Agent File Finding
1 Quality src/dotenv/typed_utils.py:44 Function Length and Complexity: The function 'load_env_file' has 23 lines of logic, exceeding the 40-line limit.
2 Quality src/dotenv/typed_utils.py:87 Function Length and Complexity: The function 'env_snapshot' has 5 lines of logic, exceeding the 40-line limit.

🟡 Medium

# Agent File Finding
3 Quality src/dotenv/typed_utils.py:7 Type Annotations: The function 'get_typed_env' does not have complete type annotations.
4 Quality src/dotenv/typed_utils.py:36 Type Annotations: The function 'require_env' does not have complete type annotations.
5 Quality src/dotenv/typed_utils.py:44 Type Annotations: The function 'load_env_file' does not have complete type annotations.
6 Quality src/dotenv/typed_utils.py:87 Type Annotations: The function 'env_snapshot' does not have complete type annotations.
7 Test Gap src/dotenv/typed_utils.py:44 Untested: load_env_file: Risk score: 7.3/10

⚪ Low

# Agent File Finding
8 Test Gap src/dotenv/typed_utils.py:7 Untested: get_typed_env: Risk score: 3.9/10
9 Test Gap src/dotenv/typed_utils.py:36 Untested: require_env: Risk score: 0.9/10
10 Test Gap src/dotenv/typed_utils.py:87 Untested: env_snapshot: Risk score: 0.7/10
11 Documentation src/dotenv/typed_utils.py:7 Docstring incomplete: get_typed_env: Function at src/dotenv/typed_utils.py:7
12 Documentation src/dotenv/typed_utils.py:36 Docstring incomplete: require_env: Function at src/dotenv/typed_utils.py:36
13 Documentation src/dotenv/typed_utils.py:44 Docstring incomplete: load_env_file: Function at src/dotenv/typed_utils.py:44

Agent Status

Agent Status Findings
Security ✅ (semgrep OK, bandit OK, gitleaks OK) 0
Quality 6
Test Gap 4
Documentation 3

Auto-Fix Available

4 finding(s) have auto-generated fixes (test drafts, docstrings). No code is pushed without your explicit approval.


Generated by CodeGuardian AI

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant