Skip to main content

Configuration Helper

Configuration Helper - focused on project configuration loading and management.

Overview

This helper handles: - Project configuration loading - Branch naming configuration - Feature validation rules - Configuration defaults

Classes

ConfigurationHelper

Helper for project configuration operations.

Methods

get_ai_assistant_config
get_ai_assistant_config(self) -> str

Get configured AI assistant.

Returns: str

get_branch_naming_config
get_branch_naming_config(self) -> Dict

Get branch naming configuration with fallbacks.

Returns: Dict

get_current_date
get_current_date(self) -> str

Get current date in project's preferred format.

Returns: str

get_feature_numbering_config
get_feature_numbering_config(self) -> Dict[str, Any]

Get feature numbering configuration.

Returns: Dict

get_project_name
get_project_name(self) -> str

Get project name from configuration or directory.

Returns: str

get_template_config
get_template_config(self) -> Dict[str, Any]

Get template configuration settings.

Returns: Dict

is_auto_render_enabled
is_auto_render_enabled(self) -> bool

Check if auto-rendering is enabled.

Returns: bool

load_project_config
load_project_config(self, project_path: Optional[pathlib.Path] = None) -> Optional[Dict]

Load project configuration from .specify/config.toml.

Parameters:

  • project_path (Optional, optional) - Path to project directory (defaults to current directory)

Returns: Optional

should_backup_on_overwrite
should_backup_on_overwrite(self) -> bool

Check if backups should be created when overwriting files.

Returns: bool

should_preserve_user_files
should_preserve_user_files(self) -> bool

Check if user files should be preserved during updates.

Returns: bool

validate_feature_description
validate_feature_description(self, description: str, min_length: int = 3, max_length: int = 100) -> tuple[bool, typing.Optional[str]]

Validate feature description against project rules.

Parameters:

  • description (str, required) - Feature description to validate
  • min_length (int, optional) - Minimum length requirement - Default: 3
  • max_length (int, optional) - Maximum length requirement - Default: 100

Returns: tuple