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
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: CI

on:
push:
branches: ["*"]
pull_request:
branches: [main]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install linters
run: pip install flake8 ruff

- name: Run flake8
run: |
flake8 . \
--max-line-length=120 \
--extend-ignore=E501,W503,E402,E722,W291,W293,W391,E303,E302,E305,E261,E262,E127,E128,E221,F401,F403 \
--exclude=".git,__pycache__,build,dist,.claude,*.egg-info,venv,.venv,dashboard/journal_dashboard - Copy.py" \
--count --show-source --statistics

- name: Run ruff
run: |
ruff check . \
--line-length=120 \
--extend-ignore=E501,E402,E722,F401,F403 \
--extend-exclude=".git,__pycache__,build,dist,.claude,venv,.venv,dashboard/journal_dashboard - Copy.py"

test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.13"

- name: Install Tesseract OCR
run: sudo apt-get update && sudo apt-get install -y tesseract-ocr

- name: Install dependencies
run: |
pip install --upgrade pip
pip install -r requirements.txt
pip install pytest

- name: Run tests
run: |
if [ -d "tests" ]; then
python -m pytest tests/ -v --tb=short
else
echo "No tests directory found, skipping tests"
fi
4 changes: 2 additions & 2 deletions dashboard/journal_chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,9 @@
st.sidebar.metric("Total Entries", stats['total_entries'])
st.sidebar.metric("Total Words", f"{stats['total_words']:,}")
if stats['date_range']['first']:
st.sidebar.text(f"Date Range:")
st.sidebar.text("Date Range:")
st.sidebar.text(f"{stats['date_range']['first']}")
st.sidebar.text(f"to")
st.sidebar.text("to")
st.sidebar.text(f"{stats['date_range']['last']}")
except Exception:
pass
Expand Down
2 changes: 1 addition & 1 deletion dashboard/journal_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -949,4 +949,4 @@ def main():


if __name__ == "__main__":
main()
main()
6 changes: 3 additions & 3 deletions ocr/auto_ocr_watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@ def watch_folder(watch_dir: str, output_dir: str, engine: str = "tesseract"):
if not watch_path.exists():
raise FileNotFoundError(f"Watch directory does not exist: {watch_dir}")

print(f"Starting journal photo watcher...")
print("Starting journal photo watcher...")
print(f" Watching: {watch_path.absolute()}")
print(f" Output: {output_dir}")
print(f" OCR Engine: {engine}")
print(f"\nAdd new journal photos to the watch folder to process them automatically.")
print(f" Press Ctrl+C to stop.\n")
print("\nAdd new journal photos to the watch folder to process them automatically.")
print(" Press Ctrl+C to stop.\n")

# Initialize pipeline
pipeline = JournalOCRPipeline(engine=engine, output_dir=output_dir)
Expand Down
1 change: 0 additions & 1 deletion plugins/calendar_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def render(ctx):

theme = ctx.load_theme()
link_color = theme.get("link_color", "#0066cc")
bg_color = theme.get("bg_color", "#ffffff")
text_color = theme.get("text_color", "#111111")

# Determine a subtle highlight for entry days
Expand Down
8 changes: 4 additions & 4 deletions rag/journal_rag.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ def interactive_search(rag: JournalRAG, use_llm: bool = False, llm_model: str =
print("="*60)

stats = rag.get_stats()
print(f"\nDatabase Stats:")
print("\nDatabase Stats:")
print(f" Entries: {stats['total_entries']}")
print(f" Date Range: {stats['date_range']['first']} to {stats['date_range']['last']}")
print(f" Total Words: {stats['total_words']:,}")
Expand Down Expand Up @@ -541,7 +541,7 @@ def interactive_search(rag: JournalRAG, use_llm: bool = False, llm_model: str =

elif command == 'list':
entries = rag.list_all_entries()
print(f"\nAll entries in database:\n")
print("\nAll entries in database:\n")
for entry in entries:
print(f" {entry['date']} - {entry['chunks']} chunks, ~{entry['word_count']} words")
print()
Expand All @@ -565,7 +565,7 @@ def interactive_search(rag: JournalRAG, use_llm: bool = False, llm_model: str =

elif command == 'stats':
stats = rag.get_stats()
print(f"\nDatabase Statistics:")
print("\nDatabase Statistics:")
print(f" Total Entries: {stats['total_entries']}")
print(f" Total Chunks: {stats['total_chunks']}")
print(f" Total Words: {stats['total_words']:,}")
Expand Down Expand Up @@ -680,7 +680,7 @@ def main():

elif args.command == 'list':
entries = rag.list_all_entries()
print(f"\nAll entries in database:\n")
print("\nAll entries in database:\n")
for entry in entries:
print(f" {entry['date']} - {entry['chunks']} chunks, ~{entry['word_count']} words")
print(f"\nTotal: {len(entries)} entries\n")
Expand Down