Skip to content

Extract shared utilities into bib_utils.py#9

Merged
daharoni merged 1 commit intomainfrom
refactor-shared-bib-utils
Apr 8, 2026
Merged

Extract shared utilities into bib_utils.py#9
daharoni merged 1 commit intomainfrom
refactor-shared-bib-utils

Conversation

@daharoni
Copy link
Copy Markdown
Contributor

@daharoni daharoni commented Apr 8, 2026

Summary

  • Creates scripts/bib_utils.py with 7 shared functions that were duplicated across all 5 scripts: load_config, make_parser, load_bib_entries, load_base_entries, entry_changed, clean_latex, build_template_call
  • Restructures manifest to use a clean envelope {"entries": {...}, "deleted": [...]} instead of the _deleted sentinel key
  • Narrows exception handling in load_base_entries to expected parse errors
  • Compiles regexes at module level in push_to_wiki.py
  • Net result: -202 lines of duplication, +148 lines (including new shared module) = 54 fewer total lines

Test plan

  • CI passes (validate job runs all scripts)
  • Manual workflow_dispatch still works with the new manifest format

🤖 Generated with Claude Code

- Create scripts/bib_utils.py with load_config, make_parser,
  load_bib_entries, load_base_entries, entry_changed, clean_latex,
  and build_template_call
- Update all 5 scripts to use shared module instead of duplicated code
- Restructure manifest to use envelope {"entries": ..., "deleted": ...}
  instead of _deleted sentinel key
- Narrow exception handling in load_base_entries to expected parse errors
- Compile regexes at module level in push_to_wiki.py

Net reduction of 54 lines with zero duplication across scripts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 8, 2026

Citations Summary

Status: ✅ All checks passed

Metric Count
Total citations 2
Added 0
Edited 0
Removed 0
Keys normalized 0

@daharoni daharoni merged commit 356a4a9 into main Apr 8, 2026
2 checks passed
@daharoni daharoni deleted the refactor-shared-bib-utils branch April 8, 2026 18:11
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