Classes
BuildProfile
Build profiles for different user personas.
Each profile optimizes observability features for a sp…
BuildProfile
Build profiles for different user personas.
Each profile optimizes observability features for a specific workflow:
- WRITER: Content authors who want fast, clean builds
- THEME_DEV: Theme developers who need template debugging
- DEVELOPER: Framework contributors who need full observability
EnumMethods 3
from_string
classmethod
Parse profile from string.
from_string
classmethod def from_string(cls, value: str) -> BuildProfile
Parse profile from string.
Parameters 1
value |
str |
Profile name (case-insensitive) |
Returns
BuildProfile enum valueBuildProfile
—
from_cli_args
classmethod
Determine profile from CLI arguments with proper precedence.
Precedence (highe…
from_cli_args
classmethod def from_cli_args(cls, profile: str | None = None, dev: bool = False, theme_dev: bool = False, debug: bool = False) -> BuildProfile
Determine profile from CLI arguments with proper precedence.
Precedence (highest to lowest):
- --dev flag (full developer mode)
- --theme-dev flag
- --profile option
- --debug flag (enables DEVELOPER profile)
- Default (WRITER)
NOTE: --verbose is NOT a profile selector. It only controls output verbosity. Use --theme-dev or --dev for profile-based health checks and metrics.
Parameters 4
profile |
str | None |
Explicit profile name from --profile |
dev |
bool |
--dev flag (full developer mode) |
theme_dev |
bool |
--theme-dev flag |
debug |
bool |
--debug flag (debug logging, maps to DEVELOPER profile) |
Returns
Determined BuildProfileBuildProfile
—
get_config
Get configuration dictionary for this profile.
get_config
def get_config(self) -> dict[str, Any]
Get configuration dictionary for this profile.
Returns
Configuration with feature toggles for this profile Configuration keys:dict[str, Any]
— show_phase_timing: Show build phase timing
track_memory: Enable memory profiling (tracemalloc + psutil)
enable_debug_output: Print debug messages to stderr
collect_metrics: Save metrics to .bengal/metrics/
health_checks: Dict with enabled/disabled validator lists
verbose_build_stats: Show detailed build statistics
Internal Methods 1
__str__
String representation of profile.
__str__
def __str__(self) -> str
String representation of profile.
Returns
str
Functions
set_current_profile
Set the current build profile.
This is used by helper functions to determine behavior without
pass…
set_current_profile
def set_current_profile(profile: BuildProfile) -> None
Set the current build profile.
This is used by helper functions to determine behavior without passing profile through every function call.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
profile |
BuildProfile |
— | BuildProfile to set as current |
get_current_profile
Get the current build profile.
get_current_profile
def get_current_profile() -> BuildProfile
Get the current build profile.
Returns
Current profile, or WRITER if not setBuildProfile
—
should_show_debug
Check if debug output should be shown.
This is a helper for conditional debug output without passi…
should_show_debug
def should_show_debug() -> bool
Check if debug output should be shown.
This is a helper for conditional debug output without passing profile through every function.
Returns
True if debug output should be shownbool
—
should_track_memory
Check if memory tracking should be enabled.
should_track_memory
def should_track_memory() -> bool
Check if memory tracking should be enabled.
Returns
True if memory should be trackedbool
—
should_collect_metrics
Check if metrics collection should be enabled.
should_collect_metrics
def should_collect_metrics() -> bool
Check if metrics collection should be enabled.
Returns
True if metrics should be collectedbool
—
get_enabled_health_checks
Get list of enabled health check validators for current profile.
get_enabled_health_checks
def get_enabled_health_checks() -> list[str]
Get list of enabled health check validators for current profile.
Returns
List of validator names that should run, or 'all' stringlist[str]
—
is_validator_enabled
Check if a specific validator should run.
is_validator_enabled
def is_validator_enabled(validator_name: str) -> bool
Check if a specific validator should run.
Parameters 1
| Name | Type | Default | Description |
|---|---|---|---|
validator_name |
str |
— | Name of validator (e.g., 'config', 'links') |
Returns
True if validator should runbool
—