Skip to content

chore/types scripts - #6

Open
DanteX86 wants to merge 10 commits into
masterfrom
chore/types-scripts
Open

chore/types scripts#6
DanteX86 wants to merge 10 commits into
masterfrom
chore/types-scripts

Conversation

@DanteX86

@DanteX86 DanteX86 commented Aug 18, 2025

Copy link
Copy Markdown
Owner

This PR adds and corrects static type annotations across the scripts/ folder and removes stray control characters that were breaking parsing.

Summary of changes

  • Add precise type hints and return annotations in:
    • scripts/ioc_validator.py
    • scripts/ioc_validator_simple.py
    • scripts/data_versioning.py
    • scripts/data_validation.py
    • scripts/data_preprocessing.py
    • scripts/generate_synthetic_data.py
    • scripts/threat_visualizer.py
  • Fix invalid non-printable/control characters in function signatures and source (e.g., U+000E/U+0000/U+007F), restoring valid syntax
  • Align IOC validator return types (Tuple[bool, List[Dict[str, Any]]]) and ensure unknown-pattern paths return (False, [])
  • Harden YAML/JSON config loads with safe typing and fallbacks to {} where necessary
  • Add missing -> None annotations for main() and side-effect functions
  • Minor cleanup to method definitions and imports in threat_visualizer.py (typing imports, proper method signatures)

Type-checking status

  • mypy scripts/: Success: no issues found in 9 source files

Testing/verification

  • Ran mypy locally for scripts/ (Python 3.11): clean
  • No runtime behavior changes intended; changes are type annotations and small refactors for safety/readability

Risk

  • Low; purely typing plus minor structural fixes to resolve parsing issues

Follow-ups

  • Optionally extend typing into src/ modules and tests
  • Consider enabling stricter mypy flags incrementally (e.g., disallow-any-generics) once baseline is stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant