Skip to content

Commit ef7c383

Browse files
committed
fix: add MD031 compliance and division-by-zero protection
- Fix MD031 markdown linting in svg_flowchart_guidelines.md by adding blank lines around fenced code block - Add NULLIF/COALESCE to postgre.md DISTINCT ON solution to guard against division by zero when first_orders is empty, returning 0.00 instead of NULL or error
1 parent 10d723b commit ef7c383

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

.agent/workflows/svg_flowchart_guidelines.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ description: SVG flowchart and data visualization best practices to avoid common
1717
1. **Always add 30-50px padding** below the last element in your viewBox height. If the last element ends at y=940 with ry=35, set viewBox height to at least `1000`.
1818

1919
2. **For dynamic data tables**, calculate viewBox height based on number of rows:
20+
2021
```
2122
viewBox height = header_height + (row_count × row_height) + summary_text_spacing + padding
2223
```

SQL/Leetcode/Intermediate Join/1174. Immediate Food Delivery II/Claude Sonnet 4.5 Extended/Immediate_Food_Delivery_II_postgre.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,12 @@ WITH first_orders AS (
8686
ORDER BY customer_id, order_date
8787
)
8888
SELECT
89-
ROUND(
90-
100.0 * COUNT(*) FILTER (WHERE is_immediate) / COUNT(*),
91-
2
89+
COALESCE(
90+
ROUND(
91+
100.0 * COUNT(*) FILTER (WHERE is_immediate) / NULLIF(COUNT(*), 0),
92+
2
93+
),
94+
0.00
9295
) AS immediate_percentage
9396
FROM first_orders;
9497
```

0 commit comments

Comments
 (0)