docs: Bring all documentation up to date for v2.10.1
- architecture/: overview, technology stack, auth (OIDC + built-in IndieAuth), syndication (POSSE) rewritten; new database.md, deployment.md and indieweb-protocols.md; legacy stack marked historical - decisions/: reconstructed ADR-060 and ADR-063; 31 status corrections (superseded auth ADRs, proposed -> accepted); INDEX rebuilt - design/: reconstructed the v1.6.0 documents the webmention code cites; reports for 18 v2 releases without a design folder; INDEX rebuilt - projectplan/: BACKLOG rewritten (shipped items removed, open issues from the reviews added); RELEASE.md for v2.0.0-v2.10.1; INDEX - standards/: development setup (uv, tests, DEV_MODE), testing (CI test stage), git and release flow, versioning, coding standards, cookies - README, CLAUDE.md, .env.example (every setting the code reads, with defaults) brought up to date - 137 broken links repaired (old absolute paths, moved files); stale ADR references in code comments corrected (comments only) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
fa551de197
commit
0716984958
143 files changed
+6222
-8660
No files matched your search
@@ -1,8 +1,13 @@
|
||||
# Utility Function Patterns
|
||||
|
||||
**Status**: Active
|
||||
**Last Updated**: 2026-11-03 (v2.10.1; reviewed, content from 2025-11-18)
|
||||
|
||||
## Purpose
|
||||
|
||||
This document establishes coding patterns and conventions specifically for utility functions in StarPunk. These patterns ensure utilities are consistent, testable, and maintainable.
|
||||
This document establishes coding patterns and conventions specifically for utility functions in StarPunk (`starpunk/utils.py`, `starpunk/slug_utils.py`, `starpunk/mf2_utils.py` and helpers in other modules). These patterns ensure utilities are consistent, testable, and maintainable. General rules, including project-wide patterns for configuration, database access and outbound HTTP, are in [python-coding-standards.md](python-coding-standards.md); where the two differ, that document wins.
|
||||
|
||||
The examples are illustrative. Several mirror real functions in `starpunk/utils.py` (`calculate_content_hash`, `write_note_file`, `validate_slug`, `generate_slug`, `validate_note_path`); others (`require_valid_slug`, `iter_note_files`) only show the pattern.
|
||||
|
||||
## Philosophy
|
||||
|
||||
@@ -481,7 +486,7 @@ def generate_slug(content: str) -> str:
|
||||
# Additional validation
|
||||
if not validate_slug(normalized):
|
||||
# Fallback to safe default
|
||||
normalized = datetime.utcnow().strftime("%Y%m%d-%H%M%S")
|
||||
normalized = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S")
|
||||
|
||||
return normalized
|
||||
```
|
||||
@@ -500,7 +505,7 @@ def generate_slug(content: str, created_at: Optional[datetime] = None) -> str:
|
||||
|
||||
# Only generate timestamp if needed
|
||||
if not slug:
|
||||
created_at = created_at or datetime.utcnow()
|
||||
created_at = created_at or datetime.now(timezone.utc)
|
||||
slug = created_at.strftime("%Y%m%d-%H%M%S")
|
||||
|
||||
return slug
|
||||
@@ -705,7 +710,7 @@ def generate_slug(content: str) -> str:
|
||||
slug = normalize_slug_text(content)
|
||||
if not slug:
|
||||
# Explicit fallback with timestamp
|
||||
slug = datetime.utcnow().strftime("%Y%m%d-%H%M%S")
|
||||
slug = datetime.now(timezone.utc).strftime("%Y%m%d-%H%M%S")
|
||||
|
||||
return slug
|
||||
```
|
||||
@@ -726,7 +731,7 @@ def generate_slug(content: str) -> str:
|
||||
|
||||
## References
|
||||
|
||||
- [Python Coding Standards](/home/phil/Projects/starpunk/docs/standards/python-coding-standards.md)
|
||||
- [Python Coding Standards](python-coding-standards.md)
|
||||
- [PEP 8 - Style Guide](https://peps.python.org/pep-0008/)
|
||||
- [PEP 257 - Docstring Conventions](https://peps.python.org/pep-0257/)
|
||||
- [PEP 484 - Type Hints](https://peps.python.org/pep-0484/)
|
||||
|
||||
Reference in new issue
Block a user