|
from pathlib import Path |
|
from datetime import datetime |
|
from typing import Set |
|
|
|
class Settings: |
|
|
|
DEFAULT_OUTPUT_DIR = Path("output") |
|
TIMESTAMP_FORMAT = "%Y%m%d_%H%M%S" |
|
|
|
|
|
DEFAULT_EXTENSIONS = { |
|
|
|
'.py', |
|
'.js', |
|
'.ts', |
|
'.java', |
|
'.cpp', |
|
'.hpp', |
|
'.c', |
|
'.h', |
|
'.go', |
|
'.rs', |
|
|
|
|
|
'.json', |
|
'.yml', |
|
'.yaml', |
|
'.toml', |
|
|
|
|
|
'.md', |
|
'.txt', |
|
} |
|
|
|
@classmethod |
|
def get_timestamp(cls) -> str: |
|
return datetime.now().strftime(cls.TIMESTAMP_FORMAT) |
|
|
|
@classmethod |
|
def get_clone_dir(cls, timestamp: str) -> Path: |
|
return cls.DEFAULT_OUTPUT_DIR / f"repo_clone_{timestamp}" |
|
|
|
@classmethod |
|
def get_output_file(cls, timestamp: str) -> Path: |
|
return cls.DEFAULT_OUTPUT_DIR / f"scan_result_{timestamp}.md" |
|
|