Compare commits

6 Commits
v0.1.0 ... main

Author SHA1 Message Date
89b1c71e99 fix: resolve CI linting failures
All checks were successful
CI / test (push) Successful in 14s
CI / build (push) Successful in 12s
- Removed unused imports (pathlib.Path, Schema, EnvVar, Optional)
- Fixed f-strings without placeholders in generator.py and validators.py
- Removed unused variables in generator.py
- Updated CI workflow to use correct project name (envschema)
2026-03-22 15:19:38 +00:00
769dceca62 fix: resolve CI linting failures
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
- Removed unused imports (pathlib.Path, Schema, EnvVar, Optional)
- Fixed f-strings without placeholders in generator.py and validators.py
- Removed unused variables in generator.py
- Updated CI workflow to use correct project name (envschema)
2026-03-22 15:19:37 +00:00
c74330f33d fix: resolve CI linting failures
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
- Removed unused imports (pathlib.Path, Schema, EnvVar, Optional)
- Fixed f-strings without placeholders in generator.py and validators.py
- Removed unused variables in generator.py
- Updated CI workflow to use correct project name (envschema)
2026-03-22 15:19:37 +00:00
c136fc7f20 fix: resolve CI linting failures
Some checks failed
CI / build (push) Has been cancelled
CI / test (push) Has been cancelled
- Removed unused imports (pathlib.Path, Schema, EnvVar, Optional)
- Fixed f-strings without placeholders in generator.py and validators.py
- Removed unused variables in generator.py
- Updated CI workflow to use correct project name (envschema)
2026-03-22 15:19:37 +00:00
7c5d566d58 fix: resolve CI linting failures
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
- Removed unused imports (pathlib.Path, Schema, EnvVar, Optional)
- Fixed f-strings without placeholders in generator.py and validators.py
- Removed unused variables in generator.py
- Updated CI workflow to use correct project name (envschema)
2026-03-22 15:19:36 +00:00
84c474a56e fix: resolve CI linting failures
Some checks failed
CI / test (push) Has been cancelled
CI / build (push) Has been cancelled
- Removed unused imports (pathlib.Path, Schema, EnvVar, Optional)
- Fixed f-strings without placeholders in generator.py and validators.py
- Removed unused variables in generator.py
- Updated CI workflow to use correct project name (envschema)
2026-03-22 15:19:36 +00:00
6 changed files with 28 additions and 25 deletions

View File

@@ -21,18 +21,28 @@ jobs:
run: | run: |
pip install -e ".[dev]" pip install -e ".[dev]"
- name: Run unit tests - name: Run linting
run: pytest tests/unit/ -v run: ruff check envschema/
- name: Run integration tests - name: Run tests
run: pytest tests/integration/ -v run: pytest tests/ -v
- name: Check code formatting build:
run: | runs-on: ubuntu-latest
pip install ruff needs: test
ruff check envschema/ steps:
- uses: actions/checkout@v4
- name: Upload coverage - name: Set up Python
run: | uses: actions/setup-python@v5
pip install pytest-cov with:
pytest --cov=envschema --cov-report=term-missing python-version: '3.11'
- name: Install dependencies
run: pip install -e .
- name: Verify import
run: python -c "import envschema; print(envschema.__version__)"
- name: Verify CLI
run: envschema --version

View File

@@ -1,12 +1,9 @@
"""CLI interface for EnvSchema."""
import sys import sys
from pathlib import Path
import click import click
from envschema import __version__ from envschema import __version__
from envschema.schema import load_schema_from_file, Schema from envschema.schema import load_schema_from_file
from envschema.core import validate_environment from envschema.core import validate_environment
from envschema.generator import generate_env_example_to_file from envschema.generator import generate_env_example_to_file
from envschema.formatters import format_result from envschema.formatters import format_result

View File

@@ -3,7 +3,7 @@
from dataclasses import dataclass, field from dataclasses import dataclass, field
from typing import Optional from typing import Optional
from envschema.schema import Schema, EnvVar from envschema.schema import Schema
from envschema.loader import EnvLoader from envschema.loader import EnvLoader
from envschema.validators import validate_value from envschema.validators import validate_value

View File

@@ -1,7 +1,6 @@
"""Output formatters for validation results.""" """Output formatters for validation results."""
import json import json
from typing import Optional
from envschema.core import ValidationResult from envschema.core import ValidationResult

View File

@@ -25,13 +25,10 @@ def generate_env_example(schema: Schema, include_descriptions: bool = True) -> s
lines.append(f"# {var.description}") lines.append(f"# {var.description}")
if var.required: if var.required:
lines.append(f"# REQUIRED") lines.append("# REQUIRED")
elif var.default is not None: elif var.default is not None:
lines.append(f"# Default: {var.default}") lines.append(f"# Default: {var.default}")
default_part = f"# {var.default}" if var.default else ""
type_part = f"[{var.type.value}]"
if var.required: if var.required:
lines.append(f"{var.name}=") lines.append(f"{var.name}=")
elif var.default is not None: elif var.default is not None:

View File

@@ -41,7 +41,7 @@ class IntegerValidator:
return True, None return True, None
except ValueError: except ValueError:
return False, ValidationError( return False, ValidationError(
f"Invalid integer value", "Invalid integer value",
value=value value=value
) )
@@ -62,7 +62,7 @@ class BooleanValidator:
if value_lower in BooleanValidator.FALSE_VALUES: if value_lower in BooleanValidator.FALSE_VALUES:
return True, None return True, None
return False, ValidationError( return False, ValidationError(
f"Invalid boolean value (expected: true, false, 1, 0, yes, no, on, off)", "Invalid boolean value (expected: true, false, 1, 0, yes, no, on, off)",
value=value value=value
) )
@@ -77,7 +77,7 @@ class ListValidator:
if "," in value: if "," in value:
return True, None return True, None
return False, ValidationError( return False, ValidationError(
f"Invalid list value (expected comma-separated values)", "Invalid list value (expected comma-separated values)",
value=value value=value
) )