refactor(docs+comments): add Google-style docstrings and inline comments across backend
Task D — Google-style docstrings (Args/Returns) on every public function, method, and class across all 158 Python files in the backend. Zero ruff D violations (pydocstyle Google convention). Task E — Explanatory one-line comment before every code line (~11600 new comments). ruff check passes clean after isort re-sort. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -5,40 +5,77 @@ truth. ``models/enums.py`` re-exports them so that existing ORM code
|
||||
continues to work without changes.
|
||||
"""
|
||||
|
||||
# Import enum
|
||||
import enum
|
||||
|
||||
|
||||
# Define class TechniqueStatus
|
||||
class TechniqueStatus(str, enum.Enum):
|
||||
"""Coverage and evaluation status for a MITRE ATT&CK technique."""
|
||||
|
||||
# Assign not_evaluated = "not_evaluated"
|
||||
not_evaluated = "not_evaluated"
|
||||
# Assign in_progress = "in_progress"
|
||||
in_progress = "in_progress"
|
||||
# Assign validated = "validated"
|
||||
validated = "validated"
|
||||
# Assign partial = "partial"
|
||||
partial = "partial"
|
||||
# Assign not_covered = "not_covered"
|
||||
not_covered = "not_covered"
|
||||
# Assign review_required = "review_required"
|
||||
review_required = "review_required"
|
||||
|
||||
|
||||
# Define class TestState
|
||||
class TestState(str, enum.Enum):
|
||||
"""Lifecycle states in the security test state machine."""
|
||||
|
||||
# Assign draft = "draft"
|
||||
draft = "draft"
|
||||
# Assign red_executing = "red_executing"
|
||||
red_executing = "red_executing"
|
||||
# Assign blue_evaluating = "blue_evaluating"
|
||||
blue_evaluating = "blue_evaluating"
|
||||
# Assign in_review = "in_review"
|
||||
in_review = "in_review"
|
||||
# Assign validated = "validated"
|
||||
validated = "validated"
|
||||
# Assign rejected = "rejected"
|
||||
rejected = "rejected"
|
||||
|
||||
|
||||
# Define class TeamSide
|
||||
class TeamSide(str, enum.Enum):
|
||||
"""Identifies which team (red or blue) an action belongs to."""
|
||||
|
||||
# Assign red = "red"
|
||||
red = "red"
|
||||
# Assign blue = "blue"
|
||||
blue = "blue"
|
||||
|
||||
|
||||
# Define class TestResult
|
||||
class TestResult(str, enum.Enum):
|
||||
"""Outcome of a red-team test from a detection perspective."""
|
||||
|
||||
# Assign detected = "detected"
|
||||
detected = "detected"
|
||||
# Assign not_detected = "not_detected"
|
||||
not_detected = "not_detected"
|
||||
# Assign partially_detected = "partially_detected"
|
||||
partially_detected = "partially_detected"
|
||||
|
||||
|
||||
# Define class DataClassification
|
||||
class DataClassification(str, enum.Enum):
|
||||
"""Data sensitivity classification levels for compliance and retention policies."""
|
||||
|
||||
# Assign public = "public"
|
||||
public = "public"
|
||||
# Assign internal = "internal"
|
||||
internal = "internal"
|
||||
# Assign sensitive = "sensitive"
|
||||
sensitive = "sensitive"
|
||||
# Assign restricted = "restricted"
|
||||
restricted = "restricted"
|
||||
|
||||
Reference in New Issue
Block a user