(connection: sqlite3.Connection)
| 2968 | |
| 2969 | |
| 2970 | def recent_targets(connection: sqlite3.Connection) -> list[dict[str, Any]]: |
| 2971 | targets: list[dict[str, Any]] = [] |
| 2972 | rows = connection.execute( |
| 2973 | """ |
| 2974 | SELECT target_path, MAX(updated_at) AS last_used_at |
| 2975 | FROM workspaces |
| 2976 | WHERE submitted = 1 AND target_path IS NOT NULL |
| 2977 | GROUP BY target_path |
| 2978 | ORDER BY last_used_at DESC |
| 2979 | """ |
| 2980 | ) |
| 2981 | for row in rows: |
| 2982 | try: |
| 2983 | inspected = inspect_target(row["target_path"]) |
| 2984 | except SystemExit: |
| 2985 | continue |
| 2986 | targets.append(inspected) |
| 2987 | if len(targets) == 5: |
| 2988 | break |
| 2989 | return targets |
| 2990 | |
| 2991 | |
| 2992 | def scan_context( |
no test coverage detected