Skip to content

Commit 451d813

Browse files
wesmclaude
andcommitted
fix: Code style and test fixes for CI
- Fix test_non_drilled_columns_unaffected to expect category width 21 - Fix markdown ordered list in quickstart.md - Fix changelog line length - Auto-format code with ruff 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent a13cf40 commit 451d813

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

docs/getting-started/quickstart.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,12 @@ Let's rename a merchant:
154154
1. Press ++g++ until you see "Merchants" view
155155
2. Use arrow keys to find a merchant
156156
3. Press ++m++ to edit merchant name
157-
158-
![Edit merchant](../assets/screenshots/drill-down-bulk-edit-merchant.svg)
159-
160157
4. Type the new name, press ++enter++
161158
5. Press ++w++ to review changes
162159
6. Press ++enter++ to commit to your backend (Monarch/YNAB)
163160

161+
![Edit merchant](../assets/screenshots/drill-down-bulk-edit-merchant.svg)
162+
164163
Done! The change is now saved.
165164

166165
---

docs/reference/changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
**New:**
66

77
- **Encrypted caching enabled by default** - Transactions cached locally for instant startup; use `--no-cache` to disable
8-
- **Two-tier cache system** - Hot cache (last 90 days) refreshes after 6 hours; historical cache refreshes every 30 days (force with `--refresh`)
8+
- **Two-tier cache system** - Hot cache (last 90 days) refreshes after 6 hours; historical refreshes every 30 days
99
- **7 built-in color themes** - Choose from default, berg, nord, gruvbox, dracula, monokai, or solarized-dark
1010
- **Amazon order linking** - View matching Amazon orders in transaction info modal (press `i`)
1111
- **YNAB budget selector** - Choose from multiple budgets when connecting YNAB accounts

moneyflow/app.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2032,8 +2032,7 @@ def _search_amazon_items_for_query(self, query: str) -> set[str]:
20322032
import polars as pl
20332033

20342034
df = df.filter(
2035-
(pl.col("date") >= self.state.start_date)
2036-
& (pl.col("date") <= self.state.end_date)
2035+
(pl.col("date") >= self.state.start_date) & (pl.col("date") <= self.state.end_date)
20372036
)
20382037

20392038
# Initialize linker (use temp directory for demo mode)
@@ -2167,7 +2166,9 @@ def _load_amazon_matches_for_rows(self, start_row: int, end_row: int) -> None:
21672166
# Update the cell
21682167
try:
21692168
table.update_cell_at((row_idx, self._amazon_column_index), status)
2170-
logger.debug(f"Updated cell ({row_idx}, {self._amazon_column_index}) with status: {status[:20] if status else '(empty)'}...")
2169+
logger.debug(
2170+
f"Updated cell ({row_idx}, {self._amazon_column_index}) with status: {status[:20] if status else '(empty)'}..."
2171+
)
21712172
except Exception as e:
21722173
logger.debug(f"Failed to update cell ({row_idx}, {self._amazon_column_index}): {e}")
21732174

moneyflow/state.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,9 @@ class AppState:
158158

159159
# Search/filter
160160
search_query: str = ""
161-
amazon_search_ids: set[str] = dataclass_field(default_factory=set) # Txn IDs matching Amazon search
161+
amazon_search_ids: set[str] = dataclass_field(
162+
default_factory=set
163+
) # Txn IDs matching Amazon search
162164
show_transfers: bool = False # Whether to show Transfer category transactions
163165
show_hidden: bool = True # Whether to show transactions hidden from reports
164166

@@ -759,10 +761,9 @@ def get_filtered_df(self) -> Optional[pl.DataFrame]:
759761
if self.search_query:
760762
query = self.search_query.lower()
761763
# Include matches from merchant, category, or Amazon item names
762-
search_filter = (
763-
pl.col("merchant").str.to_lowercase().str.contains(query)
764-
| pl.col("category").str.to_lowercase().str.contains(query)
765-
)
764+
search_filter = pl.col("merchant").str.to_lowercase().str.contains(query) | pl.col(
765+
"category"
766+
).str.to_lowercase().str.contains(query)
766767
# Also include transactions matching Amazon item search
767768
if self.amazon_search_ids:
768769
search_filter = search_filter | pl.col("id").is_in(list(self.amazon_search_ids))

moneyflow/textual_view.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def update_table(
3434
) -> None:
3535
"""Update the main data table."""
3636
import logging
37+
3738
logger = logging.getLogger(__name__)
3839

3940
table = self.app.query_one("#data-table", DataTable)

tests/test_amazon_linker.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,7 +1102,12 @@ def test_fuzzy_match_sorted_by_amount_difference_when_dates_tied(
11021102
"order_id": "113-SMALLER-DIFF-222",
11031103
"date": "2025-01-10", # Same date
11041104
"items": [
1105-
{"name": "Small Diff Item", "amount": -52.00, "quantity": 1, "asin": "B001"},
1105+
{
1106+
"name": "Small Diff Item",
1107+
"amount": -52.00,
1108+
"quantity": 1,
1109+
"asin": "B001",
1110+
},
11061111
],
11071112
},
11081113
],
@@ -1224,9 +1229,7 @@ def test_item_match_not_used_when_order_total_matches(
12241229
assert len(matches) == 1
12251230
assert matches[0].confidence in ("high", "medium")
12261231

1227-
def test_item_match_returns_correct_item(
1228-
self, config_dir: Path, amazon_profile: Path
1229-
) -> None:
1232+
def test_item_match_returns_correct_item(self, config_dir: Path, amazon_profile: Path) -> None:
12301233
"""Should return only the matching item, not all items in order."""
12311234
# Multi-item order where we match the soundbar
12321235
create_amazon_db(

tests/test_formatters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -614,9 +614,9 @@ def test_non_drilled_columns_unaffected(self):
614614
drilled_value="Amazon",
615615
)
616616

617-
# Category should keep default width (20)
617+
# Category should keep default width (21 - fits "Business Electronics")
618618
category_col = [c for c in cols if c["key"] == "category"][0]
619-
assert category_col["width"] == 20
619+
assert category_col["width"] == 21
620620

621621
# Account should keep default width (20)
622622
account_col = [c for c in cols if c["key"] == "account"][0]

0 commit comments

Comments
 (0)