chore: set up pre-commit framework with general hooks
Add .pre-commit-config.yaml with pre-commit-hooks v5.0.0 (trailing whitespace, end-of-file fixer, yaml/json checks, large file guard, merge conflict detection). Add minimal pyproject.toml. Auto-fix trailing whitespace and missing end-of-file newlines across the codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -36,7 +36,7 @@ export type Config = z.infer<typeof ConfigSchema>;
|
||||
|
||||
/**
|
||||
* Load configuration from file
|
||||
*
|
||||
*
|
||||
* @param configPath Path to the configuration file (optional)
|
||||
* @returns Loaded and validated configuration
|
||||
*/
|
||||
@@ -44,22 +44,22 @@ export async function loadConfig(configPath?: string): Promise<Config> {
|
||||
try {
|
||||
// Determine which config file to load
|
||||
const filePath = configPath || DEFAULT_CONFIG_PATH;
|
||||
|
||||
|
||||
// Check if file exists
|
||||
if (!existsSync(filePath)) {
|
||||
logger.warn(`Configuration file not found: ${filePath}, using defaults`);
|
||||
return ConfigSchema.parse({});
|
||||
}
|
||||
|
||||
|
||||
// Read and parse configuration
|
||||
const configData = await readFile(filePath, 'utf-8');
|
||||
const config = JSON.parse(configData);
|
||||
|
||||
|
||||
// Validate configuration
|
||||
return ConfigSchema.parse(config);
|
||||
} catch (error) {
|
||||
logger.error(`Error loading configuration: ${error}`);
|
||||
|
||||
|
||||
// Return default configuration
|
||||
return ConfigSchema.parse({});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user