UNPKG

agentsqripts

Version:

Comprehensive static code analysis toolkit for identifying technical debt, security vulnerabilities, performance issues, and code quality problems

79 lines (72 loc) 3.1 kB
/** * @file Message constants and text template definitions for consistent user communication * @description Single responsibility: Centralize all user-facing messages and error text constants * * This configuration module provides centralized message constants used across the * AgentSqripts platform for error handling, test feedback, and user communication. * It ensures consistent messaging tone, format, and language across all analysis tools * while enabling easy localization and message customization in the future. * * Design rationale: * - Centralized messages prevent inconsistent error reporting across modules * - Standardized test feedback provides clear pass/fail indication * - Descriptive constant names enable self-documenting code * - Future expansion point for internationalization and message customization * - Consistent user experience across all CLI tools and analysis interfaces */ // Error Handling Constants /** * Default fallback error message for unexpected exceptions * * Technical function: Provides user-friendly error text when specific error handling fails * * Implementation rationale: * - Generic message avoids exposing technical details to end users * - Fallback ensures users always receive meaningful feedback * - Professional tone maintains consistent user experience during errors * - Used as last resort when detailed error context cannot be determined */ const DEFAULT_ERROR_MESSAGE = 'An unexpected error occurred'; /** * Context identifier for string formatting function errors * * Technical function: Identifies source of formatting-related errors in debugging * * Implementation rationale: * - Specific context helps developers identify formatting function failures * - Used in error logging and debugging workflows * - Enables targeted error handling for string processing operations * - Facilitates debugging of output formatting issues across analyzers */ const ERROR_CONTEXT_FORMATSTRING = 'formatString function'; // Testing Constants /** * Visual indicator for successful test execution * * Technical function: Provides clear visual feedback for passing tests * * Implementation rationale: * - Unicode checkmark provides universal success indication * - Consistent visual feedback across all test suites and analysis validation * - Brief symbol maintains clean console output while being immediately recognizable * - Cross-platform compatibility with most terminal environments */ const TEST_SUCCESS_MESSAGE = '✓'; /** * Visual indicator for failed test execution * * Technical function: Provides clear visual feedback for failing tests * * Implementation rationale: * - Unicode X mark provides universal failure indication * - Consistent with success message for balanced visual feedback * - Enables quick visual scanning of test results * - Standard symbol recognized across development tools and environments */ const TEST_FAILURE_MESSAGE = '✗'; module.exports = { DEFAULT_ERROR_MESSAGE, ERROR_CONTEXT_FORMATSTRING, TEST_SUCCESS_MESSAGE, TEST_FAILURE_MESSAGE };