Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .secrets.baseline
Original file line number Diff line number Diff line change
Expand Up @@ -143,5 +143,5 @@
}
]
},
"generated_at": "2026-01-25T05:36:04Z"
"generated_at": "2026-01-28T03:39:17Z"
}
2 changes: 1 addition & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

- `src/`: application package only
- `src/devto_mirror/ai_optimization/`: optional AI modules
- `scripts/`: runnable entrypoints + helpers (MUST NOT contain application modules)
- `scripts/`: runnable entrypoints + helpers (legacy, move code out opportunistically)
- `tests/`: `unittest`
- `assets/`: templates/static inputs (edit these, not generated root artifacts)
- `docs/`: documentation (doc-specific rules live in `docs/AGENTS.md`)
Expand Down
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,16 @@ prechecks-full: ## Run full prechecks across the repo (force full run)

security: ## Run security checks
uv run bandit -r scripts src/ -ll -iii
uv run pip-audit --progress-spinner=off --skip-editable
@if [ "$$CI" = "true" ] || [ "$$GITHUB_ACTIONS" = "true" ] || [ "$$PIP_AUDIT" = "1" ]; then \
uv run python scripts/run_pip_audit.py; \
else \
echo "Skipping pip-audit (set PIP_AUDIT=1 to enable locally)"; \
fi
uv run python scripts/check_detect_secrets.py

check-complexity: ## Check cognitive complexity (max 15)
@echo "🔍 Checking cognitive complexity (max 15)..."
@uv run radon cc scripts/ src/ -s 2>/dev/null | grep -E "\([1-9][6-9]\)|([2-9][0-9]\)|([1-9][0-9]{2,}\))" && \
@uv run radon cc scripts/ src/ -s 2>/dev/null | grep -E "\(((1[6-9])|([2-9][0-9])|([1-9][0-9]{2,}))\)" && \
echo "❌ Functions with complexity >15 found. See docs/COMPLEXITY_REFACTORING.md" && exit 1 || \
echo "✅ All functions within complexity limits"

Expand Down
15 changes: 8 additions & 7 deletions lefthook.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ pre-commit:
glob: "*.py"
run: uv run isort {staged_files}
stage_fixed: true
detect-secrets:
run: uv run python scripts/check_detect_secrets.py
validate-site:
run: uv run python scripts/validate_site_generation.py
security:
run: make security
stage_fixed: true

pre-push:
parallel: false
parallel: true
commands:
security:
run: make security
tests:
run: make test
detect-secrets:
run: uv run python scripts/check_detect_secrets.py
validate-site:
run: uv run python scripts/validate_site_generation.py
Loading